commit | c6bdb4e477d0ad6b146ce811f32fc8356c12a226 | [log] [tgz] |
---|---|---|
author | Sonsino, Ofir (os0695) <os0695@intl.att.com> | Tue Apr 30 20:39:59 2019 +0300 |
committer | Sonsino, Ofir (os0695) <os0695@intl.att.com> | Tue Apr 30 20:39:59 2019 +0300 |
tree | 299b0cd25ad4b4d1c9c0211e1f7be49e8c6f5d0d | |
parent | 9c48804399cb73b135b3f1c7a321b225635caf2c [diff] |
Remove staging versions from pom.xml Change-Id: Ifb86d85d7e9915d820ca7d275f0137d2913749e7 Issue-ID: SDC-2244 Signed-off-by: Sonsino, Ofir (os0695) <os0695@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.
getEntity API retrieves details of one or more entity templates according to provided query parameters from corresponding topology template.
entityQuery Object describing the searched entity parameters. Includes one of following parameters: entity type, SDC (node template) type, tosca type as well as optional customizationUUID and UUID If the parameter is null, the returned result will contain all entities that types are supported by SDC.
topologyTemplateQuery parameters of the topology template containing the above entity. Includes SDC type of the container and optional customizationUUID.
isRecursive indicates if the search is recursive starting from the required topology template.
Returns list of IEntityDetails objects containing information about the found entities. If either no entities found or the provided query is incorrect, an empty list is returned.
List<IEntityDetails> getEntity(EntityQuery entityQuery, TopologyTemplateQuery topologyTemplateQuery, boolean isRecursive);