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