Yang to TOSCA output template for test case. 97/5397/3
authorshangxdy <shang.xiaodong@zte.com.cn>
Thu, 31 Dec 2015 08:23:16 +0000 (16:23 +0800)
committershangxdy <shang.xiaodong@zte.com.cn>
Tue, 12 Jan 2016 05:10:34 +0000 (13:10 +0800)
As a test engineer,I want to understand how to verify the output of
yang-to-tosca based specific input.so that I can define output template.

JIRA:PARSER-16

Change-Id: Id17e86db9667715e43615195570854ae1ead5e8b
Signed-off-by: shangxdy <shang.xiaodong@zte.com.cn>
docs/yang2tosca/clearwater_tosca.yaml [new file with mode: 0644]

diff --git a/docs/yang2tosca/clearwater_tosca.yaml b/docs/yang2tosca/clearwater_tosca.yaml
new file mode 100644 (file)
index 0000000..2b4dd52
--- /dev/null
@@ -0,0 +1,151 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+description: >
+  This module defines a VNF Deployment Unit.
+
+metadata:
+  template_name: clearwater
+  template_author: HP
+
+dsl_definitions:
+  compute_props_host_ellis: &compute_props_host_ellis
+    num_cpu: 4
+    mem_size: 4096
+  compute_props_host_bono: &compute_props_host_bono
+    num_cpu: 3
+    mem_size: 2048
+
+node_types:
+  tosca.nodes.compute.ellis:
+    derived_from: tosca.nodes.compute
+
+  tosca.nodes.compute.bono:
+    derived_from: tosca.nodes.compute
+
+topology_template:
+  # a description of the topology template
+  description: >
+
+
+  inputs:
+   storage_size:
+     type: scalar-unit.size
+     default: 2048 M
+     description: The required storage resource
+
+   storage_location:
+     type: string
+     description: >
+       Block storage mount point (filesystem path).
+
+  node_templates:
+    ellis:
+      type: tosca.nodes.compute.ellis
+      capabilities:
+        host:
+          properties: *compute_props_host_ellis
+        scalable:
+          properties:
+            min_instances: 1
+            default_instances: 1
+      requirements:
+        - local_storage:
+            node: ellis_BlockStorage
+            relationship:
+              type: AttachesTo
+                properties:
+                  location: { get_input: storage_location }
+      interfaces:
+        Standard:
+          start:
+            implementation: start.sh
+          delete:
+            implementaion: stop.sh
+          stop:
+            implementaion: shutdown.sh
+
+    ellis_BlockStorage:
+      type: tosca.nodes.BlockStorage
+      properties:
+        size: { get_input: storage_size }
+
+    bono:
+      type: tosca.nodes.compute.bono
+      capabilities:
+        host:
+          properties: *compute_props_host_bono
+        scalable:
+          properties:
+            min_instances: 3
+            default_instances: 3
+      requirements:
+        - local_storage:
+            node: bono_BlockStorage
+            relationship:
+              type: AttachesTo
+                properties:
+                  location: { get_input: storage_location }
+      interfaces:
+        Standard:
+          start:
+            implementation: start.sh
+          delete:
+            implementaion: stop.sh
+          stop:
+            implementaion: shutdown.sh
+
+    bono_BlockStorage:
+      type: tosca.nodes.BlockStorage
+      properties:
+        size: { get_input: storage_size }
+
+    clearwater_network1:
+      type: tosca.nodes.network.Network
+      properties:
+        ip_version: 4
+
+    ellis_port1:
+      type: tosca.nodes.network.Port
+      requirements:
+        - binding:
+            node: ellis
+        - link:
+            node: clearwater_network1
+
+    clearwater_network2:
+      type: tosca.nodes.network.Network
+      properties:
+        ip_version: 4
+
+    ellis_port2:
+      type: tosca.nodes.network.Port
+      requirements:
+        - binding:
+            node: ellis
+        - link:
+            node: clearwater_network2
+
+    clearwater_network1:
+      type: tosca.nodes.network.Network
+      properties:
+        ip_version: 4
+
+    bono_port1:
+      type: tosca.nodes.network.Port
+      requirements:
+        - binding:
+            node: bono
+        - link:
+            node: clearwater_network1
+
+    clearwater_network2:
+      type: tosca.nodes.network.Network
+      properties:
+        ip_version: 4
+
+    bono_port2:
+      type: tosca.nodes.network.Port
+      requirements:
+        - binding:
+            node: bono
+        - link:
+            node: clearwater_network2