Bug 143 Update ping pong to use charm
[osm/devops.git] / src / vnfd / ping_vnf / ping_vnfd.yaml
index 28796b4..44f09ab 100644 (file)
 #
 
 vnfd:vnfd-catalog:
-    vnfd:   
-    -   connection-point:
+    vnfd:vnfd:
+     -  id: rift_ping_vnf
+        name: ping_vnf
+        short-name: ping_vnf
+        logo: rift_logo.png
+        vendor: RIFT.io
+        version: '1.0'
+        description: This is an example RIFT.ware VNF
+        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'
+        -   cloud-init-file: ping_cloud_init.cfg
+            count: '1'
             external-interface:
             -   name: eth0
                 virtual-interface:
-                    type: OM-MGMT
+                    type: VIRTIO
                 vnfd-connection-point-ref: ping_vnfd/cp0
             -   name: eth1
                 virtual-interface:
@@ -81,30 +65,56 @@ vnfd:vnfd-catalog:
                 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
+                config-delay: 10
+            service-primitive:
+            -   name: start
+            -   name: stop
+            -   name: restart
+            -   name: config
+                parameter:
+                -   data-type: STRING
+                    default-value: <rw_mgmt_ip>
+                    name: ssh-hostname
+                -   data-type: STRING
+                    default-value: fedora
+                    name: ssh-username
+                -   data-type: STRING
+                    default-value: fedora
+                    name: ssh-password
+                -   data-type: STRING
+                    name: ssh-private-key
+                -   data-type: STRING
+                    default-value: ping
+                    name: mode
+                    read-only: 'true'
+            -   name: set-server
+                parameter:
+                -   data-type: STRING
+                    name: server-ip
+                -   data-type: INTEGER
+                    name: server-port
+            -   name: set-rate
+                parameter:
+                -   data-type: INTEGER
+                    default-value: '5'
+                    name: rate
+            -   name: start-traffic
+            -   name: stop-traffic
+            initial-config-primitive:
+            -   name: config
+                parameter:
+                -   name: ssh-hostname
+                    value: <rw_mgmt_ip>
+                -   name: ssh-username
+                    value: fedora
+                -   name: ssh-password
+                    value: fedora
+                -   name: mode
+                    value: ping
+                seq: '1'
+            -   name: start
+                seq: '2'
+            juju:
+                charm: pingpong