commit | 49ddd53062def299766fcb0028dd7321777ffaaa | [log] [tgz] |
---|---|---|
author | Michael Lando <ml636r@att.com> | Mon Aug 06 09:27:48 2018 +0300 |
committer | Michael Lando <ml636r@att.com> | Mon Aug 06 09:27:48 2018 +0300 |
tree | a44e50315c18fc5ffe621d2eb18b3edbaf0d676f | |
parent | 36738baf503887fafef18388a33f68240a0de012 [diff] |
update readem file add sections * important links * release notes * compilation * local CSAR execution Change-Id: I23a05cb28213d12b48073d5d6ec2e1ceb1f8839c Issue-ID: SDC-1599 Signed-off-by: Michael Lando <ml636r@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");