update from RIFT as of 696b75d2fe9fb046261b08c616f1bcf6c0b54a9b second try
[osm/SO.git] / common / python / rift / mano / yang_translator / test / data / ping_pong_tosca.yaml
1 tosca_definitions_version: tosca_simple_profile_for_nfv_1_0_0
2 description: Toy NS
3 metadata:
4   ID: ping_pong_nsd
5   vendor: RIFT.io
6   version: 1.0
7 data_types:
8   tosca.datatypes.network.riftio.vnf_configuration:
9     properties:
10       config_details:
11         type: map
12       config_type:
13         type: string
14 capability_types:
15   tosca.capabilities.riftio.mgmt_interface_type:
16     derived_from: tosca.capabilities.Endpoint
17     properties:
18       dashboard_params:
19         type: map
20       vdu:
21         type: string
22   tosca.capabilities.riftio.http_endpoint_type:
23     derived_from: tosca.capabilities.Endpoint
24     properties:
25       path:
26         type: string
27       polling_interval:
28         type: integer
29   tosca.capabilities.riftio.monitoring_param:
30     derived_from: tosca.capabilities.nfv.Metric
31     properties:
32       description:
33         type: string
34       group_tag:
35         default: Group1
36         type: string
37       http_endpoint_ref:
38         type: string
39       id:
40         type: integer
41       json_query_method:
42         default: NAMEKEY
43         type: string
44       name:
45         type: string
46       units:
47         type: string
48       value_type:
49         default: INT
50         type: string
51       widget_type:
52         default: COUNTER
53         type: string
54 node_types:
55   tosca.nodes.riftio.CP1:
56     derived_from: tosca.nodes.nfv.CP
57     properties:
58       cp_type:
59         description: Type of the connection point
60         type: string
61       name:
62         description: Name of the connection point
63         type: string
64       vdu_intf_name:
65         description: Name of the interface on VDU
66         type: string
67       vdu_intf_type:
68         description: Type of the interface on VDU
69         type: string
70   tosca.nodes.riftio.VL1:
71     derived_from: tosca.nodes.nfv.VL.ELAN
72     properties:
73       description:
74         type: string
75   tosca.nodes.riftio.VNF1:
76     derived_from: tosca.nodes.nfv.VNF
77     properties:
78       port:
79         constraints:
80         - in_range: [1, 65535]
81         type: integer
82       start_by_default:
83         type: boolean
84         default: true
85       vnf_configuration:
86         type: tosca.datatypes.network.riftio.vnf_configuration
87     capabilities:
88       http_endpoint:
89         type: tosca.capabilities.riftio.http_endpoint_type
90       mgmt_interface:
91         type: tosca.capabilities.riftio.mgmt_interface_type
92       monitoring_param_0:
93         type: tosca.capabilities.riftio.monitoring_param
94       monitoring_param_1:
95         type: tosca.capabilities.riftio.monitoring_param
96     requirements:
97     - vdus:
98         node: tosca.nodes.riftio.VDU1
99         occurences: [1, UNBOUND]
100         relationship: tosca.relationships.nfv.VirtualLinksTo
101         type: tosca.capabilities.nfv.VirtualLinkable
102   tosca.nodes.riftio.VDU1:
103     derived_from: tosca.nodes.nfv.VDU
104     properties:
105       cloud_init:
106         default: #cloud-config
107         type: string
108       count:
109         default: 1
110         type: integer
111     capabilities:
112       virtualLink:
113         type: tosca.capabilities.nfv.VirtualLinkable
114 group_types:
115   tosca.groups.riftio.ConfigPrimitives:
116     derived_from: tosca.policies.Root
117     properties:
118       primitive: map
119 policy_types:
120   tosca.policies.riftio.InitialConfigPrimitive:
121     derived_from: tosca.policies.Root
122     properties:
123       name:
124         type: string
125       parameter:
126         type: map
127       seq:
128         type: integer
129       user_defined_script:
130         type: string
131   tosca.policies.riftio.ScalingGroup:
132     derived_from: tosca.policies.Root
133     properties:
134       config_actions:
135         type: map
136       max_instance_count:
137         type: integer
138       min_instance_count:
139         type: integer
140       name:
141         type: string
142       vnfd_members:
143         type: map
144 topology_template:
145   policies:
146   - scaling_group_descriptor:
147       config_actions:
148         post_scale_out: ping config
149       max_instance_count: 10
150       min_instance_count: 1
151       name: ping_group
152       type: tosca.policies.riftio.ScalingGroup
153       vnfd_members:
154         ping_vnfd: 1
155   - initial_config_primitive:
156       name: start traffic
157       seq: 1
158       type: tosca.policies.riftio.InitialConfigPrimitive
159       user_defined_script: start_traffic.py
160   groups:
161     config_primitive:
162       type: tosca.groups.riftio.ConfigPrimitives
163       members:
164       - ping_vnfd
165       - pong_vnfd
166       properties:
167         primitives:
168           ping config:
169             user_defined_script: ping_config.py
170   inputs:
171     vendor:
172       type: string
173       description: Translated from YANG
174   node_templates:
175     ping_vnfd:
176       type: tosca.nodes.riftio.VNF1
177       properties:
178         id: 1
179         port: 18888
180         start_by_default: false
181         vendor: RIFT.io
182         version: 1.0
183         vnf_configuration:
184           config_details:
185             script_type: bash
186           config_type: script
187       capabilities:
188         http_endpoint:
189           properties:
190             path: api/v1/ping/stats
191             polling_interval: 2
192             port: 18888
193             protocol: http
194         mgmt_interface:
195           properties:
196             dashboard_params:
197               path: api/v1/ping/stats
198               port: 18888
199             port: 18888
200             protocol: tcp
201             vdu: ping_vnfd_iovdu_0
202         monitoring_param_0:
203           properties:
204             description: no of ping requests
205             group_tag: Group1
206             http_endpoint_ref: api/v1/ping/stats
207             id: 1
208             json_query_method: NAMEKEY
209             name: ping-request-tx-count
210             units: packets
211             value_type: INT
212             widget_type: COUNTER
213         monitoring_param_1:
214           properties:
215             description: no of ping responses
216             group_tag: Group1
217             http_endpoint_ref: api/v1/ping/stats
218             id: 2
219             json_query_method: NAMEKEY
220             name: ping-response-rx-count
221             units: packets
222             value_type: INT
223             widget_type: COUNTER
224       requirements:
225       - vdus:
226           node: ping_vnfd_iovdu_0
227     pong_vnfd_iovdu_0:
228       type: tosca.nodes.riftio.VDU1
229       properties:
230         cloud_init: "#cloud-config\npassword: fedora\nchpasswd: { expire: False }\n\
231           ssh_pwauth: True\nruncmd:\n  - [ systemctl, daemon-reload ]\n  - [ systemctl,\
232           \ enable, pong.service ]\n  - [ systemctl, start, --no-block, pong.service\
233           \ ]\n  - [ ifup, eth1 ]\n"
234         count: 1
235       capabilities:
236         host:
237           properties:
238             disk_size: 4 GB
239             mem_size: 512 MB
240             num_cpus: 1
241       artifacts:
242         pong_vnfd_iovdu_0_vm_image:
243           file: ../images/Fedora-x86_64-20-20131211.1-sda-pong.qcow2
244           image_checksum: 1234567890abcdefg
245           type: tosca.artifacts.Deployment.Image.riftio.QCOW2
246       interfaces:
247         Standard:
248           create: pong_vnfd_iovdu_0_vm_image
249     pong_vnfd_cp0:
250       type: tosca.nodes.riftio.CP1
251       properties:
252         cp_type: VPORT
253         name: pong_vnfd/cp0
254         vdu_intf_name: eth0
255         vdu_intf_type: VIRTIO
256       requirements:
257       - virtualBinding:
258           node: pong_vnfd_iovdu_0
259       - virtualLink:
260           node: ping_pong_vld
261     ping_pong_vld:
262       type: tosca.nodes.riftio.VL1
263       properties:
264         description: Toy VL
265         vendor: RIFT.io
266     ping_vnfd_cp0:
267       type: tosca.nodes.riftio.CP1
268       properties:
269         cp_type: VPORT
270         name: ping_vnfd/cp0
271         vdu_intf_name: eth0
272         vdu_intf_type: VIRTIO
273       requirements:
274       - virtualBinding:
275           node: ping_vnfd_iovdu_0
276       - virtualLink:
277           node: ping_pong_vld
278     pong_vnfd:
279       type: tosca.nodes.riftio.VNF1
280       properties:
281         id: 2
282         port: 18889
283         vendor: RIFT.io
284         version: 1.0
285         vnf_configuration:
286           config_delay: 60
287           config_details:
288             script_type: bash
289           config_priority: 1
290           config_template: "\n#!/bin/bash\n\n# Rest API configuration\npong_mgmt_ip=<rw_mgmt_ip>\n\
291             pong_mgmt_port=18889\n# username=<rw_username>\n# password=<rw_password>\n\
292             \n# VNF specific configuration\npong_server_ip=<rw_connection_point_name\
293             \ pong_vnfd/cp0>\nserver_port=5555\n\n# Make Rest API calls to configure\
294             \ VNF\ncurl -D /dev/stdout \\\n    -H \"Accept: application/vnd.yang.data+xml\"\
295             \ \\\n    -H \"Content-Type: application/vnd.yang.data+json\" \\\n   \
296             \ -X POST \\\n    -d \"{\\\"ip\\\":\\\"$pong_server_ip\\\", \\\"port\\\
297             \":$server_port}\" \\\n    http://${pong_mgmt_ip}:${pong_mgmt_port}/api/v1/pong/server\n\
298             rc=$?\nif [ $rc -ne 0 ]\nthen\n    echo \"Failed to set server(own) info\
299             \ for pong!\"\n    exit $rc\nfi\n\nexit 0\n"
300           config_type: script
301       capabilities:
302         http_endpoint:
303           properties:
304             path: api/v1/pong/stats
305             polling_interval: 2
306             port: 18889
307             protocol: http
308         mgmt_interface:
309           properties:
310             dashboard_params:
311               path: api/v1/pong/stats
312               port: 18889
313             port: 18889
314             protocol: tcp
315             vdu: pong_vnfd_iovdu_0
316         monitoring_param_0:
317           properties:
318             description: no of ping requests
319             group_tag: Group1
320             http_endpoint_ref: api/v1/pong/stats
321             id: 1
322             json_query_method: NAMEKEY
323             name: ping-request-rx-count
324             units: packets
325             value_type: INT
326             widget_type: COUNTER
327         monitoring_param_1:
328           properties:
329             description: no of ping responses
330             group_tag: Group1
331             http_endpoint_ref: api/v1/pong/stats
332             id: 2
333             json_query_method: NAMEKEY
334             name: ping-response-tx-count
335             units: packets
336             value_type: INT
337             widget_type: COUNTER
338       requirements:
339       - vdus:
340           node: pong_vnfd_iovdu_0
341     ping_vnfd_iovdu_0:
342       type: tosca.nodes.riftio.VDU1
343       properties:
344         cloud_init: "#cloud-config\npassword: fedora\nchpasswd: { expire: False }\n\
345           ssh_pwauth: True\nruncmd:\n  - [ systemctl, daemon-reload ]\n  - [ systemctl,\
346           \ enable, ping.service ]\n  - [ systemctl, start, --no-block, ping.service\
347           \ ]\n  - [ ifup, eth1 ]\n"
348         count: 1
349       capabilities:
350         host:
351           properties:
352             disk_size: 4 GB
353             mem_size: 512 MB
354             num_cpus: 1
355       artifacts:
356         ping_vnfd_iovdu_0_vm_image:
357           file: ../images/Fedora-x86_64-20-20131211.1-sda-ping.qcow2
358           image_checksum: 1234567890abcdefg
359           type: tosca.artifacts.Deployment.Image.riftio.QCOW2
360       interfaces:
361         Standard:
362           create: ping_vnfd_iovdu_0_vm_image