Skip to content
Snippets Groups Projects
Commit 54b892b8 authored by Philip Joseph's avatar Philip Joseph
Browse files

Update ping pong to use charm


Signed-off-by: default avatarPhilip Joseph <philip.joseph@riftio.com>
parent a0920be3
No related branches found
No related tags found
No related merge requests found
......@@ -81,5 +81,13 @@ $(VNFD_BUILD_DIR)/VyOS_vnf/charms/vyos-proxy: $(VNFD_BUILD_DIR)/VyOS_vnf $(BUILD
# Copy the PE Charm into the PE vnf package directory before packaging
cp -rf $(BUILD_DIR)/juju-charms/builds/vyos-proxy $(VNFD_BUILD_DIR)/VyOS_vnf/charms
$(BUILD_DIR)/vnfd_pkgs/%.tar.gz: $(VNFD_BUILD_DIR)/% $(VNFD_BUILD_DIR)/ims_allin1_2p_vnf/charms/clearwater-aio-proxy $(VNFD_BUILD_DIR)/6wind_vnf/charms/vpe-router $(VNFD_BUILD_DIR)/VyOS_vnf/charms/vyos-proxy
$(VNFD_BUILD_DIR)/ping_vnf/charms/pingpong: $(VNFD_BUILD_DIR)/ping_vnf $(BUILD_DIR)/juju-charms
# Copy the pingpong Charm into the ping vnf package directory before packaging
cp -rf $(BUILD_DIR)/juju-charms/builds/pingpong $(VNFD_BUILD_DIR)/ping_vnf/charms
$(VNFD_BUILD_DIR)/pong_vnf/charms/pingpong: $(VNFD_BUILD_DIR)/pong_vnf $(BUILD_DIR)/juju-charms
# Copy the pingpong Charm into the pong vnf package directory before packaging
cp -rf $(BUILD_DIR)/juju-charms/builds/pingpong $(VNFD_BUILD_DIR)/pong_vnf/charms
$(BUILD_DIR)/vnfd_pkgs/%.tar.gz: $(VNFD_BUILD_DIR)/% $(VNFD_BUILD_DIR)/ims_allin1_2p_vnf/charms/clearwater-aio-proxy $(VNFD_BUILD_DIR)/6wind_vnf/charms/vpe-router $(VNFD_BUILD_DIR)/VyOS_vnf/charms/vyos-proxy $(VNFD_BUILD_DIR)/ping_vnf/charms/pingpong $(VNFD_BUILD_DIR)/pong_vnf/charms/pingpong
src/generate_descriptor_pkg.sh -d $(BUILD_DIR)/vnfd_pkgs $<
......@@ -17,13 +17,37 @@
nsd:nsd-catalog:
nsd:nsd:
- nsd:constituent-vnfd:
- nsd:id: rift_ping_pong_ns
nsd:logo: rift_logo.png
nsd:name: ping_pong_ns
nsd:description: RIFT.io sample ping pong network service
nsd:config-parameter-map:
- nsd:config-parameter-request:
nsd:config-parameter-request-ref: pong_ip
nsd:member-vnf-index-ref: '1'
nsd:config-parameter-source:
nsd:config-parameter-source-ref: service_ip
nsd:member-vnf-index-ref: '2'
nsd:id: '1'
- nsd:config-parameter-request:
nsd:config-parameter-request-ref: pong_port
nsd:member-vnf-index-ref: '1'
nsd:config-parameter-source:
nsd:config-parameter-source-ref: service_port
nsd:member-vnf-index-ref: '2'
nsd:id: '2'
nsd:constituent-vnfd:
- nsd:member-vnf-index: '1'
nsd:vnfd-id-ref: 8759e766-8b99-11e6-9664-02b76030c497
nsd:vnfd-id-ref: rift_ping_vnf
- 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:vnfd-id-ref: rift_pong_vnf
nsd:initial-config-primitive:
- nsd:name: start traffic
nsd:parameter:
- nsd:name: userid
nsd:value: rift
nsd:seq: '1'
nsd:user-defined-script: start_traffic.py
nsd:input-parameter-xpath:
- nsd:xpath: /nsd:nsd-catalog/nsd:nsd/nsd:vendor
nsd:ip-profiles:
......@@ -32,23 +56,24 @@ nsd:nsd-catalog:
nsd:gateway-address: 31.31.31.210
nsd:ip-version: ipv4
nsd:subnet-address: 31.31.31.0/24
nsd:dhcp-params:
nsd:count: 200
nsd:start-address: 31.31.31.2
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:vnfd-id-ref: rift_ping_vnf
- nsd:member-vnf-index-ref: '2'
nsd:vnfd-id-ref: 875b30d0-8b99-11e6-9664-02b76030c497
nsd:vnfd-id-ref: rift_pong_vnf
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:vnfd-id-ref: rift_ping_vnf
- nsd:member-vnf-index-ref: '2'
nsd:vnfd-id-ref: 875b30d0-8b99-11e6-9664-02b76030c497
nsd:vnfd-id-ref: rift_pong_vnf
nsd:name: Quaoar
nsd:requirement: Place this VM on the Kuiper belt object Quaoar
nsd:strategy: COLOCATION
......@@ -56,31 +81,34 @@ nsd:nsd-catalog:
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:id: mgmt_vl
nsd:vim-network-name: mgmt
nsd:description: Management VL
nsd:name: mgmt_vl
nsd:short-name: mgmt_vl
nsd:type: ELAN
nsd:vendor: RIFT.io
nsd:version: '1.0'
nsd:mgmt-network: 'true'
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:vnfd-id-ref: rift_ping_vnf
- 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:vnfd-id-ref: rift_pong_vnf
- nsd:id: ping_pong_vl1
nsd:description: Data VL
nsd:ip-profile-ref: InterVNFLink
nsd:name: data_vl
nsd:short-name: data_vl
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:vnfd-id-ref: rift_ping_vnf
- nsd:member-vnf-index-ref: '2'
nsd:vnfd-connection-point-ref: pong_vnfd/cp1
nsd:vnfd-id-ref: 875b30d0-8b99-11e6-9664-02b76030c497
nsd:vnfd-id-ref: rift_pong_vnf
#!/usr/bin/env python3
############################################################################
# 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. #
############################################################################
import argparse
import logging
import os
import subprocess
import sys
import time
import yaml
def start_traffic(yaml_cfg, logger):
'''Use curl and set admin status to enable on pong and ping vnfs'''
def enable_service(mgmt_ip, port, vnf_type):
curl_cmd = 'curl -D /dev/stdout -H "Accept: application/vnd.yang.data' \
'+xml" -H "Content-Type: application/vnd.yang.data+json" ' \
'-X POST -d "{{\\"enable\\":true}}" http://{mgmt_ip}:' \
'{mgmt_port}/api/v1/{vnf_type}/adminstatus/state'. \
format(
mgmt_ip=mgmt_ip,
mgmt_port=port,
vnf_type=vnf_type)
logger.debug("Executing cmd: %s", curl_cmd)
proc = subprocess.run(curl_cmd, shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
logger.debug("Process: {}".format(proc))
return proc.returncode
# Enable pong service first
for index, vnfr in yaml_cfg['vnfr'].items():
logger.debug("VNFR {}: {}".format(index, vnfr))
# Check if it is pong vnf
if 'pong_vnf' in vnfr['name']:
vnf_type = 'pong'
port = 18889
rc = enable_service(vnfr['mgmt_ip_address'], port, vnf_type)
if rc != 0:
logger.error("Enable service for pong failed: {}".
format(rc))
return rc
break
# Add a delay to provide pong port to come up
time.sleep(1)
# Enable ping service next
for index, vnfr in yaml_cfg['vnfr'].items():
logger.debug("VNFR {}: {}".format(index, vnfr))
# Check if it is pong vnf
if 'ping_vnf' in vnfr['name']:
vnf_type = 'ping'
port = 18888
rc = enable_service(vnfr['mgmt_ip_address'], port, vnf_type)
break
return rc
def main(argv=sys.argv[1:]):
try:
parser = argparse.ArgumentParser()
parser.add_argument("yaml_cfg_file", type=argparse.FileType('r'))
parser.add_argument("-q", "--quiet", dest="verbose", action="store_false")
args = parser.parse_args()
run_dir = os.path.join(os.environ['RIFT_INSTALL'], "var/run/rift")
if not os.path.exists(run_dir):
os.makedirs(run_dir)
log_file = "{}/ping_pong_start_traffic-{}.log".format(run_dir, time.strftime("%Y%m%d%H%M%S"))
# logging.basicConfig(filename=log_file, level=logging.DEBUG)
logger = logging.getLogger('ping-pong-start-traffic')
logger.setLevel(logging.DEBUG)
fh = logging.FileHandler(log_file)
fh.setLevel(logging.DEBUG)
ch = logging.StreamHandler()
if args.verbose:
ch.setLevel(logging.DEBUG)
else:
ch.setLevel(logging.INFO)
# create formatter and add it to the handlers
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
fh.setFormatter(formatter)
ch.setFormatter(formatter)
logger.addHandler(fh)
logger.addHandler(ch)
except Exception as e:
logger.exception("Exception in {}: {}".format(__file__, e))
sys.exit(1)
try:
logger.debug("Input file: {}".format(args.yaml_cfg_file.name))
yaml_str = args.yaml_cfg_file.read()
yaml_cfg = yaml.load(yaml_str)
logger.debug("Input YAML: {}".format(yaml_cfg))
rc = start_traffic(yaml_cfg, logger)
logger.info("Return code: {}".format(rc))
sys.exit(rc)
except Exception as e:
logger.exception("Exception in {}: {}".format(__file__, e))
sys.exit(1)
if __name__ == "__main__":
main()
......@@ -16,95 +16,149 @@
#
vnfd:vnfd-catalog:
vnfd:
- connection-point:
- name: ping_vnfd/cp0
type: VPORT
- name: ping_vnfd/cp1
type: VPORT
description: This is an example RIFT.ware VNF
http-endpoint:
- path: api/v1/ping/stats
polling_interval_secs: '2'
port: '18888'
id: 8759e766-8b99-11e6-9664-02b76030c497
logo: rift_logo.png
mgmt-interface:
dashboard-params:
path: api/v1/ping/stats
port: '18888'
port: '18888'
vdu-id: iovdu_0
monitoring-param:
- description: no of ping requests
group-tag: Group1
http-endpoint-ref: api/v1/ping/stats
id: '1'
json-query-method: NAMEKEY
name: ping-request-tx-count
units: packets
value-type: INT
widget-type: COUNTER
- description: no of ping responses
group-tag: Group1
http-endpoint-ref: api/v1/ping/stats
id: '2'
json-query-method: NAMEKEY
name: ping-response-rx-count
units: packets
value-type: INT
widget-type: COUNTER
name: ping_vnfd
placement-groups:
- member-vdus:
- member-vdu-ref: iovdu_0
name: Eris
requirement: Place this VM on the Kuiper belt object Eris
strategy: COLOCATION
short-name: ping_vnfd
vdu:
- count: '1'
external-interface:
- name: eth0
virtual-interface:
type: OM-MGMT
vnfd-connection-point-ref: ping_vnfd/cp0
- name: eth1
virtual-interface:
type: VIRTIO
vnfd-connection-point-ref: ping_vnfd/cp1
id: iovdu_0
image: Fedora-x86_64-20-20131211.1-sda-ping.qcow2
image-checksum: a6ffaa77f949a9e4ebb082c6147187cf
name: iovdu_0
vm-flavor:
memory-mb: '512'
storage-gb: '4'
vcpu-count: '1'
vendor: RIFT.io
version: '1.0'
vnf-configuration:
config-attributes:
config-delay: '0'
config-priority: '2'
config-template: "\n#!/bin/bash\n\n# Rest API config\nping_mgmt_ip='<rw_mgmt_ip>'\n\
ping_mgmt_port=18888\n\n# VNF specific configuration\npong_server_ip='<rw_connection_point_name\
\ pong_vnfd/cp0>'\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"
script:
script-type: bash
vnfd:vnfd:
- vnfd:id: rift_ping_vnf
vnfd:name: ping_vnf
vnfd:short-name: ping_vnf
vnfd:logo: rift_logo.png
vnfd:vendor: RIFT.io
vnfd:version: '1.0'
vnfd:description: This is an example RIFT.ware VNF
vnfd:config-parameter:
vnfd:config-parameter-request:
- vnfd:description: IP on which Pong service is listening
vnfd:name: pong_ip
vnfd:parameter:
- vnfd:config-primitive-name-ref: set-server
vnfd:config-primitive-parameter-ref: server-ip
- vnfd:description: Port on which Pong service is listening
vnfd:name: pong_port
vnfd:parameter:
- vnfd:config-primitive-name-ref: set-server
vnfd:config-primitive-parameter-ref: server-port
vnfd:config-parameter-source:
- vnfd:attribute: ../../../mgmt-interface, ip-address
vnfd:description: Management IP address
vnfd:name: mgmt_ip
vnfd:parameter:
- vnfd:config-primitive-name-ref: config
vnfd:config-primitive-parameter-ref: ssh-hostname
- vnfd:description: SSH username
vnfd:name: username
vnfd:parameter:
- vnfd:config-primitive-name-ref: config
vnfd:config-primitive-parameter-ref: ssh-username
vnfd:value: fedora
- vnfd:attribute: ../../../mgmt-interface/ssh-key, private-key-file
vnfd:description: SSH private key file
vnfd:name: ssh_key
vnfd:parameter:
- vnfd:config-primitive-name-ref: config
vnfd:config-primitive-parameter-ref: ssh-private-key
- vnfd:description: Rate of packet generation
vnfd:name: rate
vnfd:parameter:
- vnfd:config-primitive-name-ref: set-rate
vnfd:config-primitive-parameter-ref: rate
vnfd:value: '5'
vnfd:connection-point:
- vnfd:name: ping_vnfd/cp0
vnfd:type: VPORT
- vnfd:name: ping_vnfd/cp1
vnfd:type: VPORT
vnfd:http-endpoint:
- vnfd:path: api/v1/ping/stats
vnfd:polling_interval_secs: '2'
vnfd:port: '18888'
vnfd:mgmt-interface:
vnfd:dashboard-params:
vnfd:path: api/v1/ping/stats
vnfd:port: '18888'
vnfd:port: '18888'
vnfd:ssh-key: 'true'
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: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:vdu:
- vnfd:count: '1'
vnfd:external-interface:
- vnfd:name: eth0
vnfd:virtual-interface:
vnfd:type: VIRTIO
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:vnf-configuration:
vnfd:config-primitive:
- vnfd:name: start
- vnfd:name: stop
- vnfd:name: restart
- vnfd:name: config
vnfd:parameter:
- vnfd:data-type: STRING
vnfd:name: ssh-hostname
- vnfd:data-type: STRING
vnfd:name: ssh-username
- vnfd:data-type: STRING
vnfd:name: ssh-private-key
- vnfd:data-type: STRING
vnfd:default-value: ping
vnfd:name: mode
vnfd:read-only: 'true'
- vnfd:name: set-server
vnfd:parameter:
- vnfd:data-type: STRING
vnfd:name: server-ip
- vnfd:data-type: INTEGER
vnfd:name: server-port
- vnfd:name: set-rate
vnfd:parameter:
- vnfd:data-type: INTEGER
vnfd:default-value: '5'
vnfd:name: rate
- vnfd:name: start-traffic
- vnfd:name: stop-traffic
vnfd:initial-config-primitive:
- vnfd:config-primitive-ref: config
vnfd:seq: '1'
- vnfd:config-primitive-ref: start
vnfd:seq: '2'
- vnfd:config-primitive-ref: set-server
vnfd:seq: '3'
- vnfd:config-primitive-ref: set-rate
vnfd:seq: '4'
vnfd:juju:
vnfd:charm: pingpong
......@@ -16,91 +16,137 @@
#
vnfd:vnfd-catalog:
vnfd:
- connection-point:
- name: pong_vnfd/cp0
type: VPORT
- name: pong_vnfd/cp1
type: VPORT
description: This is an example RIFT.ware VNF
http-endpoint:
- path: api/v1/pong/stats
polling_interval_secs: '2'
port: '18889'
id: 875b30d0-8b99-11e6-9664-02b76030c497
logo: rift_logo.png
mgmt-interface:
dashboard-params:
path: api/v1/pong/stats
port: '18889'
port: '18889'
vdu-id: iovdu_0
monitoring-param:
- description: no of ping requests
group-tag: Group1
http-endpoint-ref: api/v1/pong/stats
id: '1'
json-query-method: NAMEKEY
name: ping-request-rx-count
units: packets
value-type: INT
widget-type: COUNTER
- description: no of ping responses
group-tag: Group1
http-endpoint-ref: api/v1/pong/stats
id: '2'
json-query-method: NAMEKEY
name: ping-response-tx-count
units: packets
value-type: INT
widget-type: COUNTER
name: pong_vnfd
placement-groups:
- member-vdus:
- member-vdu-ref: iovdu_0
name: Weywot
requirement: Place this VM on the Kuiper belt object Weywot
strategy: COLOCATION
short-name: pong_vnfd
vdu:
- count: '1'
external-interface:
- name: eth0
virtual-interface:
type: OM-MGMT
vnfd-connection-point-ref: pong_vnfd/cp0
- name: eth1
virtual-interface:
type: VIRTIO
vnfd-connection-point-ref: pong_vnfd/cp1
id: iovdu_0
image: Fedora-x86_64-20-20131211.1-sda-pong.qcow2
image-checksum: 977484d95575f80ef8399c9cf1d45ebd
name: iovdu_0
vm-flavor:
memory-mb: '512'
storage-gb: '4'
vcpu-count: '1'
vendor: RIFT.io
version: '1.0'
vnf-configuration:
config-attributes:
config-delay: '60'
config-priority: '1'
config-template: "\n#!/bin/bash\n\n# Rest API configuration\npong_mgmt_ip='<rw_mgmt_ip>'\n\
pong_mgmt_port=18889\n# username=<rw_username>\n# password=<rw_password>\n\
\n# VNF specific configuration\npong_server_ip='<rw_connection_point_name\
\ pong_vnfd/cp0>'\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"
script:
script-type: bash
vnfd:vnfd:
- vnfd:id: rift_pong_vnf
vnfd:name: pong_vnf
vnfd:short-name: pong_vnf
vnfd:logo: rift_logo.png
vnfd:vendor: RIFT.io
vnfd:version: '1.0'
vnfd:description: This is an example RIFT.ware VNF
vnfd:config-parameter:
vnfd:config-parameter-source:
- vnfd:attribute: ../../../mgmt-interface, ip-address
vnfd:description: Management IP address
vnfd:name: mgmt_ip
vnfd:parameter:
- vnfd:config-primitive-name-ref: config
vnfd:config-primitive-parameter-ref: ssh-hostname
- vnfd:description: SSH username
vnfd:name: username
vnfd:parameter:
- vnfd:config-primitive-name-ref: config
vnfd:config-primitive-parameter-ref: ssh-username
vnfd:value: fedora
- vnfd:attribute: ../../../mgmt-interface/ssh-key, private-key-file
vnfd:description: SSH private key file
vnfd:name: ssh_key
vnfd:parameter:
- vnfd:config-primitive-name-ref: config
vnfd:config-primitive-parameter-ref: ssh-private-key
- vnfd:attribute: ../../../connection-point[name='pong_vnfd/cp1'], ip-address
vnfd:description: IP on which Pong service is listening
vnfd:name: service_ip
vnfd:parameter:
- vnfd:config-primitive-name-ref: set-server
vnfd:config-primitive-parameter-ref: server-ip
- vnfd:description: Port on which server listens for incoming data packets
vnfd:name: service_port
vnfd:parameter:
- vnfd:config-primitive-name-ref: set-server
vnfd:config-primitive-parameter-ref: server-port
vnfd:value: '5555'
vnfd:connection-point:
- vnfd:name: pong_vnfd/cp0
vnfd:type: VPORT
- vnfd:name: pong_vnfd/cp1
vnfd:type: VPORT
vnfd:http-endpoint:
- vnfd:path: api/v1/pong/stats
vnfd:polling_interval_secs: '2'
vnfd:port: '18889'
vnfd:mgmt-interface:
vnfd:dashboard-params:
vnfd:path: api/v1/pong/stats
vnfd:port: '18889'
vnfd:port: '18889'
vnfd:ssh-key: 'true'
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: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:vdu:
- vnfd:count: '1'
vnfd:external-interface:
- vnfd:name: eth0
vnfd:virtual-interface:
vnfd:type: VIRTIO
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:vnf-configuration:
vnfd:config-primitive:
- vnfd:name: start
- vnfd:name: stop
- vnfd:name: restart
- vnfd:name: config
vnfd:parameter:
- vnfd:data-type: STRING
vnfd:name: ssh-hostname
- vnfd:data-type: STRING
vnfd:name: ssh-username
- vnfd:data-type: STRING
vnfd:name: ssh-private-key
- vnfd:data-type: STRING
vnfd:default-value: pong
vnfd:name: mode
vnfd:read-only: 'true'
- vnfd:name: set-server
vnfd:parameter:
- vnfd:data-type: STRING
vnfd:name: server-ip
- vnfd:data-type: INTEGER
vnfd:name: server-port
- vnfd:name: start-traffic
- vnfd:name: stop-traffic
vnfd:initial-config-primitive:
- vnfd:config-primitive-ref: config
vnfd:seq: '1'
- vnfd:config-primitive-ref: start
vnfd:seq: '2'
- vnfd:config-primitive-ref: set-server
vnfd:seq: '3'
vnfd:juju:
vnfd:charm: pingpong
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment