From: Suresh Balakrishnan Date: Thu, 6 Oct 2016 09:37:50 +0000 (-0400) Subject: Bug 84 - Create ping pong descriptor package X-Git-Tag: v2.0.2~6^2~28^2 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=bb492464a9a48c63426c023148598bc82923acb9;p=osm%2Fdevops.git Bug 84 - Create ping pong descriptor package Change-Id: Ie4861ac1bfad521fc8b75e2949ed5f77120e4932 Signed-off-by: Suresh Balakrishnan --- diff --git a/Makefile b/Makefile index 78acdffc..a7560942 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ # BUILD_DIR = build -NSDS := gw_corpa_ns ims_allin1_corpa mwc16_gen_ns mwc16_pe_ns VyOS_ns cirros_ns cirros_2vnf_ns ubuntu_xenial_ns +NSDS := gw_corpa_ns ims_allin1_corpa mwc16_gen_ns mwc16_pe_ns VyOS_ns cirros_ns cirros_2vnf_ns ubuntu_xenial_ns ping_pong_ns NSD_SRC_DIR := src/nsd NSD_BUILD_DIR := $(BUILD_DIR)/nsd @@ -27,7 +27,7 @@ NSD_BUILD_DIRS := $(addprefix $(NSD_BUILD_DIR)/, $(NSDS)) NSD_PKGS := $(addsuffix .tar.gz, $(NSDS)) NSD_BUILD_PKGS := $(addprefix $(NSD_BUILD_DIR)_pkgs/, $(NSD_PKGS)) -VNFDS := 6wind_vnf gw_corpa_pe1_vnf gw_corpa_pe2_vnf ims_allin1_2p_vnf tidgen_mwc16_vnf VyOS_vnf cirros_vnf ubuntu_xenial_vnf +VNFDS := 6wind_vnf gw_corpa_pe1_vnf gw_corpa_pe2_vnf ims_allin1_2p_vnf tidgen_mwc16_vnf VyOS_vnf cirros_vnf ubuntu_xenial_vnf ping_vnf pong_vnf VNFD_SRC_DIR := src/vnfd VNFD_BUILD_DIR := $(BUILD_DIR)/vnfd diff --git a/src/nsd/ping_pong_ns/icons/rift_logo.png b/src/nsd/ping_pong_ns/icons/rift_logo.png new file mode 100644 index 00000000..09b47c7b Binary files /dev/null and b/src/nsd/ping_pong_ns/icons/rift_logo.png differ diff --git a/src/nsd/ping_pong_ns/ping_pong_nsd.yaml b/src/nsd/ping_pong_ns/ping_pong_nsd.yaml new file mode 100644 index 00000000..26908e2b --- /dev/null +++ b/src/nsd/ping_pong_ns/ping_pong_nsd.yaml @@ -0,0 +1,86 @@ +# +# Copyright 2016 RIFT.io Inc +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# + +nsd:nsd-catalog: + nsd:nsd: + - nsd:constituent-vnfd: + - nsd:member-vnf-index: '1' + nsd:vnfd-id-ref: 8759e766-8b99-11e6-9664-02b76030c497 + - nsd:member-vnf-index: '2' + nsd:vnfd-id-ref: 875b30d0-8b99-11e6-9664-02b76030c497 + nsd:description: Toy NS + nsd:id: 875b9750-8b99-11e6-9664-02b76030c497 + nsd:input-parameter-xpath: + - nsd:xpath: /nsd:nsd-catalog/nsd:nsd/nsd:vendor + nsd:ip-profiles: + - nsd:description: Inter VNF Link + nsd:ip-profile-params: + nsd:gateway-address: 31.31.31.210 + nsd:ip-version: ipv4 + nsd:subnet-address: 31.31.31.0/24 + nsd:name: InterVNFLink + nsd:logo: rift_logo.png + nsd:name: ping_pong_nsd + nsd:placement-groups: + - nsd:member-vnfd: + - nsd:member-vnf-index-ref: '1' + nsd:vnfd-id-ref: 8759e766-8b99-11e6-9664-02b76030c497 + - nsd:member-vnf-index-ref: '2' + nsd:vnfd-id-ref: 875b30d0-8b99-11e6-9664-02b76030c497 + nsd:name: Orcus + nsd:requirement: Place this VM on the Kuiper belt object Orcus + nsd:strategy: COLOCATION + - nsd:member-vnfd: + - nsd:member-vnf-index-ref: '1' + nsd:vnfd-id-ref: 8759e766-8b99-11e6-9664-02b76030c497 + - nsd:member-vnf-index-ref: '2' + nsd:vnfd-id-ref: 875b30d0-8b99-11e6-9664-02b76030c497 + nsd:name: Quaoar + nsd:requirement: Place this VM on the Kuiper belt object Quaoar + nsd:strategy: COLOCATION + nsd:short-name: ping_pong_nsd + nsd:vendor: RIFT.io + nsd:version: '1.0' + nsd:vld: + - nsd:description: Toy VL + nsd:id: ping_pong_mgmt1 + nsd:name: ping_pong_mgmt + nsd:short-name: ping_pong_mgmt + nsd:type: ELAN + nsd:vendor: RIFT.io + nsd:version: '1.0' + nsd:vnfd-connection-point-ref: + - nsd:member-vnf-index-ref: '1' + nsd:vnfd-connection-point-ref: ping_vnfd/cp0 + nsd:vnfd-id-ref: 8759e766-8b99-11e6-9664-02b76030c497 + - nsd:member-vnf-index-ref: '2' + nsd:vnfd-connection-point-ref: pong_vnfd/cp0 + nsd:vnfd-id-ref: 875b30d0-8b99-11e6-9664-02b76030c497 + - nsd:description: Toy VL + nsd:id: ping_pong_vld2 + nsd:name: ping_pong_vld + nsd:short-name: ping_pong_vld + nsd:type: ELAN + nsd:vendor: RIFT.io + nsd:version: '1.0' + nsd:vnfd-connection-point-ref: + - nsd:member-vnf-index-ref: '1' + nsd:vnfd-connection-point-ref: ping_vnfd/cp1 + nsd:vnfd-id-ref: 8759e766-8b99-11e6-9664-02b76030c497 + - nsd:member-vnf-index-ref: '2' + nsd:vnfd-connection-point-ref: pong_vnfd/cp1 + nsd:vnfd-id-ref: 875b30d0-8b99-11e6-9664-02b76030c497 diff --git a/src/vnfd/ping_vnf/icons/rift_logo.png b/src/vnfd/ping_vnf/icons/rift_logo.png new file mode 100644 index 00000000..09b47c7b Binary files /dev/null and b/src/vnfd/ping_vnf/icons/rift_logo.png differ diff --git a/src/vnfd/ping_vnf/ping_vnfd.yaml b/src/vnfd/ping_vnf/ping_vnfd.yaml new file mode 100644 index 00000000..dd162db3 --- /dev/null +++ b/src/vnfd/ping_vnf/ping_vnfd.yaml @@ -0,0 +1,110 @@ +# +# Copyright 2016 RIFT.io Inc +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# + +vnfd:vnfd-catalog: + vnfd:vnfd: + - vnfd:connection-point: + - vnfd:name: ping_vnfd/cp0 + vnfd:type: VPORT + - vnfd:name: ping_vnfd/cp1 + vnfd:type: VPORT + vnfd:description: This is an example RIFT.ware VNF + vnfd:http-endpoint: + - vnfd:path: api/v1/ping/stats + vnfd:polling_interval_secs: '2' + vnfd:port: '18888' + vnfd:id: 8759e766-8b99-11e6-9664-02b76030c497 + vnfd:logo: rift_logo.png + vnfd:mgmt-interface: + vnfd:dashboard-params: + vnfd:path: api/v1/ping/stats + vnfd:port: '18888' + vnfd:port: '18888' + vnfd:vdu-id: iovdu_0 + vnfd:monitoring-param: + - vnfd:description: no of ping requests + vnfd:group-tag: Group1 + vnfd:http-endpoint-ref: api/v1/ping/stats + vnfd:id: '1' + vnfd:json-query-method: NAMEKEY + vnfd:name: ping-request-tx-count + vnfd:units: packets + vnfd:value-type: INT + vnfd:widget-type: COUNTER + - vnfd:description: no of ping responses + vnfd:group-tag: Group1 + vnfd:http-endpoint-ref: api/v1/ping/stats + vnfd:id: '2' + vnfd:json-query-method: NAMEKEY + vnfd:name: ping-response-rx-count + vnfd:units: packets + vnfd:value-type: INT + vnfd:widget-type: COUNTER + vnfd:name: ping_vnfd + vnfd:placement-groups: + - vnfd:member-vdus: + - vnfd:member-vdu-ref: iovdu_0 + vnfd:name: Eris + vnfd:requirement: Place this VM on the Kuiper belt object Eris + vnfd:strategy: COLOCATION + vnfd:short-name: ping_vnfd + vnfd:vdu: + - vnfd:count: '1' + vnfd:external-interface: + - vnfd:name: eth0 + vnfd:virtual-interface: + vnfd:type: OM-MGMT + vnfd:vnfd-connection-point-ref: ping_vnfd/cp0 + - vnfd:name: eth1 + vnfd:virtual-interface: + vnfd:type: VIRTIO + vnfd:vnfd-connection-point-ref: ping_vnfd/cp1 + vnfd:id: iovdu_0 + vnfd:image: Fedora-x86_64-20-20131211.1-sda-ping.qcow2 + vnfd:image-checksum: a6ffaa77f949a9e4ebb082c6147187cf + vnfd:name: iovdu_0 + vnfd:vm-flavor: + vnfd:memory-mb: '512' + vnfd:storage-gb: '4' + vnfd:vcpu-count: '1' + vnfd:vendor: RIFT.io + vnfd:version: '1.0' + vnfd:vnf-configuration: + vnfd:config-attributes: + vnfd:config-delay: '0' + vnfd:config-priority: '2' + vnfd:config-template: "\n#!/bin/bash\n\n# Rest API config\nping_mgmt_ip=''\n\ + ping_mgmt_port=18888\n\n# VNF specific configuration\npong_server_ip=''\nping_rate=5\nserver_port=5555\n\n# Make rest API\ + \ calls to configure VNF\ncurl -D /dev/stdout \\\n -H \"Accept:\ + \ application/vnd.yang.data+xml\" \\\n -H \"Content-Type: application/vnd.yang.data+json\"\ + \ \\\n -X POST \\\n -d \"{\\\"ip\\\":\\\"$pong_server_ip\\\"\ + , \\\"port\\\":$server_port}\" \\\n http://${ping_mgmt_ip}:${ping_mgmt_port}/api/v1/ping/server\n\ + rc=$?\nif [ $rc -ne 0 ]\nthen\n echo \"Failed to set server info\ + \ for ping!\"\n exit $rc\nfi\n\ncurl -D /dev/stdout \\\n -H\ + \ \"Accept: application/vnd.yang.data+xml\" \\\n -H \"Content-Type:\ + \ application/vnd.yang.data+json\" \\\n -X POST \\\n -d \"{\\\ + \"rate\\\":$ping_rate}\" \\\n http://${ping_mgmt_ip}:${ping_mgmt_port}/api/v1/ping/rate\n\ + rc=$?\nif [ $rc -ne 0 ]\nthen\n echo \"Failed to set ping rate!\"\ + \n exit $rc\nfi\n\n\noutput=$(curl -D /dev/stdout \\\n -H \"\ + Accept: application/vnd.yang.data+xml\" \\\n -H \"Content-Type:\ + \ application/vnd.yang.data+json\" \\\n -X POST \\\n -d \"{\\\ + \"enable\\\":true}\" \\\n http://${ping_mgmt_ip}:${ping_mgmt_port}/api/v1/ping/adminstatus/state)\n\ + if [[ $output == *\"Internal Server Error\"* ]]\nthen\n echo $output\n\ + \ exit 3\nelse\n echo $output\nfi\n\nexit 0\n" + vnfd:script: + vnfd:script-type: bash diff --git a/src/vnfd/pong_vnf/icons/rift_logo.png b/src/vnfd/pong_vnf/icons/rift_logo.png new file mode 100644 index 00000000..09b47c7b Binary files /dev/null and b/src/vnfd/pong_vnf/icons/rift_logo.png differ diff --git a/src/vnfd/pong_vnf/pong_vnfd.yaml b/src/vnfd/pong_vnf/pong_vnfd.yaml new file mode 100644 index 00000000..6b2641da --- /dev/null +++ b/src/vnfd/pong_vnf/pong_vnfd.yaml @@ -0,0 +1,106 @@ +# +# Copyright 2016 RIFT.io Inc +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# + +vnfd:vnfd-catalog: + vnfd:vnfd: + - vnfd:connection-point: + - vnfd:name: pong_vnfd/cp0 + vnfd:type: VPORT + - vnfd:name: pong_vnfd/cp1 + vnfd:type: VPORT + vnfd:description: This is an example RIFT.ware VNF + vnfd:http-endpoint: + - vnfd:path: api/v1/pong/stats + vnfd:polling_interval_secs: '2' + vnfd:port: '18889' + vnfd:id: 875b30d0-8b99-11e6-9664-02b76030c497 + vnfd:logo: rift_logo.png + vnfd:mgmt-interface: + vnfd:dashboard-params: + vnfd:path: api/v1/pong/stats + vnfd:port: '18889' + vnfd:port: '18889' + vnfd:vdu-id: iovdu_0 + vnfd:monitoring-param: + - vnfd:description: no of ping requests + vnfd:group-tag: Group1 + vnfd:http-endpoint-ref: api/v1/pong/stats + vnfd:id: '1' + vnfd:json-query-method: NAMEKEY + vnfd:name: ping-request-rx-count + vnfd:units: packets + vnfd:value-type: INT + vnfd:widget-type: COUNTER + - vnfd:description: no of ping responses + vnfd:group-tag: Group1 + vnfd:http-endpoint-ref: api/v1/pong/stats + vnfd:id: '2' + vnfd:json-query-method: NAMEKEY + vnfd:name: ping-response-tx-count + vnfd:units: packets + vnfd:value-type: INT + vnfd:widget-type: COUNTER + vnfd:name: pong_vnfd + vnfd:placement-groups: + - vnfd:member-vdus: + - vnfd:member-vdu-ref: iovdu_0 + vnfd:name: Weywot + vnfd:requirement: Place this VM on the Kuiper belt object Weywot + vnfd:strategy: COLOCATION + vnfd:short-name: pong_vnfd + vnfd:vdu: + - vnfd:count: '1' + vnfd:external-interface: + - vnfd:name: eth0 + vnfd:virtual-interface: + vnfd:type: OM-MGMT + vnfd:vnfd-connection-point-ref: pong_vnfd/cp0 + - vnfd:name: eth1 + vnfd:virtual-interface: + vnfd:type: VIRTIO + vnfd:vnfd-connection-point-ref: pong_vnfd/cp1 + vnfd:id: iovdu_0 + vnfd:image: Fedora-x86_64-20-20131211.1-sda-pong.qcow2 + vnfd:image-checksum: 977484d95575f80ef8399c9cf1d45ebd + vnfd:name: iovdu_0 + vnfd:vm-flavor: + vnfd:memory-mb: '512' + vnfd:storage-gb: '4' + vnfd:vcpu-count: '1' + vnfd:vendor: RIFT.io + vnfd:version: '1.0' + vnfd:vnf-configuration: + vnfd:config-attributes: + vnfd:config-delay: '60' + vnfd:config-priority: '1' + vnfd:config-template: "\n#!/bin/bash\n\n# Rest API configuration\npong_mgmt_ip=''\n\ + pong_mgmt_port=18889\n# username=\n# password=\n\ + \n# VNF specific configuration\npong_server_ip=''\nserver_port=5555\n\n# Make Rest API calls to configure\ + \ VNF\ncurl -D /dev/stdout \\\n -H \"Accept: application/vnd.yang.data+xml\"\ + \ \\\n -H \"Content-Type: application/vnd.yang.data+json\" \\\n\ + \ -X POST \\\n -d \"{\\\"ip\\\":\\\"$pong_server_ip\\\", \\\"\ + port\\\":$server_port}\" \\\n http://${pong_mgmt_ip}:${pong_mgmt_port}/api/v1/pong/server\n\ + rc=$?\nif [ $rc -ne 0 ]\nthen\n echo \"Failed to set server(own)\ + \ info for pong!\"\n exit $rc\nfi\n\n\ncurl -D /dev/stdout \\\n\ + \ -H \"Accept: application/vnd.yang.data+xml\" \\\n -H \"Content-Type:\ + \ application/vnd.yang.data+json\" \\\n -X POST \\\n -d \"{\\\ + \"enable\\\":true}\" \\\n http://${pong_mgmt_ip}:${pong_mgmt_port}/api/v1/pong/adminstatus/state\n\ + rc=$?\nif [ $rc -ne 0 ]\nthen\n echo \"Failed to enable pong service!\"\ + \n exit $rc\nfi\n\nexit 0\n" + vnfd:script: + vnfd:script-type: bash