Merge TOSCA changes from RIFT to OSM
[osm/SO.git] / common / python / rift / mano / tosca_translator / test / data / tosca_ping_pong_epa / Definitions / pong_vnfd.yaml
1 tosca_definitions_version: tosca_simple_profile_for_nfv_1_0
2 description: This is an example RIFT.ware VNF
3 metadata:
4   ID: pong_vnfd
5   vendor: RIFT.io
6   version: 1.0
7 imports:
8 - riftiotypes.yaml
9 node_types:
10   tosca.nodes.nfv.riftio.pongvnfdVNF:
11     derived_from: tosca.nodes.nfv.riftio.VNF1
12     requirements:
13     - virtualLink1:
14         type: tosca.nodes.nfv.VL
15 topology_template:
16   policies:
17   - configuration:
18       properties:
19         config:
20           config_delay: 60
21           config_details:
22             script_type: bash
23           config_priority: 1
24           config_template: "\n#!/bin/bash\n\n# Rest API configuration\npong_mgmt_ip=<rw_mgmt_ip>\n\
25             pong_mgmt_port=18889\n# username=<rw_username>\n# password=<rw_password>\n\
26             \n# VNF specific configuration\npong_server_ip=<rw_connection_point_name\
27             \ pong_vnfd/cp0>\nserver_port=5555\n\n# Make Rest API calls to configure\
28             \ VNF\ncurl -D /dev/null \\\n    -H \"Accept: application/vnd.yang.data+xml\"\
29             \ \\\n    -H \"Content-Type: application/vnd.yang.data+json\" \\\n   \
30             \ -X POST \\\n    -d \"{\\\"ip\\\":\\\"$pong_server_ip\\\", \\\"port\\\
31             \":$server_port}\" \\\n    http://${pong_mgmt_ip}:${pong_mgmt_port}/api/v1/pong/server\n\
32             rc=$?\nif [ $rc -ne 0 ]\nthen\n    echo \"Failed to set server(own) info\
33             \ for pong!\"\n    exit $rc\nfi\n\nexit 0\n"
34           config_type: script
35       targets: [pong_vnfd_iovdu_0]
36       type: tosca.policies.nfv.riftio.vnf_configuration
37   substitution_mappings:
38     node_type: tosca.nodes.nfv.riftio.pongvnfdVNF
39     requirements:
40     - virtualLink1: [pong_vnfd_cp0, virtualLink]
41   node_templates:
42     pong_vnfd_iovdu_0:
43       type: tosca.nodes.nfv.riftio.VDU1
44       properties:
45         cloud_init: "#cloud-config\npassword: fedora\nchpasswd: { expire: False }\n\
46           ssh_pwauth: True\nruncmd:\n  - [ systemctl, daemon-reload ]\n  - [ systemctl,\
47           \ enable, pong.service ]\n  - [ systemctl, start, --no-block, pong.service\
48           \ ]\n  - [ ifup, eth1 ]\n"
49         count: 1
50       capabilities:
51         hypervisor_epa:
52           properties:
53             type: PREFER_KVM
54             version: 1
55         mgmt_interface:
56           properties:
57             dashboard_params:
58               path: api/v1/pong/stats
59               port: 18889
60             port: 18889
61             protocol: tcp
62         monitoring_param:
63           properties:
64             description: no of ping requests
65             json_query_method: namekey
66             name: ping-request-rx-count
67             ui_data:
68               group_tag: Group1
69               units: packets
70               widget_type: counter
71             url_path: api/v1/pong/stats
72         monitoring_param_1:
73           properties:
74             description: no of ping responses
75             json_query_method: namekey
76             name: ping-response-tx-count
77             ui_data:
78               group_tag: Group1
79               units: packets
80               widget_type: counter
81             url_path: api/v1/pong/stats
82         nfv_compute:
83           properties:
84             cpu_allocation:
85               cpu_affinity: dedicated
86               thread_allocation: prefer
87             disk_size: 4 GB
88             mem_page_size: normal
89             mem_size: 1024 MB
90             num_cpus: 4
91         numa_extension:
92           properties:
93             mem_policy: STRICT
94             node:
95             - id: 0
96               mem_size: 512 MB
97               vcpus:
98               - 0
99               - 1
100             - id: 1
101               mem_size: 512 MB
102               vcpus:
103               - 2
104               - 3
105             node_cnt: 2
106         vswitch_epa:
107           properties:
108             ovs_acceleration: DISABLED
109             ovs_offload: DISABLED
110       artifacts:
111         pong_vnfd_iovdu_0_vm_image:
112           file: ../images/Fedora-x86_64-20-20131211.1-sda-pong.qcow2
113           image_checksum: 977484d95575f80ef8399c9cf1d45ebd
114           type: tosca.artifacts.Deployment.Image.riftio.QCOW2
115       interfaces:
116         Standard:
117           create: pong_vnfd_iovdu_0_vm_image
118     pong_vnfd_cp0:
119       type: tosca.nodes.nfv.riftio.CP1
120       properties:
121         cp_type: VPORT
122         name: pong_vnfd/cp0
123         vdu_intf_name: eth0
124         vdu_intf_type: VIRTIO
125       requirements:
126       - virtualBinding:
127           node: pong_vnfd_iovdu_0