Parser APIs Analysis

This page list the APIs which collected from different modules in run time leveraging SDC tosca-parser or NFV tosca-parser.







Project

Tosca Parser used

tosca-parser APIs which consumed now 

The input for each tosca parser API 

The output for the API used and mainly list the output which the project will consume

Project

Tosca Parser used

tosca-parser APIs which consumed now 

The input for each tosca parser API 

The output for the API used and mainly list the output which the project will consume

SO


SDC tosca parser



getAllottedResources()



Get all allotted node templates from this service.

getCapabilitiesOf(org.onap.sdc.toscaparser.api.NodeTemplate nt)

node template as a filtering element

Get CapabilityAssignments object for this node template.

getCapabilityPropertyLeafValue(org.onap.sdc.toscaparser.api.CapabilityAssignment capability, java.lang.String pathToPropertyLeafValue)

capability as CapabilityAssignment , full path separated by #

Get any property leaf value for capability by full path separated by #.

 getEntity(EntityQuery entityQuery, TopologyTemplateQuery topologyTemplateQuery, boolean isRecursive)

entityQuery as query parameter ,corresponding topology template ,isRecursive as boolean

Retrieves details of one or more entity templates according to provided query parameters from corresponding topology template

getGroupPropertyLeafValue(org.onap.sdc.toscaparser.api.Group group, java.lang.String leafValuePath)

group definition, full path separated by #

Get any property leaf value for a group definition by full path separated by #.

 getGroupsOfOriginOfNodeTemplateByToscaGroupType(org.onap.sdc.toscaparser.api.NodeTemplate nodeTemplate, java.lang.String groupType)

node template ,specified tosca group type

Get all groups of this of the origin component (nested topology template) of the node template by specified tosca group type

getInterfaces(org.onap.sdc.toscaparser.api.NodeTemplate nt)

node template

Get all interface names for given node template.

 getMetadataPropertyValue(org.onap.sdc.toscaparser.api.elements.Metadata metadata, java.lang.String metadataPropertyName)

parentNodeTemplate as node template, sdcType 

Get all node templates by sdcType for parent Node Template.

getNodeTemplatePropertyLeafValue(org.onap.sdc.toscaparser.api.NodeTemplate nodeTemplate, java.lang.String leafValuePath)

node template, full path separated by #

Get any property leaf value for node template by full path separated by #.
For example, for node template with this property:network_assignments:
ecomp_generated_network_assignment: true
is_shared_network: false
is_external_network: false
ipv4_subnet_default_assignments:
use_ipv4: true
ip_network_address_plan: 1.2.3.4
dhcp_enabled: true
ip_version: 4
cidr_mask: 24
min_subnets_count: 1
ipv6_subnet_default_assignments:
use_ipv6: false

calling
getNodeTemplatePropertyLeafValue(nodeTemplate, "network_assignments#ipv6_subnet_default_assignments#use_ipv6")
will return "false".

getPoliciesOfTarget(org.onap.sdc.toscaparser.api.NodeTemplate nodeTemplate)

node template as target

Get all the policies, which contain the specified node template as a target
(the list of the policies)

 getRequirementsOf(org.onap.sdc.toscaparser.api.NodeTemplate nt)

Node Template to get its requirement assignments

Get RequirementAssignments object for this node template.

getServiceInputs



Get the CSAR service inputs list.

getServiceMetadata



Get service Metadata object.
( "metadata" section of a CSAR service)

getServiceNodeTemplateBySdcType(SdcTypes sdcType)

sdc type as enum for CSAR

Get all node templates by SDC type enum for this CSAR service.

 getServiceNodeTemplates()



Get all node templates for this CSAR service.

getVfcListByVf(java.lang.String vfCustomizationId)

customizationUuid of the VF node template.

Get all VFC node templates from a specified VF.

getServiceVlList()



Get all VL node templates of the CSAR service.

getServiceVfList()



Get all VF node templates of the CSAR service.

getVfModulesByVf(java.lang.String vfCustomizationUuid)



Get groups of a VF with type "org.onap.groups.VfModule".

VF-C

nfv-toscaparser

ToscaTemplate

Path=file_name
parsed_params=valid_params                                no_required_paras_check=True                          debug_mode=True

METADATA = "metadata"
PROPERTIES = "properties"
DESCRIPTION = "description"
REQUIREMENTS = "requirements"
INTERFACES = "interfaces"
TOPOLOGY_TEMPLATE = "topology_template"
INPUTS = "inputs"
CAPABILITIES = "capabilities"
ATTRIBUTES = "attributes"
ARTIFACTS = "artifacts"
DERIVED_FROM = "derived_from"

UUI 

SDC tosca parser

org.openecomp.sdc.toscaparser.api.ToscaTemplate

csarFilePath

public String getPath()
public String getVersion()
public String getDescription()
public TopologyTemplate getTopologyTemplate()
public Metadata getMetaData()
public ArrayList<Input> getInputs()
public ArrayList<Output> getOutputs()
public ArrayList<Policy> getPolicies()
public ArrayList<NodeTemplate> getNodeTemplates()
public LinkedHashMap<String, Object> getMetaProperties(String propertiesFile)
public boolean hasNestedTemplates()
public ArrayList<TopologyTemplate> getNestedTemplates()

VNFSDK - pkgtools

nfv-toscaparser

toscaparser.tosca_template. ToscaTemplate

ToscaTemplate(path=entry_path, no_required_paras_check=True)

nodetemplates

Policy

SDC tosca parser

getNodeTemplateMetadata

Node template to get its Metadata object.

Metadata for this node template

getNodeTemplateChildren

Node Template to get its children

list of children node templates

getTypeOfNodeTemplate

node template object

node template object

getCapabilitiesOf

node template object

CapabilitiesAssignments that contains list of capability assignments for the node template

getCapabilityPropertyLeafValue

capability assignment where the property should be looked up + the full path of the required property.

the leaf value as String

getNodeTemplatePropertyLeafValue

nodeTemplate + the full path of the required property.

the leaf value as String

getRequirementsOf

nodeTemplate

contains list of requirement assignments for the node template

getServiceVfList



all Vf node templates

getServiceMetadata



the service Metadata object



The API requirements:

1.  get "metadata" or getting a property value in 'metadata'

2. get "inputs"

3. get "NodeTemplates" or get the ''NodeTemplates" by type

4. get full set of "properties" for a nodetemplate or get the leaf value for the "properties"

5. get "requirements" for a nodetemplate

6. get "policies" for a nodetemplate

7. get "interfaces" for a nodetemplate

8. get "capabilites" for a nodetemplate or get the leaf value for the "capabilites"

9. get "description"

10. get "artifacts"

11. get "groups" for a nodetemplate or get the leaf value for the "groups"

12. get all VL or VF node template in csar package

13. get VFC node templates for a VF nodetemplate