commit | a2705637c17beb663c47f82b03279e479ed2f8ca | [log] [tgz] |
---|---|---|
author | Yuli Shlosberg <ys9693@att.com> | Tue Aug 14 16:52:58 2018 +0300 |
committer | Yuli Shlosberg <ys9693@att.com> | Tue Aug 14 16:52:58 2018 +0300 |
tree | 32e25f1692c718f068ed54657489a5b86a206302 | |
parent | 9cc8dff8223e03b6a5bc5cfc2c23d31989de2c61 [diff] |
Enable types validation feature InvalidTypeError added to conf This conf addition will case to parser throw exception in case that invalid type found during parsing process Change-Id: I6497d32862e64abaeec20d30da50fff4c5964d4e Issue-ID: SDC-1646 Signed-off-by: Yuli Shlosberg <ys9693@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>