commit | 64ba526aaf02ad291078be8e6f66f6c280ffb72b | [log] [tgz] |
---|---|---|
author | Tal Gitelman <tal.gitelman@att.com> | Wed Jan 23 19:12:45 2019 +0200 |
committer | Ofir Sonsino <ofir.sonsino@intl.att.com> | Thu Jan 24 09:14:27 2019 +0000 |
tree | ee90a74e6e0672ce0886f0b7129212a43534dc6c | |
parent | 1896bb2139b18dc1f0656a461580302f6ca15122 [diff] |
SDC distribution failed bug fix Change-Id: I49da695ec684f0674dbabb636aff9f5768ad321d Issue-ID: SDC-1955 Signed-off-by: Tal Gitelman <tal.gitelman@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