6b2641da9a359c1c997838feb98e3f20b409e6f8
[osm/devops.git] / pong_vnfd.yaml
1 #
2 #   Copyright 2016 RIFT.io Inc
3 #
4 #   Licensed under the Apache License, Version 2.0 (the "License");
5 #   you may not use this file except in compliance with the License.
6 #   You may obtain a copy of the License at
7 #
8 #       http://www.apache.org/licenses/LICENSE-2.0
9 #
10 #   Unless required by applicable law or agreed to in writing, software
11 #   distributed under the License is distributed on an "AS IS" BASIS,
12 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 #   See the License for the specific language governing permissions and
14 #   limitations under the License.
15 #
16 #
17
18 vnfd:vnfd-catalog:
19     vnfd:vnfd:
20     -   vnfd:connection-point:
21         -   vnfd:name: pong_vnfd/cp0
22             vnfd:type: VPORT
23         -   vnfd:name: pong_vnfd/cp1
24             vnfd:type: VPORT
25         vnfd:description: This is an example RIFT.ware VNF
26         vnfd:http-endpoint:
27         -   vnfd:path: api/v1/pong/stats
28             vnfd:polling_interval_secs: '2'
29             vnfd:port: '18889'
30         vnfd:id: 875b30d0-8b99-11e6-9664-02b76030c497
31         vnfd:logo: rift_logo.png
32         vnfd:mgmt-interface:
33             vnfd:dashboard-params:
34                 vnfd:path: api/v1/pong/stats
35                 vnfd:port: '18889'
36             vnfd:port: '18889'
37             vnfd:vdu-id: iovdu_0
38         vnfd:monitoring-param:
39         -   vnfd:description: no of ping requests
40             vnfd:group-tag: Group1
41             vnfd:http-endpoint-ref: api/v1/pong/stats
42             vnfd:id: '1'
43             vnfd:json-query-method: NAMEKEY
44             vnfd:name: ping-request-rx-count
45             vnfd:units: packets
46             vnfd:value-type: INT
47             vnfd:widget-type: COUNTER
48         -   vnfd:description: no of ping responses
49             vnfd:group-tag: Group1
50             vnfd:http-endpoint-ref: api/v1/pong/stats
51             vnfd:id: '2'
52             vnfd:json-query-method: NAMEKEY
53             vnfd:name: ping-response-tx-count
54             vnfd:units: packets
55             vnfd:value-type: INT
56             vnfd:widget-type: COUNTER
57         vnfd:name: pong_vnfd
58         vnfd:placement-groups:
59         -   vnfd:member-vdus:
60             -   vnfd:member-vdu-ref: iovdu_0
61             vnfd:name: Weywot
62             vnfd:requirement: Place this VM on the Kuiper belt object Weywot
63             vnfd:strategy: COLOCATION
64         vnfd:short-name: pong_vnfd
65         vnfd:vdu:
66         -   vnfd:count: '1'
67             vnfd:external-interface:
68             -   vnfd:name: eth0
69                 vnfd:virtual-interface:
70                     vnfd:type: OM-MGMT
71                 vnfd:vnfd-connection-point-ref: pong_vnfd/cp0
72             -   vnfd:name: eth1
73                 vnfd:virtual-interface:
74                     vnfd:type: VIRTIO
75                 vnfd:vnfd-connection-point-ref: pong_vnfd/cp1
76             vnfd:id: iovdu_0
77             vnfd:image: Fedora-x86_64-20-20131211.1-sda-pong.qcow2
78             vnfd:image-checksum: 977484d95575f80ef8399c9cf1d45ebd
79             vnfd:name: iovdu_0
80             vnfd:vm-flavor:
81                 vnfd:memory-mb: '512'
82                 vnfd:storage-gb: '4'
83                 vnfd:vcpu-count: '1'
84         vnfd:vendor: RIFT.io
85         vnfd:version: '1.0'
86         vnfd:vnf-configuration:
87             vnfd:config-attributes:
88                 vnfd:config-delay: '60'
89                 vnfd:config-priority: '1'
90             vnfd:config-template: "\n#!/bin/bash\n\n# Rest API configuration\npong_mgmt_ip='<rw_mgmt_ip>'\n\
91                 pong_mgmt_port=18889\n# username=<rw_username>\n# password=<rw_password>\n\
92                 \n# VNF specific configuration\npong_server_ip='<rw_connection_point_name\
93                 \ pong_vnfd/cp0>'\nserver_port=5555\n\n# Make Rest API calls to configure\
94                 \ VNF\ncurl -D /dev/stdout \\\n    -H \"Accept: application/vnd.yang.data+xml\"\
95                 \ \\\n    -H \"Content-Type: application/vnd.yang.data+json\" \\\n\
96                 \    -X POST \\\n    -d \"{\\\"ip\\\":\\\"$pong_server_ip\\\", \\\"\
97                 port\\\":$server_port}\" \\\n    http://${pong_mgmt_ip}:${pong_mgmt_port}/api/v1/pong/server\n\
98                 rc=$?\nif [ $rc -ne 0 ]\nthen\n    echo \"Failed to set server(own)\
99                 \ info for pong!\"\n    exit $rc\nfi\n\n\ncurl -D /dev/stdout \\\n\
100                 \    -H \"Accept: application/vnd.yang.data+xml\" \\\n    -H \"Content-Type:\
101                 \ application/vnd.yang.data+json\" \\\n    -X POST \\\n    -d \"{\\\
102                 \"enable\\\":true}\" \\\n    http://${pong_mgmt_ip}:${pong_mgmt_port}/api/v1/pong/adminstatus/state\n\
103                 rc=$?\nif [ $rc -ne 0 ]\nthen\n    echo \"Failed to enable pong service!\"\
104                 \n    exit $rc\nfi\n\nexit 0\n"
105             vnfd:script:
106                 vnfd:script-type: bash