9 ONAP SDC-Tosca is delivered as helper JAR that can be used by clients that work with SDC TOSCA CSAR files.
10 It parses the CSAR and returns the model object which represents the CSAR contents, through designated function calls with SDC flavour.
11 It uses the underlying generic JTOSCA parser.
14 # Compiling ONAP JTOSCA
16 ONAP SDC-Tosca can be compiled easily using maven command: `mvn clean install`
17 The result is JAR file under "target" folder
19 # Testing a CSAR locally
20 to run the parser locally you can use the MyTest Junit test to easily execute the parser on your own input.
22 1. to run it place your csar in **sdc-tosca\src\test\resources\csars**
24 2. Go to the test class located at **sdc-tosca\src\test\java\org\onap\sdc\impl\MyTest.java**
26 3. un comment the logic ther and update the csar name you plced in the step above:
28 SdcToscaParserFactory factory = SdcToscaParserFactory.getInstance();
29 ISdcCsarHelper = getCsarHelper("csars/<your csar name example my.csar>");
31 //example of functions
32 //get node type by name
33 List<NodeTemplate> serviceNodeTemplatesByType = fdntCsarHelper.getServiceNodeTemplatesByType("org.openecomp.nodes.ForwardingPath");
34 //get node type property
35 String target_range = fdntCsarHelper.getNodeTemplatePropertyLeafValue(serviceNodeTemplatesByType.get(0), "target_range");
39 # Adding the SDC-Tosca to you project
40 the SDC tosca is avilalble as a maven depandency.
41 to use add the folowing depandency to your POM file:
44 <groupId>org.onap.sdc.sdc-tosca</groupId>
45 <artifactId>sdc-tosca</artifactId>
46 <version>1.4.6</version>
54 ##### [Mailing list](mailto:onap-sdc@lists.onap.org)
58 ##### [JIRA](http://jira.onap.org)
62 ##### [WIKI](https://wiki.onap.org/display/DW/Service+Design+and+Creation+%28SDC%29+Portal)
64 ##### [TOSCA Prser AID]((https://wiki.onap.org/display/DW/Service+Design+and+Creation+%28SDC%29+Portal))
76 1. **disable max conformance level validation**: until this version the parser had the definition of the max and min conformance level of the CSAR version which it supports.
77 the conformance level is generated by sdc and as a result the two had to be aligned, over wise the CSAR will fail on parsing.
78 from this version the max version will no longer be checked by the parser.
79 2. **Operations support**: add support for parsing the Operations in the tosca models.
84 1. **enable types validation** from this version all types in CSAR will be verified, all used types should be properly declared in "base" yml files e.g. node.yml , data.yml etc.
89 1. **validation fix** Maximum nodeTypes we allowed in CSAR file was increased from 10 to 20.
94 1. **list support for get input** until know the get input was only supported in the following format get_input \[ <list > , 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.
99 # the property type is list
101 #this is now supoorted you can retrive the whole list
102 get_input: port_vpg_private_0_port_related_networks
103 # the property type is string
105 # this will retrive a value from the list
107 - port_vpg_private_0_port_network
114 1. **getPropertyLeafValueByPropertyNamePathAndNodeTemplatePath API** The new Tosca Parser API resolves property value by path in the model (including nested nodes with # delimiter) and property name.
117 1. Classes FilterType.java, JToscaValidationIssueType.java, SdcTypes.java have been moved from **org.onap.sdc.tosca.parser.impl** package to **org.onap.sdc.tosca.parser.enums** package.
122 1. **remove use of a snapshot dependency** update jtosca dependency version from snapshot to release.
127 1. **validation fix** Null value caused to NullPointerException in validate function in DataEntity
133 1. A new API is declared:
135 *List<IEntityDetails> getEntity(EntityQuery entityQuery, TopologyTemplateQuery topologyTemplateQuery, boolean isRecursive)*
137 It is designed to retrieve details of one or more entity templates from corresponding topology template according to provided query parameters
139 2. Mock-up version of **getEntity** API is implemented.
142 This version is intended for SDN-C team usage only.
147 1. Bug fix in Policy metadata object getter (Jtosca)
148 2. NPE fix in Policy getTargets method (sdc-tosca)
149 3. Adding more getters to IEntityDetails interface for getEntity API introduced in 1.4.8 version:
151 **getEntity** API retrieves details of one or more entity templates according to provided query parameters from corresponding topology template.
153 **entityQuery** Object describing the searched entity parameters. Includes one of following parameters: entity type,
154 SDC (node template) type, tosca type as well as optional customizationUUID and UUID
155 If the parameter is null, the returned result will contain *all* entities that types are supported by SDC.
157 **topologyTemplateQuery** parameters of the topology template containing the above entity.
158 Includes SDC type of the container and optional customizationUUID.
160 **isRecursive** indicates if the search is recursive starting from the required topology template.
162 Returns list of **IEntityDetails** objects containing information about the found entities.
163 If either no entities found or the provided query is incorrect, an empty list is returned.
165 List<IEntityDetails> getEntity(EntityQuery entityQuery, TopologyTemplateQuery topologyTemplateQuery, boolean isRecursive);