commit | 5fb70e85c56490ff1adbcf0b7b2caedd646d9c42 | [log] [tgz] |
---|---|---|
author | Manzon, Inna (im453s) <im453s@intl.att.com> | Thu Oct 04 16:36:16 2018 +0300 |
committer | Manzon, Inna (im453s) <im453s@intl.att.com> | Thu Oct 04 16:36:16 2018 +0300 |
tree | 2388915fddffa5188b02a64725fa621077ce8416 | |
parent | 6d63aa53f4b14b4b41ec3a4734c5c62ab6c68b3a [diff] |
update readme Change-Id: I782fd8ead6a495033ef0a9b3b19a2e02b051f5a4 Issue-ID: SDC-1757 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.1</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