From a6d5628ab5648f44aa3c04f19a26ed59a7602be7 Mon Sep 17 00:00:00 2001 From: shiva-charan Date: Wed, 17 Aug 2016 04:37:56 -0500 Subject: [PATCH] JIRA:PARSER-1 -XSLT script for YANG to TOSCA Change-Id: I29f80ab21354af452fc95b155c04171001f9577e Signed-off-by: shiva-charan --- yang2tosca/tosca_transformer.xslt | 328 +++++++++++++++++++++++++------------- 1 file changed, 217 insertions(+), 111 deletions(-) diff --git a/yang2tosca/tosca_transformer.xslt b/yang2tosca/tosca_transformer.xslt index c8953ac..a378f14 100644 --- a/yang2tosca/tosca_transformer.xslt +++ b/yang2tosca/tosca_transformer.xslt @@ -35,109 +35,157 @@ See the License for the specific language governing permissions and limitations metadata: - ID: - Vendor: + ID: + Vendor: dsl_definitions: - compute_props_host_:compute_props_host_ - - num_cpu: - - - - mem_size: - - - - - + compute_props_host_: compute_props_host_ + + num_cpu: + + + + mem_size: + + + + + node_types: - tosca.nodes.compute.: - derived_from:tosca.nodes.compute + tosca.nodes.compute.: + derived_from: tosca.nodes.compute topology_template: - # a description of the topology template - description:> - - inputs: - storage_size: - type:scalar-unit.size - - default: - description: - - - storage_location: - type:string - description:> - Block storage mount point (filesystem path). - node_templates: - - : - type:tosca.nodes.Compute - capabilities: - os: - properties: - architecture: - type: - distribution: - version: - host: - properties:*compute_props_host_ - scalable: - properties: - min_instances: - - - default_instances: - - - requirements: - - local_storage: - node:_BlockStorage - relationship: - type:AttachesTo - properties: - location:{ get_input:storage_location } - interfaces: - Standard: - - - - - start: - implementation: - - - delete: - implementaion: - - - stop: - implementaion: - - - - - - - - _BlockStorage: - type:tosca.nodes.BlockStorage - properties: - size:{ get_input:storage_size } - - - - - - - - - - - + # A description of the topology template + description: > + + inputs: + storage_size: + type: scalar-unit.size + + default: + description: + + + storage_location: + type: string + description: > + Block storage mount point (filesystem path). + node_templates: + + : + type: tosca.nodes.Compute + capabilities: + os: + properties: + architecture: + type: + distribution: + version: + host: + properties: *compute_props_host_ + scalable: + properties: + min_instances: + + + default_instances: + + + requirements: + - local_storage: + node: _BlockStorage + relationship: + type: AttachesTo + properties: + location: { get_input:storage_location } + interfaces: + Standard: + + + + + start: + implementation: + + + delete: + implementaion: + + + stop: + implementaion: + + + + + + + + monitoring_policy: + name: + parameters: + + + + + : + + + + + actions: + + : + + + + + _BlockStorage: + type: tosca.nodes.BlockStorage + properties: + size: { get_input:storage_size } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -146,20 +194,78 @@ topology_template: _network: - type:tosca.nodes.network.Network - properties: - ip_version:4 - _port: - type:tosca.nodes.network.Port - requirements: - - binding: - node: - - link: - node:_network - - - - + type:tosca.nodes.network.Network + properties: + ip_version:4 + _port: + type:tosca.nodes.network.Port + requirements: + - binding: + node: + - link: + node:_network + + + + + + + + + + + + : + #Endpoint for the VNF + type: tosca.nodes.nfv.CP + properties: + type: + requirements: + + + + + + + + + + + + + CP: + type: tosca.nodes.nfv.CP + properties: + type: + requirements: + - virtualLink: + node: + - virtualBinding: + node: + + + + + + + + + + + + + VL: + type: tosca.nodes.nfv.VL + properties: + network_name: + vendor: + capabilities: + -virtualLink + occurrences: + + + + -- 2.16.6