commit | 8e4f8425e2a0bb7a9e6cadf48537bc93d4680e25 | [log] [tgz] |
---|---|---|
author | Manzon, Inna (im453s) <im453s@intl.att.com> | Tue Jan 22 10:45:12 2019 +0200 |
committer | Manzon, Inna (im453s) <im453s@intl.att.com> | Tue Jan 22 14:16:31 2019 +0200 |
tree | b99cad4bf656b00a05c5a489dc7a6e0e7dfa74b1 | |
parent | f88cee9d9e7e77dfdea743928199472dad7bde82 [diff] |
Fix NPE, add getters to IEntityDetails Change-Id: Ia150f003fade5a276d785b2be90a8d9f63ab9f4e Issue-ID: SDC-2057 Signed-off-by: Manzon, Inna (im453s) <im453s@intl.att.com>
ONAP SDC-Tosca is delivered as helper JAR that can be used by clients that work with SDC TOSCA CSAR files. It parses the CSAR and returns the model object which represents the CSAR contents, through designated function calls with SDC flavour. It uses the underlying generic JTOSCA parser.
ONAP SDC-Tosca can be compiled easily using maven command: mvn clean install
The result is JAR file under "target" folder
to run the parser locally you can use the MyTest Junit test to easily execute the parser on your own input.
to run it place your csar in sdc-tosca\src\test\resources\csars
Go to the test class located at sdc-tosca\src\test\java\org\onap\sdc\impl\MyTest.java
un comment the logic ther and update the csar name you plced in the step above:
SdcToscaParserFactory factory = SdcToscaParserFactory.getInstance(); ISdcCsarHelper = getCsarHelper("csars/<your csar name example my.csar>"); //example of functions //get node type by name List<NodeTemplate> serviceNodeTemplatesByType = fdntCsarHelper.getServiceNodeTemplatesByType("org.openecomp.nodes.ForwardingPath"); //get node type property String target_range = fdntCsarHelper.getNodeTemplatePropertyLeafValue(serviceNodeTemplatesByType.get(0), "target_range");
the SDC tosca is avilalble as a maven depandency. to use add the folowing depandency to your POM file:
<dependency> <groupId>org.onap.sdc.sdc-tosca</groupId> <artifactId>sdc-tosca</artifactId> <version>1.4.6</version> </dependency>
list support for get input until know the get input was only supported in the following format get_input [ , index ] this way was the only option for using a list typed property and retrieving its value for a use in a property , from this release you can use get input < list> to retrieve the whole list.
example:
properties: # the property type is list related_networks: #this is now supoorted you can retrive the whole list get_input: port_vpg_private_0_port_related_networks # the property type is string network: # this will retrive a value from the list get_input: - port_vpg_private_0_port_network - index_value
List getEntity(EntityQuery entityQuery, TopologyTemplateQuery topologyTemplateQuery, boolean isRecursive)
It is designed to retrieve details of one or more entity templates from corresponding topology template according to provided query parameters
This version is intended for SDN-C team usage only.