Feature 8047: osmclient package creation and validation tool
[osm/osmclient.git] / osmclient / templates / vnfd.yaml.j2
diff --git a/osmclient/templates/vnfd.yaml.j2 b/osmclient/templates/vnfd.yaml.j2
new file mode 100644 (file)
index 0000000..0dfc1f2
--- /dev/null
@@ -0,0 +1,334 @@
+# Copyright 2019 ETSI OSM
+#
+# All Rights Reserved.
+#
+#    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-catalog:
+    schema-version: "v3.0"
+    vnfd:
+    -   id: {{ name }}_vnfd
+        name: {{ name }}_vnfd
+        short-name: {{ name }}_vnfd
+        description: Generated by OSM package generator
+        vendor: OSM
+        version: '1.0'
+
+        {%- if detailed is sameas true %}
+        #Place the logo as png in icons directory and provide the name here
+        #logo: <update, optional>
+
+        {%- endif %}
+
+        # Management interface
+        mgmt-interface:
+            cp: vnf-cp0
+
+        # At least one VDU need to be specified
+        vdu:
+        # Additional VDUs can be created by copying the
+        # VDU descriptor below
+        -   id: {{ name }}_vnfd-VM
+            name: {{ name }}_vnfd-VM
+            description: {{ name }}_vnfd-VM
+            count: 1
+            {%- if detailed is sameas true %}
+            #pdu-type: <update, optional>
+            #mgmt-vpci: <update, optional>
+            {%- endif %}
+
+            # Flavour of the VM to be instantiated for the VDU
+            vm-flavor:
+                vcpu-count: {{ vcpu }}
+                memory-mb: {{ memory }}
+                storage-gb: {{ storage }}
+
+            # Image including the full path
+            image: "{{ image }}"
+            {%- if detailed is sameas true %}
+            #image-checksum: <update, optional>
+            {%- endif %}
+
+            interface:
+            # Specify the external interfaces
+            # There can be multiple interfaces defined
+            -   name: eth0
+                type: EXTERNAL
+                virtual-interface:
+                    type: PARAVIRT
+                    {%- if detailed is sameas true %}
+                    #vpci: <update, optional>
+                    #bandwidth: <update, optional>
+                    {%- endif %}
+                external-connection-point-ref: vnf-cp0
+                {%- if detailed is sameas true %}
+                #internal-connection-point-ref: <update, optional>
+                #mac-address <update, optional>
+                #mgmt-interface: <update, optional>
+                {%- endif %}
+
+            {%- for x in range(1, interfaces + 1 ) %}
+            -   name: eth{{ x }}
+                type: EXTERNAL
+                virtual-interface:
+                    type: PARAVIRT
+                    {%- if detailed is sameas true %}
+                    #vpci: <update, optional>
+                    #bandwidth: <update, optional>
+                    {%- endif %}
+                external-connection-point-ref: vnf-cp{{ x }}
+                {%- if detailed is sameas true %}
+                #internal-connection-point-ref: <update, optional>
+                #mac-address <update, optional>
+                #mgmt-interface: <update, optional>
+                {%- endif %}
+            {%- endfor %}
+
+            {%- if detailed is sameas true %}
+            #guest-epa:
+            #    mempage-size: <update, optional>
+            #    # Choice cpu-pinning / cpu-quota
+            #    cpu-pinning-policy: <update, optional> [DEDICATED, SHARED, ANY]
+            #    cpu-thread-pinning-policy: <update, optional> [AVOID, SEPARATED, ISOLATE, PREFER]
+            #    cpu-quota:
+            #       limit: <update, optional>
+            #       reserve: <update, optional>
+            #       shares: <update, optional>
+            #    mem-quota:
+            #       limit: <update, optional>
+            #       reserve: <update, optional>
+            #       shares: <update, optional>
+            #    disk-io-quota:
+            #       limit: <update, optional>
+            #       reserve: <update, optional>
+            #       shares: <update, optional>
+            #    vif-quota:
+            #       limit: <update, optional>
+            #       reserve: <update, optional>
+            #       shares: <update, optional>
+
+            #alarm:
+            #-   alarm-id: <update>
+            #    vnf-monitoring-param-ref: <update, optional>
+            #    operation: <update, optional>
+            #    value: <update, optional>
+            #    actions:
+            #        ok:
+            #        -   url: <update>
+            #        insufficient-data:
+            #        -   url: <update>
+            #        alarm:
+            #        -   url: <update>
+            #
+            #alternative-images:
+            #-   vim-type: <update>
+            #    image: <update, optional>
+            #    image-checksum: <update, optional>
+            #
+            #vdu-configuration:
+            #    # Configure the VNF or VDU through Juju.
+            #    juju:
+            #        charm: <update, optional>
+            #        proxy: <update, optional>
+            #        vca-relationships:
+            #            relation:
+            #            -   requires: <update>
+            #                provides: <update>
+            #    config-primitive:
+            #    -   name: <update>
+            #        parameter:
+            #        -   name: <update>
+            #            data-type: <update, optional>
+            #            mandatory: <update, optional>
+            #            default-value: <update, optional>
+            #            parameter-pool: <update, optional>
+            #            read-only: <update, optional>
+            #            hidden: <update, optional>
+            #    initial-config-primitive:
+            #    -   seq: <update>
+            #        name: <update, optional>
+            #        parameter:
+            #        -   name: <update>
+            #            data-type: <update, optional>
+            #            value: <update, optional>
+            #    terminate-config-primitive:
+            #    -   seq: <update>
+            #        name: <update, optional>
+            #        parameter:
+            #        -   name: <update>
+            #            data-type: <update, optional>
+            #            value: <update, optional>
+            #    metrics:
+            #    -   name: <update>
+            #    config-access:
+            #        ssh-access:
+            #            required: <update, optional>
+            #            default-user: <update, optional>
+            #
+            #monitoring-param:
+            #-   id: <update>
+            #    nfvi-metric: <update, optional>
+            #    interface-name-ref: <update, optional>
+            #
+            ## Choice cloud-init / cloud-init-file
+            #cloud-init: <update, optional>
+            #cloud-init-file: <update, optional>
+            #supplemental-boot-data:
+            #    boot-data-drive: <update, optional>
+            #
+            #internal-connection-point:
+            #-   id: <update>
+            #    name: <update, optional>
+            #    short-name: <update, optional>
+            #    type: <update, optional>
+            #    port-security-enabled: <update, optional>
+            #    internal-vld-ref: <update, optional>
+            #
+            #interface:
+            #-   name: <update>
+            #    position: <update, optional>
+            #    mgmt-interface: <update, optional>
+            #    type: <update, optional>
+            #    mac-address: <update, optional>
+            #    # Choice: connection-point-type | internal-connection-point-ref / external-connection-point-ref
+            #    internal-connection-point-ref: <update, optional>
+            #    external-connection-point-ref: <update, optional>
+            #    virtual-interface:
+            #        type: <update, optional> # PARAVIRT,OM-MGMT,PCI-PASSTHROUGH,SR-IOV,VIRTIO,E1000,RTL8139,PCNET
+            #        vpci: <update, optional>
+            #        bandwidth: <update, optional>
+            #
+            #volumes:
+            #-   name: <update>
+            #    description: <update, optional>
+            #    size: <update, optional>
+            #    device-bus: <update, optional> # ide, usb, virtio, iscsi
+            #    device-type: <update, optional> # disk, cdrom, floopy, lun
+            #    # Choice volume-source | ephemeral / image
+            #    ephemeral: <update, optional>
+            #    image: <update, optional>
+            #    image-checksum: <update, optional>
+
+        #scaling-group-descriptor:
+        #-   name: <update>
+        #    min-instance-count: <update, optional>
+        #    max-instance-count: <update, optional>
+        #    scaling-policy:
+        #    -   name: <update>
+        #        scaling-type: <update, optional>
+        #        enabled: <update, optional>
+        #        scale-in-operator-type: <update, optional>
+        #        scale-out-operator-type: <update, optional>
+        #        threshold-time: <update, optional>
+        #        cooldown-time: <update, optional>
+        #        scaling-criteria: <update, optional>
+        #        -   name: <update>
+        #            scale-in-threshold: <update, optional>
+        #            scale-in-relational-operation: <update, optional>
+        #            scale-out-threshold: <update, optional>
+        #            scale-out-relational-operation: <update, optional>
+        #            vnf-monitoring-param-ref: <update, optional>
+        #    vdu:
+        #    -   vdu-id-ref: <update>
+        #        count: <update, optional>
+        #    scaling-config-action:
+        #    -   trigger: <update>
+        #        vnf-config-primitive-name-ref: <update, optional>
+
+        # List of monitoring params at NS level
+        #monitoring-param:
+        #-   id: <update>
+        #    name: <update, optional>
+        #    aggregation-type: <update, optional>
+        #    # Choice monitoring-type | vdu-monitoring-param / vnf-metric / vdu-metric
+        #    vdu-monitoring-param:
+        #        vdu-ref: <update, optional>
+        #        vdu-monitoring-param-ref: <update, optional>
+        #    vnf-metric:
+        #        vnfm-metric-name-ref: <update, optional>
+        #    vdu-metric:
+        #        vdu-ref: <update, optional>
+        #        vdu-metric-name-ref: <update, optional>
+        #
+        # Placement groups at VNF Level
+        #placement-groups:
+        #-   name: <update>
+        #    requirement: <update, optional>
+        #    strategy: <update, optional> # COLOCATION, ISOLATION
+        #    member-vdus:
+        #    -   member-vdu-ref: <update>
+        {%- endif %}
+        {%- if vdus > 1 %}
+        {% for y in range(1, vdus ) %}
+        -   id: {{ name }}_vnfd{{y}}-VM
+            name: {{ name }}_vnfd{{y}}-VM
+            description: {{ name }}_vnfd{{y}}-VM
+            count: 1
+            {%- if detailed is sameas true %}
+            #pdu-type: <update, optional>
+            #mgmt-vpci: <update, optional>
+            {%- endif %}
+
+            # Flavour of the VM to be instantiated for the VDU
+            vm-flavor:
+                vcpu-count: {{ vcpu }}
+                memory-mb: {{ memory }}
+                storage-gb: {{ storage }}
+
+            # Image including the full path
+            image: "{{ image }}"
+            {%- if detailed is sameas true %}
+            #image-checksum: <update, optional>
+            {%- endif %}
+
+            interface:
+            # Specify the external interfaces
+            # There can be multiple interfaces defined
+            -   name: eth0
+                type: EXTERNAL
+                virtual-interface:
+                    type: PARAVIRT
+                    {%- if detailed is sameas true %}
+                    #vpci: <update, optional>
+                    #bandwidth: <update, optional>
+                    {%- endif %}
+                external-connection-point-ref: vnf-cp0
+                {%- if detailed is sameas true %}
+                #internal-connection-point-ref: <update, optional>
+                #mac-address <update, optional>
+                #mgmt-interface: <update, optional>
+                {%- endif %}
+
+            {%- for z in range(1, interfaces + 1 ) %}
+            -   name: eth{{ z }}
+                type: EXTERNAL
+                virtual-interface:
+                    type: PARAVIRT
+                    {%- if detailed is sameas true %}
+                    #vpci: <update, optional>
+                    #bandwidth: <update, optional>
+                    {%- endif %}
+                external-connection-point-ref: vnf-cp{{ z }}
+                {%- if detailed is sameas true %}
+                #internal-connection-point-ref: <update, optional>
+                #mac-address <update, optional>
+                #mgmt-interface: <update, optional>
+                {%- endif %}
+            {%- endfor %}
+        {%- endfor %}
+        {%- endif %}
+        connection-point:
+        -   name: vnf-cp0
+        {%- for x in range(1, interfaces + 1 ) %}
+        -   name: vnf-cp{{ x }}
+        {%- endfor %}
\ No newline at end of file