Initial version (Copied from SO Module) 22/1922/1
authorvelandy <rajesh.velandy@riftio.com>
Wed, 7 Jun 2017 17:01:55 +0000 (13:01 -0400)
committervelandy <rajesh.velandy@riftio.com>
Wed, 7 Jun 2017 17:01:55 +0000 (13:01 -0400)
Signed-off-by: velandy <rajesh.velandy@riftio.com>
models/yang/mano-types.yang [new file with mode: 0644]
models/yang/nsd.yang [new file with mode: 0644]
models/yang/pnfd.yang [new file with mode: 0644]
models/yang/vnfd.yang [new file with mode: 0644]

diff --git a/models/yang/mano-types.yang b/models/yang/mano-types.yang
new file mode 100644 (file)
index 0000000..ebd24a9
--- /dev/null
@@ -0,0 +1,1976 @@
+
+/*
+ * 
+ *   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.
+ *
+ *
+ */
+
+module mano-types
+{
+  namespace "urn:ietf:params:xml:ns:yang:nfvo:mano-types";
+  prefix "manotypes";
+
+  import ietf-inet-types {
+    prefix "inet";
+  }
+
+  import rw-pb-ext {
+    prefix "rwpb";
+  }
+
+  revision 2015-04-23 {
+    description
+      "Initial revision. This YANG file defines
+       the reusable base types for VNF Management
+       and Orchestration (MANO).";
+    reference
+      "Derived from earlier versions of base YANG files";
+  }
+
+  typedef package-type {
+      description "Type of descriptor being on-boarded";
+      type enumeration {
+        enum NSD;
+        enum VNFD;
+      }
+    }
+
+  typedef parameter-data-type {
+    type enumeration {
+      enum STRING;
+      enum INTEGER;
+      enum BOOLEAN;
+    }
+  }
+
+  grouping primitive-parameter-value {
+    list parameter {
+      description
+          "List of parameters to the configuration primitive.";
+      key "name";
+      leaf name {
+        description
+            "Name of the parameter.";
+        type string;
+      }
+
+      leaf value {
+        description
+            "Value associated with the name.";
+        type string;
+      }
+    }
+  }
+
+  grouping primitive-parameter {
+    leaf name {
+      description
+          "Name of the parameter.";
+      type string;
+    }
+
+    leaf data-type {
+      description
+          "Data type associated with the name.";
+      type manotypes:parameter-data-type;
+    }
+
+    leaf mandatory {
+      description "Is this field mandatory";
+      type boolean;
+      default false;
+    }
+
+    leaf default-value {
+      description "The default value for this field";
+      type string;
+    }
+
+    leaf parameter-pool {
+      description "NSD parameter pool name to use for this parameter";
+      type string;
+    }
+
+    leaf read-only {
+      description
+        "The value should be dimmed by the UI.
+        Only applies to parameters with default values.";
+      type boolean;
+    }
+
+    leaf hidden {
+      description
+        "The value should be hidden by the UI.
+        Only applies to parameters with default values.";
+      type boolean;
+    }
+  }
+  
+  grouping ui-primitive-group {
+    list parameter-group {
+      description
+            "Grouping of parameters which are logically grouped in UI";
+      key "name";
+      leaf name {
+        description
+            "Name of the parameter group";
+        type string;
+      }
+      list parameter {
+        description
+            "List of parameters for the service primitive.";
+        key "name";
+        uses manotypes:primitive-parameter;
+      }
+      leaf mandatory {
+        description "Is this parameter group mandatory";
+        type boolean;
+        default true;
+      }
+    }
+  }
+
+  grouping image-properties {
+    leaf image {
+      description
+            "Image name for the software image.
+             If the image name is found within the VNF package it will
+             be uploaded to all VIM accounts during onboarding process.
+             Otherwise, the image must be added to the VIM account with
+             the same name as entered here.
+            ";
+      type string;
+    }
+
+    leaf image-checksum {
+      description
+            "Image md5sum for the software image.
+            The md5sum, if provided, along with the image name uniquely
+            identifies an image uploaded to the CAL.
+            ";
+      type string;
+    } 
+  }
+  grouping initial-config {
+    leaf seq {
+      description
+          "Sequence number for the configuration primitive.";
+      type uint64;
+    }
+
+    leaf name {
+      description
+          "Name of the configuration primitive.";
+      type string;
+      mandatory "true";
+    }
+
+    leaf user-defined-script {
+      description
+          "A user defined script.";
+      type string;
+    }
+
+    list parameter {
+      key "name";
+      leaf name {
+        type string;
+      }
+
+      leaf value {
+        description "Value of the configuration primitive.";
+        type string;
+      }
+    }
+  }
+
+  grouping vnf-configuration {
+    container vnf-configuration {
+      rwpb:msg-new VnfConfiguration;
+      description
+          "Information about the VNF configuration. Note: 
+           If the NS contains multiple instances of the
+           same VNF, each instance could have a different
+           configuration.";
+
+      choice config-method {
+        description
+            "Defines the configuration method for the VNF.";
+        case script {
+          description
+              "Use custom script for configuring the VNF.
+               This script is executed in the context of
+               Orchestrator (The same system and environment
+               as the Launchpad).";
+          container script {
+            leaf script-type {
+              description
+                  "Script type - currently supported - Scripts confirming to Rift CA plugin";
+              type enumeration {
+                enum rift;
+              }
+            }
+          }
+        }
+
+        case juju {
+          description
+            "Configure the VNF through Juju.";
+          container juju {
+            leaf charm {
+              description "Juju charm to use with the VNF.";
+              type string;
+            }
+          }
+        }
+      }
+
+      list service-primitive {
+        rwpb:msg-new ServicePrimitive;
+        description
+          "List of service primitives supported by the
+          configuration agent for this VNF.";
+        key "name";
+
+        leaf name {
+          description
+            "Name of the service primitive.";
+          type string;
+        }
+
+        list parameter {
+          description
+            "List of parameters to the service primitive.";
+          key "name";
+          uses primitive-parameter;
+        }
+      }
+
+      list initial-config-primitive {
+        rwpb:msg-new InitialConfigPrimitive;
+        description
+          "Initial set of configuration primitives.";
+        key "seq";
+        uses initial-config;
+      }
+    }
+  } // END - grouping vnf-configuration
+
+  typedef virtual-link-type {
+    description
+        "Type of virtual link
+         ELAN: A multipoint service connecting a set of VNFs
+         // ELINE: For a simple point to point connection
+         //        between a VNF and the existing network.
+         // ETREE: A multipoint service connecting one or
+         //        more roots and a set of leaves, but
+         //        preventing inter-leaf communication.";
+    type enumeration {
+      enum ELAN;
+      // enum ETREE;
+      // enum ELINE;
+    }
+  }
+
+  grouping named-value {
+    leaf name {
+      type string;
+    }
+
+    leaf value {
+      type string;
+    }
+  }
+
+  typedef http-method {
+    description
+      "Type of HTTP operation";
+
+    type enumeration {
+      enum POST;
+      enum PUT;
+      enum GET;
+      enum DELETE;
+      enum OPTIONS;
+      enum PATCH;
+    }
+  }
+
+  typedef api-type {
+    description
+      "Type of API to fetch monitoring parameters";
+
+    type enumeration {
+      enum HTTP;
+      enum NETCONF;
+      enum SOAP;
+    }
+  }
+
+  typedef json-query-method {
+    description
+      "The method to extract a value from a JSON response
+
+       NAMEKEY - Use the name as the key for a non-nested value.
+       JSONPATH - Use jsonpath-rw implementation to extract a value.
+       OBJECTPATH - Use objectpath implementation to extract a value.";
+      type enumeration {
+        enum NAMEKEY;
+        enum JSONPATH;
+        enum OBJECTPATH;
+      }
+  }
+
+  typedef param-value-type {
+    description
+      "The type of the parameter value";
+    type enumeration {
+       enum INT;
+       enum DECIMAL;
+       enum STRING;
+    }
+  }
+
+  typedef connection-point-type {
+    description
+        "Type of connection point
+        VPORT: Virtual Port
+        // VNIC_ADDR: Virtual NIC Address
+        // PNIC_ADDR: Physical NIC Address
+        // PPORT: Physical Port.";
+
+    type enumeration {
+      enum VPORT;
+    }
+  }
+
+  typedef widget-type {
+    description
+        "Type of the widget, typically used by the UI.";
+    type enumeration {
+      enum HISTOGRAM;
+      enum BAR;
+      enum GAUGE;
+      enum SLIDER;
+      enum COUNTER;
+      enum TEXTBOX;
+    }
+  }
+
+  typedef cpu-feature-type {
+    description
+        "Enumeration for CPU features.
+
+         AES: CPU supports advanced instruction set for
+         AES (Advanced Encryption Standard).
+
+         CAT: Cache Allocation Technology (CAT) allows
+         an Operating System, Hypervisor, or similar
+         system management agent to specify the amount
+         of L3 cache (currently the last-level cache
+         in most server and client platforms) space an
+         application can fill (as a hint to hardware
+         functionality, certain features such as power
+         management may override CAT settings).
+
+         CMT: Cache Monitoring Technology (CMT) allows
+         an Operating System, Hypervisor, or similar
+         system management agent to determine the
+         usage of cache based on applications running
+         on the platform. The implementation is
+         directed at L3 cache monitoring (currently
+         the last-level cache in most server and
+         client platforms).
+
+         DDIO: Intel Data Direct I/O (DDIO) enables
+         Ethernet server NICs and controllers talk
+         directly to the processor cache without a
+         detour via system memory. This enumeration
+         specifies if the VM requires a DDIO
+         capable host.";
+
+    type enumeration {
+      enum PREFER_AES;
+      enum REQUIRE_AES;
+      enum PREFER_CAT;
+      enum REQUIRE_CAT;
+      enum PREFER_CMT;
+      enum REQUIRE_CMT;
+      enum PREFER_DDIO;
+      enum REQUIRE_DDIO;
+      enum REQUIRE_VME;
+      enum PREFER_VME;
+      enum REQUIRE_DE;
+      enum PREFER_DE;
+      enum REQUIRE_PSE;
+      enum PREFER_PSE;
+      enum REQUIRE_TSC;
+      enum PREFER_TSC;
+      enum REQUIRE_MSR;
+      enum PREFER_MSR;
+      enum REQUIRE_PAE;
+      enum PREFER_PAE;
+      enum REQUIRE_MCE;
+      enum PREFER_MCE;
+      enum REQUIRE_CX8;
+      enum PREFER_CX8;
+      enum REQUIRE_APIC;
+      enum PREFER_APIC;
+      enum REQUIRE_SEP;
+      enum PREFER_SEP;
+      enum REQUIRE_MTRR;
+      enum PREFER_MTRR;
+      enum REQUIRE_PGE;
+      enum PREFER_PGE;
+      enum REQUIRE_MCA;
+      enum PREFER_MCA;
+      enum REQUIRE_CMOV;
+      enum PREFER_CMOV;
+      enum REQUIRE_PAT;
+      enum PREFER_PAT;
+      enum REQUIRE_PSE36;
+      enum PREFER_PSE36;
+      enum REQUIRE_CLFLUSH;
+      enum PREFER_CLFLUSH;
+      enum REQUIRE_DTS;
+      enum PREFER_DTS;
+      enum REQUIRE_ACPI;
+      enum PREFER_ACPI;
+      enum REQUIRE_MMX;
+      enum PREFER_MMX;
+      enum REQUIRE_FXSR;
+      enum PREFER_FXSR;
+      enum REQUIRE_SSE;
+      enum PREFER_SSE;
+      enum REQUIRE_SSE2;
+      enum PREFER_SSE2;
+      enum REQUIRE_SS;
+      enum PREFER_SS;
+      enum REQUIRE_HT;
+      enum PREFER_HT;
+      enum REQUIRE_TM;
+      enum PREFER_TM;
+      enum REQUIRE_IA64;
+      enum PREFER_IA64;
+      enum REQUIRE_PBE;
+      enum PREFER_PBE;
+      enum REQUIRE_RDTSCP;
+      enum PREFER_RDTSCP;
+      enum REQUIRE_PNI;
+      enum PREFER_PNI;
+      enum REQUIRE_PCLMULQDQ;
+      enum PREFER_PCLMULQDQ;
+      enum REQUIRE_DTES64;
+      enum PREFER_DTES64;
+      enum REQUIRE_MONITOR;
+      enum PREFER_MONITOR;
+      enum REQUIRE_DS_CPL;
+      enum PREFER_DS_CPL;
+      enum REQUIRE_VMX;
+      enum PREFER_VMX;
+      enum REQUIRE_SMX;
+      enum PREFER_SMX;
+      enum REQUIRE_EST;
+      enum PREFER_EST;
+      enum REQUIRE_TM2;
+      enum PREFER_TM2;
+      enum REQUIRE_SSSE3;
+      enum PREFER_SSSE3;
+      enum REQUIRE_CID;
+      enum PREFER_CID;
+      enum REQUIRE_FMA;
+      enum PREFER_FMA;
+      enum REQUIRE_CX16;
+      enum PREFER_CX16;
+      enum REQUIRE_XTPR;
+      enum PREFER_XTPR;
+      enum REQUIRE_PDCM;
+      enum PREFER_PDCM;
+      enum REQUIRE_PCID;
+      enum PREFER_PCID;
+      enum REQUIRE_DCA;
+      enum PREFER_DCA;
+      enum REQUIRE_SSE4_1;
+      enum PREFER_SSE4_1;
+      enum REQUIRE_SSE4_2;
+      enum PREFER_SSE4_2;
+      enum REQUIRE_X2APIC;
+      enum PREFER_X2APIC;
+      enum REQUIRE_MOVBE;
+      enum PREFER_MOVBE;
+      enum REQUIRE_POPCNT;
+      enum PREFER_POPCNT;
+      enum REQUIRE_TSC_DEADLINE_TIMER;
+      enum PREFER_TSC_DEADLINE_TIMER;
+      enum REQUIRE_XSAVE;
+      enum PREFER_XSAVE;
+      enum REQUIRE_AVX;
+      enum PREFER_AVX;
+      enum REQUIRE_F16C;
+      enum PREFER_F16C;
+      enum REQUIRE_RDRAND;
+      enum PREFER_RDRAND;
+      enum REQUIRE_FSGSBASE;
+      enum PREFER_FSGSBASE;
+      enum REQUIRE_BMI1;
+      enum PREFER_BMI1;
+      enum REQUIRE_HLE;
+      enum PREFER_HLE;
+      enum REQUIRE_AVX2;
+      enum PREFER_AVX2;
+      enum REQUIRE_SMEP;
+      enum PREFER_SMEP;
+      enum REQUIRE_BMI2;
+      enum PREFER_BMI2;
+      enum REQUIRE_ERMS;
+      enum PREFER_ERMS;
+      enum REQUIRE_INVPCID;
+      enum PREFER_INVPCID;
+      enum REQUIRE_RTM;
+      enum PREFER_RTM;
+      enum REQUIRE_MPX;
+      enum PREFER_MPX;
+      enum REQUIRE_RDSEED;
+      enum PREFER_RDSEED;
+      enum REQUIRE_ADX;
+      enum PREFER_ADX;
+      enum REQUIRE_SMAP;
+      enum PREFER_SMAP;
+    }
+  }
+
+  grouping vm-flavor {
+    container vm-flavor {
+      leaf vcpu-count {
+        description
+            "Number of VCPUs for the VM.";
+        type uint16;
+      }
+
+      leaf memory-mb {
+        description
+            "Amount of memory in MB.";
+        type uint64;
+      }
+
+      leaf storage-gb {
+        description
+            "Amount of disk space in GB.";
+        type uint64;
+      }
+    }
+  } //grouping vm-flavor
+
+  grouping vswitch-epa {
+    container vswitch-epa {
+      leaf ovs-acceleration {
+        description
+            "Specifies Open vSwitch acceleration mode.
+             MANDATORY: OVS acceleration is required
+             PREFERRED: OVS acceleration is preferred";
+        type enumeration {
+          enum MANDATORY;
+          enum PREFERRED;
+          enum DISABLED;
+        }
+      }
+
+      leaf ovs-offload {
+        description
+            "Specifies Open vSwitch hardware offload mode.
+             MANDATORY: OVS offload is required
+             PREFERRED: OVS offload is preferred";
+        type enumeration {
+          enum MANDATORY;
+          enum PREFERRED;
+          enum DISABLED;
+        }
+      }
+    }
+  }
+
+  grouping hypervisor-epa {
+    container hypervisor-epa {
+      leaf type {
+        description
+            "Specifies the type of hypervisor.
+             KVM: KVM
+             XEN: XEN";
+        type enumeration {
+          enum PREFER_KVM;
+          enum REQUIRE_KVM;
+        }
+      }
+      leaf version {
+        type string;
+      }
+    }
+  }
+
+  grouping host-epa {
+    container host-epa {
+      description "Specifies the host level EPA attributes.";
+      leaf cpu-model {
+        description
+            "Host CPU model. Examples include: SandyBridge,
+             IvyBridge";
+        type enumeration {
+          enum PREFER_WESTMERE;
+          enum REQUIRE_WESTMERE;
+          enum PREFER_SANDYBRIDGE;
+          enum REQUIRE_SANDYBRIDGE;
+          enum PREFER_IVYBRIDGE;
+          enum REQUIRE_IVYBRIDGE;
+          enum PREFER_HASWELL;
+          enum REQUIRE_HASWELL;
+          enum PREFER_BROADWELL;
+          enum REQUIRE_BROADWELL;
+          enum PREFER_NEHALEM;
+          enum REQUIRE_NEHALEM;
+          enum PREFER_PENRYN;
+          enum REQUIRE_PENRYN;
+          enum PREFER_CONROE;
+          enum REQUIRE_CONROE;
+          enum PREFER_CORE2DUO;
+          enum REQUIRE_CORE2DUO;
+        }
+      }
+
+      leaf cpu-arch {
+        description "Host CPU architecture.";
+        type enumeration {
+          enum PREFER_X86;
+          enum REQUIRE_X86;
+          enum PREFER_X86_64;
+          enum REQUIRE_X86_64;
+          enum PREFER_I686;
+          enum REQUIRE_I686;
+          enum PREFER_IA64;
+          enum REQUIRE_IA64;
+          enum PREFER_ARMV7;
+          enum REQUIRE_ARMV7;
+          enum PREFER_ARMV8;
+          enum REQUIRE_ARMV8;
+        }
+      }
+
+      leaf cpu-vendor {
+        description "Host CPU Vendor.";
+        type enumeration {
+          enum PREFER_INTEL;
+          enum REQUIRE_INTEL;
+          enum PREFER_AMD;
+          enum REQUIRE_AMD;
+        }
+      }
+
+      leaf cpu-socket-count {
+        description "Number of sockets on the host.";
+        type uint64;
+      }
+
+      leaf cpu-core-count {
+        description "Number of cores on the host.";
+        type uint64;
+      }
+
+      leaf cpu-core-thread-count {
+        description "Number of threads per cores on the host.";
+        type uint64;
+      }
+      
+      list cpu-feature {
+        key "feature";
+        description "List of CPU features.";
+        leaf feature {
+          description "CPU feature.";
+          type cpu-feature-type;
+        }
+      }
+
+      
+      leaf om-cpu-model-string {
+        description "OpenMANO CPU model string";
+        type string;
+      }
+
+      list om-cpu-feature {
+        key "feature";
+        description "List of OpenMANO CPU features";
+        leaf feature {
+          description "CPU feature";
+          type string;
+        }
+      }
+    }
+  }
+
+  grouping guest-epa {
+    description "EPA attributes for the guest";
+    container guest-epa {
+      leaf trusted-execution {
+        description "This VM should be allocated from trusted pool";
+        type boolean;
+      }
+
+      leaf mempage-size {
+        description
+            "Memory page allocation size. If a VM requires
+             hugepages, it should choose LARGE or SIZE_2MB
+             or SIZE_1GB. If the VM prefers hugepages it
+             should choose PREFER_LARGE.
+             LARGE        : Require hugepages (either 2MB or 1GB)
+             SMALL        : Doesn't require hugepages
+             SIZE_2MB     : Requires 2MB hugepages
+             SIZE_1GB     : Requires 1GB hugepages
+             PREFER_LARGE : Application prefers hugepages";
+        type enumeration {
+          enum LARGE;
+          enum SMALL;
+          enum SIZE_2MB;
+          enum SIZE_1GB;
+          enum PREFER_LARGE;
+        }
+      }
+
+      leaf cpu-pinning-policy {
+        description
+            "CPU pinning policy describes association
+             between virtual CPUs in guest and the
+             physical CPUs in the host.
+             DEDICATED : Virtual CPUs are pinned to
+                         physical CPUs
+             SHARED    : Multiple VMs may share the
+                         same physical CPUs.
+             ANY       : Any policy is acceptable for the VM";
+        type enumeration {
+          enum DEDICATED;
+          enum SHARED;
+          enum ANY;
+        }
+        default "ANY";
+      }
+
+      leaf cpu-thread-pinning-policy {
+          description
+            "CPU thread pinning policy describes how to
+             place the guest CPUs when the host supports
+             hyper threads:
+             AVOID   : Avoids placing a guest on a host
+                       with threads.
+             SEPARATE: Places vCPUs on separate cores,
+                       and avoids placing two vCPUs on
+                       two threads of same core.
+             ISOLATE : Places each vCPU on a different core,
+                       and places no vCPUs from a different
+                       guest on the same core.
+             PREFER  : Attempts to place vCPUs on threads
+                       of the same core.";
+        type enumeration {
+          enum AVOID;
+          enum SEPARATE;
+          enum ISOLATE;
+          enum PREFER;
+        }
+      }
+
+      list pcie-device {
+        description
+            "List of pcie passthrough devices.";
+        key device-id;
+        leaf device-id {
+          description
+              "Device identifier.";
+          type string;
+        }
+        leaf count {
+          description
+              "Number of devices to attach to the VM.";
+          type uint64;
+        }
+      }
+
+      choice numa-policy {
+        case numa-unaware {
+          leaf numa-unaware {
+            type empty;
+          }
+        }
+
+        case numa-aware {
+          container numa-node-policy {
+            description
+                "This policy defines NUMA topology of the
+                 guest. Specifically identifies if the guest
+                 should be run on a host with one NUMA
+                 node or multiple NUMA nodes. As an example
+                 a guest might need 8 VCPUs and 4 GB of
+                 memory. However, it might need the VCPUs
+                 and memory distributed across multiple
+                 NUMA nodes. In this scenario, NUMA node
+                 1 could run with 6 VCPUs and 3GB, and
+                 NUMA node 2 could run with 2 VCPUs and
+                 1GB.";
+
+            leaf node-cnt {
+              description
+                  "The number of NUMA nodes to expose to the VM.";
+              type uint16;
+            }
+
+            leaf mem-policy {
+              description
+                  "This policy specifies how the memory should
+                   be allocated in a multi-node scenario.
+                   STRICT    : The memory must be allocated
+                               strictly from the memory attached
+                               to the NUMA node.
+                   PREFERRED : The memory should be allocated
+                               preferentially from the memory
+                               attached to the NUMA node";
+              type enumeration {
+                enum STRICT;
+                enum PREFERRED;
+              }
+            }
+
+           list node {
+              key id;
+              leaf id {
+                description
+                    "NUMA node identification. Typically
+                     it's 0 or 1";
+                type uint64;
+              }
+
+              list vcpu {
+                key "id";
+                description
+                    "List of VCPUs to allocate on
+                     this NUMA node.";
+                leaf id {
+                  type uint64;
+                  description "List of VCPUs ids to allocate on
+                               this NUMA node";
+                }
+              }
+
+              leaf memory-mb {
+                description
+                    "Memory size expressed in MB
+                     for this NUMA node.";
+                type uint64;
+              }
+
+              choice om-numa-type {
+                description
+                    "OpenMANO Numa type selection";
+
+                case cores {
+                  leaf num-cores {
+                    type uint8;
+                  }
+                }
+
+                case paired-threads {
+                  container paired-threads {
+                    leaf num-paired-threads {
+                      type uint8;
+                    }
+
+                    list paired-thread-ids {
+                      description
+                          "List of thread pairs to use in case of paired-thread NUMA";
+                      max-elements 16;
+                      key thread-a;
+
+                      leaf thread-a {
+                          type uint8;
+                      }
+
+                      leaf thread-b {
+                          type uint8;
+                      }
+                    }
+                  }
+                }
+                case threads {
+                  leaf num-threads {
+                    type uint8;
+                  }
+                }
+              }
+            }
+
+          }
+        }
+      }
+    }
+  }
+
+  grouping provider-network {
+    container provider-network {
+      description "Container for the provider network.";
+      leaf physical-network {
+        description
+            "Name of the physical network on which the provider
+             network is built.";
+        type string;
+      }
+
+      leaf overlay-type {
+        description
+            "Type of the overlay network.
+             LOCAL - Provider network implemented in a single compute node
+             FLAT - Provider network shared by all tenants 
+             VLAN - Provider network implemented using 802.1Q tagging
+             VXLAN - Provider networks implemented using RFC 7348
+             GRE - Provider networks implemented using GRE tunnels";
+        type enumeration {
+          enum LOCAL;
+          enum FLAT;
+          enum VLAN;
+          enum VXLAN;
+          enum GRE;
+        }
+      }
+      leaf segmentation_id {
+        description
+            "ID of segregated virtual networks";
+            type uint32;
+      }
+    }
+  }
+
+  grouping monitoring-param {
+    list http-endpoint {
+      description
+          "List of http endpoints to be used by monitoring params";
+      key path;
+
+      leaf path {
+        description "The HTTP path on the management server";
+        type string;
+      }
+
+      leaf https {
+        description "Pick HTTPS instead of HTTP , Default is false";
+        type boolean;
+        default "false";
+      }
+
+      leaf port {
+        description "The HTTP port to connect to";
+        type inet:port-number;
+      }
+
+      leaf username {
+        description "The HTTP basic auth username";
+        type string;
+      }
+
+      leaf password {
+        description "The HTTP basic auth password";
+        type string;
+      }
+
+      leaf polling-interval-secs {
+        description "The HTTP polling interval in seconds";
+        type uint8;
+        default 2;
+      }
+
+      leaf method {
+        description
+          "Method that the URI should perform.
+           Deafult action is GET.";
+
+        type manotypes:http-method;
+        default "GET";
+      }
+
+      list headers {
+        description "Custom HTTP headers to put on HTTP request";
+        key key;
+        leaf key{
+          description "HTTP header key";
+          type string;
+        }
+
+        leaf value{
+          description "HTTP header value";
+          type string;
+        }
+      }
+    }
+
+    list monitoring-param {
+      description
+          "List of monitoring parameters at the network service level";
+      key id;
+      leaf id {
+        type string;
+      }
+
+      leaf name {
+        type string;
+      }
+
+      leaf http-endpoint-ref {
+        type leafref {
+          path "../../http-endpoint/path";
+        }
+      }
+
+      leaf json-query-method {
+        type json-query-method;
+        default "NAMEKEY";
+      }
+
+      container json-query-params {
+        leaf json-path {
+          description
+            "The jsonpath to use to extract value from JSON structure";
+          type string;
+        }
+        leaf object-path {
+          description
+            "The objectpath to use to extract value from JSON structure";
+          type string;
+        }
+      }
+
+      uses monitoring-param-ui-data;
+      uses monitoring-param-value;
+
+    }
+  }
+
+  grouping monitoring-param-aggregation {
+    typedef aggregation-type {
+      description "aggregation-type";
+      type enumeration {
+        enum AVERAGE;
+        enum MINIMUM;
+        enum MAXIMUM;
+        enum COUNT;
+        enum SUM;
+      }
+    }
+
+    leaf aggregation-type {
+      type aggregation-type;
+    }
+  }
+
+  grouping monitoring-param-ui-data {
+      leaf description {
+        type string;
+      }
+
+      leaf group-tag {
+        description "A tag to group monitoring parameters";
+        type string;
+      }
+
+
+      leaf widget-type {
+        description "Defines the UI Display variant of measured counters.";
+        type manotypes:widget-type;
+      }
+
+      leaf units {
+        description "Measured Counter Units (e.g., Packets, Kbps, Mbps, etc.)";
+        type string;
+      }
+  }
+
+  grouping monitoring-param-value {
+      leaf value-type {
+        type param-value-type;
+        default "INT";
+      }
+
+      container numeric-constraints {
+        leaf min-value {
+          description
+              "Minimum value for the parameter";
+          type uint64;
+        }
+        leaf max-value {
+          description
+              "Maximum value for the parameter";
+          type uint64;
+        }
+      }
+
+      container text-constraints {
+        leaf min-length {
+          description
+              "Minimum string length for the parameter";
+          type uint8;
+        }
+        leaf max-length {
+          description
+              "Maximum string length for the parameter";
+          type uint8;
+        }
+      }
+
+      leaf value-integer {
+        description
+            "Current value for an integer parameter";
+        type int64;
+      }
+
+      leaf value-decimal {
+        description
+            "Current value for a decimal parameter";
+        type decimal64 {
+          fraction-digits 4;
+        }
+      }
+
+      leaf value-string {
+        description
+            "Current value for a string parameter";
+        type string;
+      }
+  }
+
+  grouping control-param {
+    list control-param {
+      description
+          "List of control parameters to manage and
+           update the running configuration of the VNF";
+      key id;
+
+      leaf id {
+        description "Identifier for control parameter";
+        type string;
+      }
+
+      leaf name {
+        description "Name of a control parameter";
+        type string;
+      }
+
+      leaf description {
+        description "A description of the control parameter";
+        type string;
+      }
+
+      leaf group-tag {
+        description "A tag to group control parameters";
+        type string;
+      }
+
+      leaf min-value {
+        description
+            "Minimum value for the parameter";
+        type uint64;
+      }
+
+      leaf max-value {
+        description
+            "Maximum value for the parameter";
+        type uint64;
+      }
+
+      leaf current-value {
+        description
+            "Current value for the parameter";
+        type uint64;
+      }
+
+      leaf step-value {
+        description
+            "Step value for the parameter";
+        type uint64;
+      }
+
+      leaf units {
+        type string;
+      }
+
+      leaf widget-type {
+        type manotypes:widget-type;
+      }
+
+      leaf url {
+        description
+          "This is the URL where the operation should be performed.";
+
+        type inet:uri;
+      }
+
+      leaf method {
+        description
+          "Method that the URI should perform.
+           Default Action is POST";
+
+        type manotypes:http-method;
+        default "POST";
+      }
+
+      leaf payload {
+        description
+          "This is the operation payload or payload template as stringified
+           JSON. This field provides the data  to be sent for this operation
+           call";
+
+        type string;
+      }
+    }
+  }
+
+  grouping action-param {
+    list action-param {
+      description
+          "List of action parameters to
+           control VNF";
+      key id;
+      leaf id {
+        type string;
+      }
+
+      leaf name {
+        type string;
+      }
+
+      leaf description {
+        type string;
+      }
+
+      leaf group-tag {
+        description "A tag to group monitoring parameter";
+        type string;
+      }
+
+      leaf url {
+        description
+          "This is the URL where to perform the operation";
+        type inet:uri;
+      }
+
+      leaf method {
+        description
+          "This is the method to be performed at the uri.
+           POST by default for action";
+
+        type manotypes:http-method;
+        default "POST";
+      }
+
+      leaf payload {
+        description
+          "This is the operation payload or payload template to be sent in
+           the data for this operation call";
+
+        type string;
+      }
+    }
+  }
+
+  grouping input-parameter {
+    description "List of input parameters that can be specified when instantiating a network service.";
+
+    list input-parameter {
+      description
+          "List of input parameters";
+
+      key xpath;
+
+
+      leaf xpath {
+        description
+          "An xpath that specfies which element in a descriptor is to be
+          modified.";
+        type string;
+      }
+
+      leaf value {
+        description
+          "The value that the element specified by the xpath should take when a
+          record is created.";
+        type string;
+      }
+    }
+  }
+
+  grouping input-parameter-xpath {
+    list input-parameter-xpath {
+      description
+          "List of xpaths to parameters inside the NSD
+           the can be customized during the instantiation.";
+
+      key "xpath";
+      leaf xpath {
+        description
+            "An xpath that specifies the element in a descriptor.";
+        type string;
+      }
+
+      leaf label {
+        description "A descriptive string";
+        type string;
+      }
+
+      leaf default-value {
+        description "/nsd:nsd-catalog/nsd:nsd/nsd:vendor";
+        type string;
+      }
+    }
+  }
+
+  grouping nfvi-metrics {
+    container vcpu {
+      leaf label {
+        description
+          "Label to show in UI";
+        type string;
+        default "VCPU";
+      }
+
+      leaf total {
+        description
+          "The total number of VCPUs available.";
+        type uint64;
+      }
+
+      leaf utilization {
+        description
+          "The VCPU utilization (percentage).";
+        type decimal64 {
+          fraction-digits 2;
+          range "0 .. 100";
+        }
+      }
+    }
+
+    container memory {
+      leaf label {
+        description
+          "Label to show in UI";
+        type string;
+        default "MEMORY";
+      }
+
+      leaf used {
+        description
+          "The amount of memory (bytes) currently in use.";
+        type uint64;
+      }
+
+      leaf total {
+        description
+          "The amount of memory (bytes) available.";
+        type uint64;
+      }
+
+      leaf utilization {
+        description
+          "The memory utilization (percentage).";
+        type decimal64 {
+          fraction-digits 2;
+          range "0 .. 100";
+        }
+      }
+    }
+
+    container storage {
+      leaf label {
+        description
+          "Label to show in UI";
+        type string;
+        default "STORAGE";
+      }
+
+      leaf used {
+        description
+          "The amount of storage (bytes) currently in use.";
+        type uint64;
+      }
+
+      leaf total {
+        description
+          "The amount of storage (bytes) available.";
+        type uint64;
+      }
+
+      leaf utilization {
+        description
+          "The storage utilization (percentage).";
+        type decimal64 {
+          fraction-digits 2;
+          range "0 .. 100";
+        }
+      }
+    }
+
+    container external-ports {
+      leaf label {
+        description
+          "Label to show in UI";
+        type string;
+        default "EXTERNAL PORTS";
+      }
+
+      leaf total {
+        description
+          "The total number of external ports.";
+        type uint64;
+      }
+    }
+
+    container internal-ports {
+      leaf label {
+        description
+          "Label to show in UI";
+        type string;
+        default "INTERNAL PORTS";
+      }
+
+      leaf total {
+        description
+          "The total number of internal ports.";
+        type uint64;
+      }
+    }
+
+    container network {
+      leaf label {
+        description
+          "Label to show in UI";
+        type string;
+        default "NETWORK TRAFFIC";
+      }
+
+      container incoming {
+        leaf label {
+          description
+            "Label to show in UI";
+          type string;
+          default "INCOMING NETWORK TRAFFIC";
+        }
+
+        leaf bytes {
+          description
+            "The cumulative number of incoming bytes.";
+          type uint64;
+        }
+
+        leaf packets {
+          description
+            "The cumulative number of incoming packets.";
+          type uint64;
+        }
+
+        leaf byte-rate {
+          description
+            "The current incoming byte-rate (bytes per second).";
+          type decimal64 {
+            fraction-digits 2;
+          }
+        }
+
+        leaf packet-rate {
+          description
+            "The current incoming packet (packets per second).";
+          type decimal64 {
+            fraction-digits 2;
+          }
+        }
+      }
+
+      container outgoing {
+        leaf label {
+          description
+            "Label to show in UI";
+          type string;
+          default "OUTGOING NETWORK TRAFFIC";
+        }
+
+        leaf bytes {
+          description
+            "The cumulative number of outgoing bytes.";
+          type uint64;
+        }
+
+        leaf packets {
+          description
+            "The cumulative number of outgoing packets.";
+          type uint64;
+        }
+
+        leaf byte-rate {
+          description
+            "The current outgoing byte-rate (bytes per second).";
+          type decimal64 {
+            fraction-digits 2;
+          }
+        }
+
+        leaf packet-rate {
+          description
+            "The current outgoing packet (packets per second).";
+          type decimal64 {
+            fraction-digits 2;
+          }
+        }
+      }
+    }
+  }
+
+  typedef alarm-severity-type {
+    description "An indication of the importance or urgency of the alarm";
+    type enumeration {
+      enum LOW;
+      enum MODERATE;
+      enum CRITICAL;
+    }
+  }
+
+  typedef alarm-metric-type {
+    description "The type of metrics to register the alarm for";
+    type enumeration {
+      enum CPU_UTILIZATION;
+      enum MEMORY_UTILIZATION;
+      enum STORAGE_UTILIZATION;
+    }
+  }
+
+  typedef alarm-statistic-type {
+    description
+        "Statistic type to use to determine threshold crossing
+         for an alarm.";
+    type enumeration {
+      enum AVERAGE;
+      enum MINIMUM;
+      enum MAXIMUM;
+      enum COUNT;
+      enum SUM;
+    }
+  }
+
+  typedef alarm-operation-type {
+    description
+        "The relational operator used to define whether an alarm
+        should be triggered in certain scenarios, such as if the
+        metric statistic goes above or below a specified value.";
+    type enumeration {
+      enum GE; // greater than or equal
+      enum LE; // less than or equal
+      enum GT; // greater than
+      enum LT; // less than
+      enum EQ; // equal
+    }
+  }
+
+  grouping alarm {
+    leaf alarm-id {
+      description
+          "This field is reserved for the identifier assigned by the VIM provider";
+
+      type string;
+    }
+
+    leaf name {
+      description "A human readable string to identify the alarm";
+      type string;
+    }
+
+    leaf description {
+      description "A description of this alarm";
+      type string;
+    }
+
+    leaf vdur-id {
+      description
+          "The identifier of the VDUR that the alarm is associated with";
+      type string;
+    }
+
+    container actions {
+      list ok {
+        key "url";
+        leaf url {
+          type string;
+        }
+      }
+
+      list insufficient-data {
+        key "url";
+        leaf url {
+          type string;
+        }
+      }
+
+      list alarm {
+        key "url";
+        leaf url {
+          type string;
+        }
+      }
+    }
+
+    leaf repeat {
+      description
+          "This flag indicates whether the alarm should be repeatedly emitted
+          while the associated threshold has been crossed.";
+
+      type boolean;
+      default true;
+    }
+
+    leaf enabled {
+      description
+          "This flag indicates whether the alarm has been enabled or
+          disabled.";
+
+      type boolean;
+      default true;
+    }
+
+    leaf severity {
+      description "A measure of the importance or urgency of the alarm";
+      type alarm-severity-type;
+    }
+
+    leaf metric {
+      description "The metric to be tracked by this alarm.";
+      type alarm-metric-type;
+    }
+
+    leaf statistic {
+      description "The type of metric statistic that is tracked by this alarm";
+      type alarm-statistic-type;
+    }
+
+    leaf operation {
+      description
+          "The relational operator used to define whether an alarm should be
+           triggered in certain scenarios, such as if the metric statistic 
+           goes above or below a specified value.";
+      type alarm-operation-type;
+    }
+
+    leaf value {
+      description
+          "This value defines the threshold that, if crossed, will trigger
+          the alarm.";
+      type decimal64 {
+        fraction-digits 4;
+      }
+    }
+
+    leaf period {
+      description
+          "The period defines the length of time (seconds) that the metric
+          data are collected over in oreder to evaluate the chosen
+          statistic.";
+      type uint32;
+    }
+
+    leaf evaluations {
+      description
+          "Defines the length of time (seconds) in which metric data are
+           collected in order to evaluate the chosen statistic.";
+      type uint32;
+    }
+  }
+
+  typedef cloud-account-type {
+    description "VIM account type";
+    type enumeration {
+      enum aws;
+      enum cloudsim;
+      enum cloudsim_proxy;
+      enum mock;
+      enum openmano;
+      enum openstack;
+      enum vsphere;
+      enum openvim;
+    }
+  }
+  
+  grouping host-aggregate {
+    list host-aggregate {
+      description "Name of the Host Aggregate";
+      key "metadata-key";
+      
+      leaf metadata-key {
+        description
+            "Name of the additional information attached to the host-aggregate";
+        type string;
+      }
+      leaf metadata-value {
+        description
+            "Value of the corresponding metadata-key";
+        type string;
+      }
+    }
+  }
+  
+  grouping placement-group-input {
+    leaf cloud-type {
+      type manotypes:cloud-account-type;
+    }
+    choice cloud-provider {
+      case openstack {           
+        container availability-zone {
+          description "Name of the Availability Zone";
+          leaf name {
+            type string;
+          }
+        }
+        container server-group {
+          description "Name of the Affinity/Anti-Affinity Server Group";
+          leaf name {
+            type string;
+          }
+        }
+        uses host-aggregate;
+      }
+      case aws {
+        leaf aws-construct {
+          type empty;
+        }
+      }
+      case openmano {
+        leaf openmano-construct {
+          type empty;
+        }        
+      }
+      case vsphere {
+        leaf vsphere-construct {
+          type empty;
+        }
+      }
+      case mock {
+        leaf mock-construct {
+          type empty;
+        }
+      }
+      case cloudsim {
+        leaf cloudsim-construct {
+          type empty;
+        }
+      }
+    }
+  }
+  
+  grouping placement-group-info {
+    description "";
+
+    leaf name {
+      description
+          "Place group construct to define the compute resource placement strategy
+           in cloud environment";
+      type string;
+    }
+
+    leaf requirement {
+      description "This is free text space used to describe the intent/rationale
+                   behind this placement group. This is for human consumption only";
+      type string;
+    }
+    
+    leaf strategy {
+      description
+          "Strategy associated with this placement group
+             Following values are possible
+               - COLOCATION: Colocation strategy imply intent to share the physical
+                             infrastructure (hypervisor/network) among all members
+                             of this group.
+               - ISOLATION: Isolation strategy imply intent to not share the physical
+                            infrastructure (hypervisor/network) among the members
+                            of this group.
+             ";
+      type enumeration {
+        enum COLOCATION;
+        enum ISOLATION;
+      }
+      default "COLOCATION";
+    }
+  }
+
+  grouping ip-profile-info {
+    description "Grouping for IP-Profile";
+    container ip-profile-params {
+      
+      leaf ip-version {
+        type inet:ip-version;
+        default ipv4;
+      }
+
+      leaf subnet-address {
+        description "Subnet IP prefix associated with IP Profile";
+        type inet:ip-prefix;
+      }
+
+      leaf gateway-address {
+        description "IP Address of the default gateway associated with IP Profile";
+        type inet:ip-address;
+      }
+
+      leaf security-group {
+        description "Name of the security group";
+        type string;
+      }
+
+      list dns-server {
+        key "address";
+        leaf address {
+                                       description "List of DNS Servers associated with IP Profile";
+                                       type inet:ip-address;
+        }
+      }
+
+      container dhcp-params {  
+        leaf enabled {
+          description "This flag indicates if DHCP is enabled or not";
+          type boolean;
+          default true;
+        }
+
+        leaf start-address {
+          description "Start IP address of the IP-Address range associated with DHCP domain";
+          type inet:ip-address;
+        }
+
+        leaf count {
+          description "Size of the DHCP pool associated with DHCP domain";
+          type uint32;
+        }
+      }
+
+      leaf subnet-prefix-pool {
+        description "VIM Specific reference to pre-created subnet prefix";
+        type string;
+      }
+    }
+  }
+
+  grouping ip-profile-list {
+    list ip-profiles {
+      description
+          "List of IP Profiles.
+             IP Profile describes the IP characteristics for the Virtual-Link";
+    
+      key "name";
+
+      leaf name {
+        description "Name of the IP-Profile";
+        type string;
+      }
+      
+      leaf description {
+        description "Description for IP profile";
+        type string;
+      }
+      
+      uses ip-profile-info;
+    }
+  }
+
+  grouping config-file {
+    description "Grouping for files needed to be mounted into an additional drive";
+    list config-file {
+      description
+          "List of configuration files to be written on an additional drive";
+      key "source";
+      leaf source {
+        description "Name of the configuration file";
+        type string;
+      }
+      leaf dest {
+        description "Full path of the destination in the guest";
+        type string;
+      }
+    }
+  }
+
+  grouping supplemental-boot-data {
+    description "Grouping for custom vim data";
+    container supplemental-boot-data {
+      uses manotypes:config-file;
+      leaf boot-data-drive {
+        description "Some VIMs implement additional drives to host config-files or meta-data";
+        type boolean;
+        default false;
+      } 
+    }
+  }
+
+  grouping volume-info {
+    description "Grouping for Volume-info";
+
+    leaf description {
+      description "Description for Volume";
+      type string;
+    }
+
+    leaf size {
+      description "Size of disk in GB";
+      type uint64;
+    }
+
+    choice volume-source {
+      description
+            "Defines the source of the volume. Possible options are
+             1. Ephemeral -- Empty disk
+             2. Image     -- Refer to image to be used for volume
+             3. Volume    -- Reference of pre-existing volume to be used
+            ";
+
+      case ephemeral {
+        leaf ephemeral {
+          type empty;
+        }
+      }
+
+      case image {
+        uses image-properties;
+      }
+
+    }
+
+    leaf device-bus {
+      description "Type of disk-bus on which this disk is exposed to guest";
+      type enumeration {
+        enum ide;
+        enum usb;
+        enum virtio;
+        enum scsi;
+      }
+    }
+
+    leaf device-type {
+      description "The type of device as exposed to guest";
+      type enumeration {
+          enum disk;
+          enum cdrom;
+          enum floppy;
+          enum lun;
+      }
+    }
+
+  }
+}
diff --git a/models/yang/nsd.yang b/models/yang/nsd.yang
new file mode 100644 (file)
index 0000000..dba3df4
--- /dev/null
@@ -0,0 +1,980 @@
+
+/*
+ *
+ *   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.
+ *
+ *
+ */
+
+module nsd
+{
+  namespace "urn:ietf:params:xml:ns:yang:nfvo:nsd";
+  prefix "nsd";
+
+  import rw-pb-ext {
+    prefix "rwpb";
+  }
+
+  import vnfd {
+    prefix "vnfd";
+  }
+
+  import ietf-inet-types {
+    prefix "inet";
+  }
+
+  import ietf-yang-types {
+    prefix "yang";
+  }
+
+  import mano-types {
+    prefix "manotypes";
+  }
+
+  revision 2014-10-27 {
+    description
+      "Initial revision. This YANG file defines
+       the Network Service Descriptor (NSD)";
+    reference
+      "Derived from earlier versions of base YANG files";
+  }
+
+  typedef scaling-trigger {
+    type enumeration {
+      enum pre-scale-in {
+        value 1;
+      }
+      enum post-scale-in {
+        value 2;
+      }
+      enum pre-scale-out {
+        value 3;
+      }
+      enum post-scale-out {
+        value 4;
+      }
+    }
+  }
+
+  typedef scaling-policy-type {
+    type enumeration {
+      enum manual {
+        value 1;
+      }
+      enum automatic {
+        value 2;
+      }
+    }
+  }
+
+  typedef scaling-criteria-operation {
+    type enumeration {
+      enum AND {
+        value 1;
+      }
+      enum OR {
+        value 2;
+      }
+    }
+  }
+
+  grouping primitive-parameter {
+    leaf name {
+      description
+          "Name of the parameter.";
+      type string;
+    }
+
+    leaf data-type {
+      description
+          "Data type associated with the name.";
+      type manotypes:parameter-data-type;
+    }
+
+    leaf mandatory {
+      description "Is this field mandatory";
+      type boolean;
+      default false;
+    }
+
+    leaf default-value {
+      description "The default value for this field";
+      type string;
+    }
+
+    leaf parameter-pool {
+      description "NSD parameter pool name to use for this parameter";
+      type string;
+    }
+  }
+
+  grouping nsd-descriptor {
+    leaf id {
+      description "Identifier for the NSD.";
+      type string;
+    }
+
+    leaf name {
+      description "NSD name.";
+      mandatory true;
+      type string;
+    }
+
+    leaf short-name {
+      description "Short name to appear as label in the UI";
+      type string;
+    }
+
+    leaf vendor {
+      description "Vendor of the NSD.";
+      type string;
+    }
+
+    leaf logo {
+      description
+        "File path for the vendor-specific logo. For example, icons/mylogo.png.
+         The logo should be part of the network service";
+      type string;
+    }
+
+    leaf description {
+      description "Description of the NSD.";
+      type string;
+    }
+
+    leaf version {
+      description "Version of the NSD";
+      type string;
+    }
+
+    list connection-point {
+      description
+          "List for external connection points.
+          Each network service (NS) has one or more external connection
+          points that connect the NS to other NSs or to external networks.
+          Each NS exposes connection points to the orchestrator, which can
+          construct network service chains by connecting the connection
+          points between different NSs.";
+      key "name";
+      leaf name {
+        description
+            "Name of the NS connection point.";
+        type string;
+      }
+
+      leaf type {
+        description
+            "Type of the connection point.";
+        type manotypes:connection-point-type;
+      }
+    }
+
+    /* Model Limitations,
+       see the comments under vnfd-connection-point-ref
+     */
+    list vld {
+      description
+          "List of Virtual Link Descriptors (VLDs).";
+
+      key "id";
+
+      leaf id {
+        description
+            "Identifier for the VLD.";
+        type string;
+      }
+
+      leaf name {
+        description
+            "Virtual Link Descriptor (VLD) name.";
+        type string;
+      }
+
+      leaf short-name {
+        description
+            "Short name to appear as label in the UI";
+        type string;
+      }
+
+      leaf vendor {
+        description "Provider of the VLD.";
+        type string;
+      }
+
+      leaf description {
+        description "Description of the VLD.";
+        type string;
+      }
+
+      leaf version {
+        description "Version of the VLD";
+        type string;
+      }
+
+      leaf type {
+        type manotypes:virtual-link-type;
+      }
+
+      leaf root-bandwidth {
+        description
+            "For ELAN this is the aggregate bandwidth.";
+        type uint64;
+      }
+
+      leaf leaf-bandwidth {
+        description
+            "For ELAN this is the bandwidth of branches.";
+        type uint64;
+      }
+
+      list vnfd-connection-point-ref {
+        description
+            "A list of references to connection points.";
+        key "member-vnf-index-ref vnfd-connection-point-ref";
+
+        leaf member-vnf-index-ref {
+          description "Reference to member-vnf within constituent-vnfds";
+          type leafref {
+            path "../../../constituent-vnfd/member-vnf-index";
+          }
+        }
+
+        leaf vnfd-id-ref {
+          description
+              "A reference to a VNFD";
+          type leafref {
+            path "../../../constituent-vnfd" +
+                 "[member-vnf-index = current()/../member-vnf-index-ref]" +
+                 "/vnfd-id-ref";
+          }
+        }
+
+        leaf vnfd-connection-point-ref {
+          description "A reference to a connection point name";
+          type leafref {
+            path "/vnfd:vnfd-catalog/vnfd:vnfd" +
+                 "[vnfd:id = current()/../vnfd-id-ref]/" +
+                 "vnfd:connection-point/vnfd:name";
+          }
+        }
+      }
+
+      // replicate for pnfd container here
+      uses manotypes:provider-network;
+
+      leaf mgmt-network {
+         description "Flag indicating whether this network is a VIM management network";
+         type boolean;
+         default false;
+      }
+
+      choice init-params {
+        description "Extra parameters for VLD instantiation";
+
+        case vim-network-ref {
+          leaf vim-network-name {
+            description
+                "Name of network in VIM account. This is used to indicate
+                   pre-provisioned network name in cloud account.";
+            type string;
+          }
+        }
+
+        case vim-network-profile {
+          leaf ip-profile-ref {
+            description "Named reference to IP-profile object";
+            type leafref {
+              path "../../ip-profiles/name";
+            }
+          }
+        }
+      }
+    }
+
+    list constituent-vnfd {
+      description
+          "List of VNFDs that are part of this
+          network service.";
+
+      key "member-vnf-index";
+
+      leaf member-vnf-index {
+        description
+          "Identifier/index for the VNFD. This separate id
+           is required so that multiple VNFs can be part of
+           single NS";
+        type uint64;
+      }
+
+      leaf vnfd-id-ref {
+        description
+          "Identifier for the VNFD.";
+        type leafref {
+          path "/vnfd:vnfd-catalog/vnfd:vnfd/vnfd:id";
+        }
+      }
+
+      leaf start-by-default {
+        description
+          "VNFD is started as part of the NS instantiation";
+        type boolean;
+        default true;
+      }
+    }
+
+    list scaling-group-descriptor {
+      description
+          "Scaling group descriptor within this network service.
+           The scaling group defines a group of VNFs,
+           and the ratio of VNFs in the network service
+           that is used as target for scaling action";
+
+      key "name";
+
+      leaf name {
+        description "Name of this scaling group.";
+        type string;
+      }
+
+      list scaling-policy {
+
+        key "name";
+
+        leaf name {
+          description
+              "Name of the scaling policy";
+          type string;
+        }
+
+        leaf scaling-type {
+          description
+              "Type of scaling";
+          type scaling-policy-type;
+        }
+
+        leaf enabled {
+          description
+            "Specifies if the scaling policy can be applied";
+          type boolean;
+          default true;
+        }
+
+        leaf scale-in-operation-type {
+          description
+              "Operation to be applied to check between scaling criterias to
+               check if the scale in threshold condition has been met.
+               Defaults to AND";
+          type scaling-criteria-operation;
+          default AND;
+        }
+
+        leaf scale-out-operation-type {
+          description
+              "Operation to be applied to check between scaling criterias to
+               check if the scale out threshold condition has been met.
+               Defaults to OR";
+          type scaling-criteria-operation;
+          default OR;
+        }
+
+        leaf threshold-time {
+          description
+            "The duration for which the criteria must hold true";
+          type uint32;
+          mandatory true;
+        }
+
+        leaf cooldown-time {
+          description
+            "The duration after a scaling-in/scaling-out action has been
+            triggered, for which there will be no further scaling activity";
+          type uint32;
+          mandatory true;
+        }
+
+        list scaling-criteria {
+          description
+              "list of conditions to be met for generating scaling
+                 requests";
+          key "name";
+
+          leaf name {
+            description "Name of the scaling criteria";
+            type string;
+          }
+
+          leaf scale-in-threshold {
+            description
+                "Value below which scale-in requests are generated
+                 (depends on monitoring parameters)";
+            type uint64;
+          }
+
+          leaf scale-out-threshold {
+            description
+                "Value above which scale-out requests are generated
+                 (depends on monitoring parameters)";
+            type uint64;
+          }
+
+          leaf ns-monitoring-param-ref {
+            description
+               "Reference to the NS level monitoring parameter
+                that is aggregated";
+            type leafref {
+              path "../../../../monitoring-param/id";
+            }
+          }
+        }
+      }
+
+      list vnfd-member {
+        description "List of VNFs in this scaling group";
+        key "member-vnf-index-ref";
+
+        leaf member-vnf-index-ref {
+          description "Member VNF index of this member VNF";
+          type leafref {
+            path "../../../constituent-vnfd/member-vnf-index";
+          }
+        }
+
+        leaf count {
+          description
+            "Count of this member VNF  within this scaling group.
+             The count defines the number of instances when a
+             scaling action targets this scaling group.";
+          type uint32;
+          default 1;
+        }
+      }
+
+      leaf min-instance-count {
+        description
+          "Minimum number of instances of the scaling group that
+          are allowed in a single network service. These instances
+          are created by default when the network service is
+          instantiated.";
+        type uint32;
+        default 0;
+      }
+
+      leaf max-instance-count {
+        description
+          "Maximum number of instances of this scaling group that
+          are allowed in a single network service. The network
+          service scaling fails when the number of service group
+          instances exceeds the max-instance-count specified.";
+        type uint32;
+        default 10;
+      }
+
+      list scaling-config-action {
+        description "List of scaling config actions";
+        key "trigger";
+
+        leaf trigger {
+          description "Scaling trigger";
+          type scaling-trigger;
+        }
+
+        leaf ns-config-primitive-name-ref {
+          description "Reference to the NS config name primitive";
+          type leafref {
+            path "../../../service-primitive/name";
+          }
+        }
+      }
+    }
+
+    list placement-groups {
+      description "List of placement groups at NS level";
+
+      key "name";
+      uses manotypes:placement-group-info;
+
+      list member-vnfd {
+        description
+            "List of VNFDs that are part of this placement group";
+
+        key "member-vnf-index-ref";
+
+        leaf member-vnf-index-ref {
+          description "Member VNF index of this member VNF";
+          type leafref {
+            path "../../../constituent-vnfd/member-vnf-index";
+          }
+        }
+
+        leaf vnfd-id-ref {
+          description
+              "Identifier for the VNFD.";
+          type leafref {
+            path "../../../constituent-vnfd" +
+                 "[member-vnf-index = current()/../member-vnf-index-ref]" +
+                 "/vnfd-id-ref";
+          }
+        }
+      }
+    }
+
+    uses manotypes:ip-profile-list;
+
+    list vnf-dependency {
+      description
+          "List of VNF dependencies.";
+      key vnf-source-ref;
+      leaf vnf-source-ref {
+        type leafref {
+          path "../../constituent-vnfd/vnfd-id-ref";
+        }
+      }
+      leaf vnf-depends-on-ref {
+        description
+            "Reference to VNF on which the source VNF depends.";
+        type leafref {
+          path "../../constituent-vnfd/vnfd-id-ref";
+        }
+      }
+    }
+
+    list vnffgd {
+      description
+          "List of VNF Forwarding Graph Descriptors (VNFFGD).";
+
+      key "id";
+
+      leaf id {
+        description
+            "Identifier for the VNFFGD.";
+        type string;
+      }
+
+      leaf name {
+        description
+            "VNFFGD name.";
+        type string;
+      }
+
+      leaf short-name {
+        description
+            "Short name to appear as label in the UI";
+        type string;
+      }
+
+      leaf vendor {
+        description "Provider of the VNFFGD.";
+        type string;
+      }
+
+      leaf description {
+        description "Description of the VNFFGD.";
+        type string;
+      }
+
+      leaf version {
+        description "Version of the VNFFGD";
+        type string;
+      }
+
+      list rsp {
+        description
+            "List of Rendered Service Paths (RSP).";
+
+        key "id";
+
+        leaf id {
+          description
+              "Identifier for the RSP.";
+          type string;
+        }
+
+        leaf name {
+          description
+              "RSP name.";
+          type string;
+        }
+
+        list vnfd-connection-point-ref {
+          description
+                "A list of references to connection points.";
+          key "member-vnf-index-ref";
+
+          leaf member-vnf-index-ref {
+            description "Reference to member-vnf within constituent-vnfds";
+            type leafref {
+              path "../../../../constituent-vnfd/member-vnf-index";
+            }
+          }
+
+          leaf order {
+            type uint8;
+            description
+                "A number that denotes the order of a VNF in a chain";
+          }
+
+           leaf vnfd-id-ref {
+             description
+                 "A reference to a vnfd";
+             type leafref {
+                path "../../../../constituent-vnfd" +
+                     "[member-vnf-index = current()/../member-vnf-index-ref]" +
+                     "/vnfd-id-ref";
+             }
+           }
+
+           leaf vnfd-connection-point-ref {
+             description
+                 "A reference to a connection point name";
+             type leafref {
+               path "/vnfd:vnfd-catalog/vnfd:vnfd" +
+                    "[vnfd:id = current()/../vnfd-id-ref]/" +
+                    "vnfd:connection-point/vnfd:name";
+             }
+          }
+        }
+      } //rsp
+
+      list classifier {
+        description
+            "List of classifier rules.";
+
+        key "id";
+
+        leaf id {
+          description
+              "Identifier for the classifier rule.";
+          type string;
+        }
+
+        leaf name {
+          description
+              "Name of the classifier.";
+          type string;
+        }
+
+        leaf rsp-id-ref {
+          description
+              "A reference to the RSP.";
+          type leafref {
+            path "../../rsp/id";
+          }
+        }
+
+        leaf member-vnf-index-ref {
+          description "Reference to member-vnf within constituent-vnfds";
+          type leafref {
+            path "../../../constituent-vnfd/member-vnf-index";
+          }
+        }
+
+        leaf vnfd-id-ref {
+          description
+              "A reference to a VNFD";
+          type leafref {
+              path "../../../constituent-vnfd" +
+                   "[member-vnf-index = current()/../member-vnf-index-ref]" +
+                   "/vnfd-id-ref";
+          }
+        }
+
+        leaf vnfd-connection-point-ref {
+          description
+              "A reference to a connection point name";
+          type leafref {
+              path "/vnfd:vnfd-catalog/vnfd:vnfd" +
+                   "[vnfd:id = current()/../vnfd-id-ref]/" +
+                   "vnfd:connection-point/vnfd:name";
+          }
+        }
+
+        list match-attributes {
+          description
+              "List of match attributes.";
+
+          key "id";
+
+          leaf id {
+            description
+                "Identifier for the classifier match attribute rule.";
+            type string;
+          }
+
+          leaf ip-proto {
+            description
+                "Internet Protocol.";
+            type uint8;
+          }
+
+          leaf source-ip-address {
+            description
+                "Source IP address.";
+            type inet:ip-address;
+          }
+
+          leaf destination-ip-address {
+            description
+                "Destination IP address.";
+            type inet:ip-address;
+          }
+
+          leaf source-port {
+            description
+                "Source port number.";
+            type inet:port-number;
+          }
+
+          leaf destination-port {
+            description
+                "Destination port number.";
+            type inet:port-number;
+          }
+        } //match-attributes
+      } // classifier
+    } // vnffgd
+
+    list monitoring-param {
+      description
+        "List of monitoring parameters from VNFs that should be
+        propogated up into NSR";
+      key "id";
+
+      leaf id {
+        description "Identifier for a monitoring parameter";
+        type string;
+      }
+
+      leaf name {
+        description "Name of the monitoring parameter";
+        type string;
+      }
+
+      uses manotypes:monitoring-param-value;
+      uses manotypes:monitoring-param-ui-data;
+      uses manotypes:monitoring-param-aggregation;
+
+      list vnfd-monitoring-param {
+        description "A list of VNFD monitoring params";
+        key "member-vnf-index-ref vnfd-monitoring-param-ref";
+
+        leaf vnfd-id-ref {
+          description
+             "A reference to a VNFD. This is a leafref";
+
+          type leafref {
+            path "../../../constituent-vnfd" +
+                 "[member-vnf-index = current()/../member-vnf-index-ref]" +
+                 "/vnfd-id-ref";
+          }
+        }
+
+        leaf vnfd-monitoring-param-ref {
+          description "A reference to the VNFD monitoring param";
+          type leafref {
+            path "/vnfd:vnfd-catalog/vnfd:vnfd"
+              + "[vnfd:id = current()/../vnfd-id-ref]"
+              + "/vnfd:monitoring-param/vnfd:id";
+          }
+        }
+
+        leaf member-vnf-index-ref {
+          description
+            "Mandatory reference to member-vnf within constituent-vnfds";
+          type leafref {
+            path "../../../constituent-vnfd/member-vnf-index";
+          }
+        }
+      }
+    }
+
+    uses manotypes:input-parameter-xpath;
+
+    list parameter-pool {
+      description
+         "Pool of parameter values from which to choose during
+         configuration.";
+      key "name";
+
+      leaf name {
+        description
+            "Name of the configuration value pool";
+        type string;
+      }
+
+      container range {
+        description
+            "Create a range of values from which to populate the pool with";
+
+        leaf start-value {
+          description
+              "Generated pool values start at this value";
+          type uint32;
+          mandatory true;
+        }
+
+        leaf end-value {
+          description
+              "Generated pool values stop at this value";
+          type uint32;
+          mandatory true;
+        }
+      }
+    }
+
+    list service-primitive {
+      description
+          "Network service level service primitives.";
+
+      key "name";
+
+      leaf name {
+        description
+            "Name of the service primitive.";
+        type string;
+      }
+
+      list parameter {
+        description
+            "List of parameters for the service primitive.";
+
+        key "name";
+        uses manotypes:primitive-parameter;
+      }
+
+      uses manotypes:ui-primitive-group;
+
+      list vnf-primitive-group {
+        description
+            "List of service primitives grouped by VNF.";
+
+        key "member-vnf-index-ref";
+        leaf member-vnf-index-ref {
+          description
+              "Reference to member-vnf within constituent-vnfds";
+          type leafref {
+             path "../../../constituent-vnfd/member-vnf-index";
+          }
+        }
+
+        leaf vnfd-id-ref {
+          description
+              "A reference to a VNFD. This is a leafref";
+
+          type leafref {
+             path "../../../constituent-vnfd" +
+                "[member-vnf-index = current()/../member-vnf-index-ref]" + "/vnfd-id-ref";
+          }
+        }
+
+        leaf vnfd-name {
+          description
+              "Name of the VNFD";
+          type leafref {
+              path "/vnfd:vnfd-catalog/vnfd:vnfd"
+                    + "[vnfd:id = current()/../vnfd-id-ref]"
+                    + "/vnfd:name";
+          }
+        }
+
+        list primitive {
+          key "index";
+
+          leaf index {
+            description "Index of this primitive";
+            type uint32;
+          }
+
+          leaf name {
+            description "Name of the primitive in the VNF primitive ";
+            type string;
+          }
+        }
+      }
+
+      leaf user-defined-script {
+        description
+            "A user defined script.";
+        type string;
+      }
+    }
+
+    list initial-config-primitive {
+      rwpb:msg-new NsdInitialConfigPrimitive;
+      description
+        "Initial set of configuration primitives for NSD.";
+      key "seq";
+
+      uses manotypes:initial-config;
+    }
+
+    list key-pair {
+      key "name";
+      description "Used to configure the list of public keys to be injected as part
+          of NS instantiation";
+
+      leaf name {
+        description "Name of this key pair";
+        type string;
+      }
+
+      leaf key {
+        description "Key associated with this key pair";
+        type string;
+      }
+    }
+
+    list user {
+      key "name";
+      description "List of users to be added through cloud-config";
+
+      leaf name {
+        description "Name of the user ";
+        type string;
+      }
+
+      leaf user-info {
+        description "The user name's real name";
+        type string;
+      }
+
+      list key-pair {
+        key "name";
+        description "Used to configure the list of public keys to be injected as part
+            of NS instantiation";
+
+        leaf name {
+          description "Name of this key pair";
+          type string;
+        }
+
+        leaf key {
+          description "Key associated with this key pair";
+          type string;
+        }
+      }
+    }
+  }
+
+
+  container nsd-catalog {
+
+    list nsd {
+      key "id";
+
+      uses nsd-descriptor;
+    }
+  }
+
+}
diff --git a/models/yang/pnfd.yang b/models/yang/pnfd.yang
new file mode 100644 (file)
index 0000000..2f9bcdf
--- /dev/null
@@ -0,0 +1,104 @@
+
+/*
+ * 
+ *   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.
+ *
+ *
+ */
+
+module pnfd
+{
+  namespace "urn:ietf:params:xml:ns:yang:nfvo:pnfd";
+  prefix "pnfd";
+
+  import rw-pb-ext {
+    prefix "rwpb";
+  }
+
+  import ietf-inet-types {
+    prefix "inet";
+  }
+
+  import ietf-yang-types {
+    prefix "yang";
+  }
+
+  import mano-types {
+    prefix "manotypes";
+  }
+
+  revision 2015-09-10 {
+    description
+      "Initial revision. This YANG file defines 
+       the Physical Network Function Descriptor (PNFD)";
+    reference
+      "Derived from earlier versions of base YANG files";
+  }
+
+  container pnfd-catalog {
+
+    list pnfd {
+      key "id";
+
+      leaf id {
+        description "Identifier for the PNFD.";
+        type yang:uuid;
+      }
+
+      leaf name {
+        description "PNFD name.";
+        type string;
+      }
+
+      leaf short-name {
+        description "Short name to appear as label in the UI";
+        type string;
+      }
+
+      leaf vendor {
+        description "Vendor of the PNFD.";
+        type string;
+      }
+
+      leaf description {
+        description "Description of the PNFD.";
+        type string;
+      }
+
+      leaf version {
+        description "Version of the PNFD";
+        type string;
+      }
+
+      list connection-point {
+        description
+            "List for external connection points. Each PNF has one or more external
+            connection points.";
+        key "id";
+        leaf id {
+          description
+              "Identifier for the external connection points";
+          type uint64;
+        }
+
+        leaf cp-type {
+          description
+              "Type of the connection point.";
+          type manotypes:connection-point-type;
+        }
+      }
+    }
+  }
+}
diff --git a/models/yang/vnfd.yang b/models/yang/vnfd.yang
new file mode 100644 (file)
index 0000000..51bb9f7
--- /dev/null
@@ -0,0 +1,537 @@
+
+/*
+ *
+ *   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.
+ *
+ *
+ */
+
+module vnfd
+{
+  namespace "urn:ietf:params:xml:ns:yang:nfvo:vnfd";
+  prefix "vnfd";
+
+  import mano-types {
+    prefix "manotypes";
+  }
+
+  import rw-pb-ext {
+    prefix "rwpb";
+  }
+
+  import ietf-yang-types {
+    prefix "yang";
+  }
+
+  import ietf-inet-types {
+    prefix "inet";
+  }
+
+  revision 2015-09-10 {
+    description
+      "Initial revision. This YANG file defines
+       the Virtual Network Function (VNF)";
+    reference
+      "Derived from earlier versions of base YANG files";
+  }
+
+  grouping common-connection-point {
+    leaf name {
+      description "Name of the connection point";
+      type string;
+    }
+
+    leaf id {
+      description "Identifier for the internal connection points";
+      type string;
+    }
+
+    leaf short-name {
+      description "Short name to appear as label in the UI";
+      type string;
+    }
+
+    leaf type {
+      description "Type of the connection point.";
+      type manotypes:connection-point-type;
+    }
+    leaf port-security-enabled {
+      description "Enables the port security for the port";
+      type boolean;
+    }
+  }
+
+  grouping virtual-interface {
+    container virtual-interface {
+      description
+          "Container for the virtual interface properties";
+
+      leaf type {
+        description
+            "Specifies the type of virtual interface
+             between VM and host.
+             VIRTIO          : Use the traditional VIRTIO interface.
+             PCI-PASSTHROUGH : Use PCI-PASSTHROUGH interface.
+             SR-IOV          : Use SR-IOV interface.
+             E1000           : Emulate E1000 interface.
+             RTL8139         : Emulate RTL8139 interface.
+             PCNET           : Emulate PCNET interface.
+             OM-MGMT         : Used to specify openmano mgmt external-connection type";
+
+        type enumeration {
+          enum OM-MGMT;
+          enum PCI-PASSTHROUGH;
+          enum SR-IOV;
+          enum VIRTIO;
+          enum E1000;
+          enum RTL8139;
+          enum PCNET;
+        }
+        default "VIRTIO";
+      }
+
+      leaf vpci {
+        description
+            "Specifies the virtual PCI address. Expressed in
+             the following format dddd:dd:dd.d. For example
+             0000:00:12.0. This information can be used to
+             pass as metadata during the VM creation.";
+        type string;
+      }
+
+      leaf bandwidth {
+        description
+            "Aggregate bandwidth of the NIC.";
+        type uint64;
+      }
+    }
+  }
+
+  grouping vnfd-descriptor {
+      leaf id {
+        description "Identifier for the VNFD.";
+        type string;
+      }
+
+      leaf name {
+        description "VNFD name.";
+        mandatory true;
+        type string;
+      }
+
+      leaf short-name {
+        description "Short name to appear as label in the UI";
+        type string;
+      }
+
+      leaf vendor {
+        description "Vendor of the VNFD.";
+        type string;
+      }
+
+      leaf logo {
+        description
+            "Vendor logo for the Virtual Network Function";
+        type string;
+      }
+
+      leaf description {
+        description "Description of the VNFD.";
+        type string;
+      }
+
+      leaf version {
+        description "Version of the VNFD";
+        type string;
+      }
+
+      uses manotypes:vnf-configuration;
+
+      container mgmt-interface {
+        description
+            "Interface over which the VNF is managed.";
+
+        choice endpoint-type {
+          description
+              "Indicates the type of management endpoint.";
+
+          case ip {
+            description
+                "Specifies the static IP address for managing the VNF.";
+            leaf ip-address {
+              type inet:ip-address;
+            }
+          }
+
+          case vdu-id {
+            description
+                "Use the default management interface on this VDU.";
+            leaf vdu-id {
+              type leafref {
+                path "../../vdu/id";
+              }
+            }
+          }
+
+          case cp {
+            description
+                "Use the ip address associated with this connection point.";
+            leaf cp {
+              type leafref {
+                path "../../connection-point/name";
+              }
+            }
+          }
+        }
+
+        leaf port {
+          description
+              "Port for the management interface.";
+          type inet:port-number;
+        }
+
+        container dashboard-params {
+          description "Parameters for the VNF dashboard";
+
+          leaf path {
+            description "The HTTP path for the dashboard";
+            type string;
+          }
+
+          leaf https {
+            description "Pick HTTPS instead of HTTP , Default is false";
+            type boolean;
+          }
+
+          leaf port {
+            description "The HTTP port for the dashboard";
+            type inet:port-number;
+          }
+        }
+      }
+
+      list internal-vld {
+        key "id";
+        description
+            "List of Internal Virtual Link Descriptors (VLD).
+            The internal VLD describes the basic topology of
+            the connectivity such as E-LAN, E-Line, E-Tree.
+            between internal VNF components of the system.";
+
+        leaf id {
+          description "Identifier for the VLD";
+          type string;
+        }
+
+        leaf name {
+          description "Name of the internal VLD";
+          type string;
+        }
+
+        leaf short-name {
+          description "Short name to appear as label in the UI";
+          type string;
+        }
+
+        leaf description {
+          description "Description of internal VLD.";
+          type string;
+        }
+
+        leaf type {
+          type manotypes:virtual-link-type;
+        }
+
+        leaf root-bandwidth {
+          description
+              "For ELAN this is the aggregate bandwidth.";
+          type uint64;
+        }
+
+        leaf leaf-bandwidth {
+          description
+              "For ELAN this is the bandwidth of branches.";
+          type uint64;
+        }
+
+        list internal-connection-point {
+          key "id-ref";
+          description "List of internal connection points in this VLD";
+          leaf id-ref {
+            description "reference to the internal connection point id";
+            type leafref {
+              path "../../../vdu/internal-connection-point/id";
+            }
+          }
+        }
+        uses manotypes:provider-network;
+        choice init-params {
+          description "Extra parameters for VLD instantiation";
+
+          case vim-network-ref {
+            leaf vim-network-name {
+              description
+                  "Name of network in VIM account. This is used to indicate
+                    pre-provisioned network name in cloud account.";
+              type string;
+            }
+          }
+
+          case vim-network-profile {
+            leaf ip-profile-ref {
+              description "Named reference to IP-profile object";
+              type leafref {
+                path "../../ip-profiles/name";
+              }
+            }
+          }
+        }
+      }
+
+      uses manotypes:ip-profile-list;
+
+      list connection-point {
+        key "name";
+        description
+            "List for external connection points. Each VNF has one
+            or more external connection points that connect the VNF
+            to other VNFs or to external networks. Each VNF exposes
+            connection points to the orchestrator, which can construct
+            network services by connecting the connection points
+            between different VNFs. The NFVO will use VLDs and VNFFGs
+            at the network service level to construct network services.";
+
+        uses common-connection-point;
+      }
+
+      list vdu {
+        description "List of Virtual Deployment Units";
+        key "id";
+
+        leaf id {
+          description "Unique id for the VDU";
+          type string;
+        }
+
+        leaf name {
+          description "Unique name for the VDU";
+          type string;
+        }
+
+        leaf description {
+            description "Description of the VDU.";
+            type string;
+        }
+
+        leaf count {
+          description "Number of instances of VDU";
+          type uint64;
+        }
+
+        leaf mgmt-vpci {
+          description
+              "Specifies the virtual PCI address. Expressed in
+             the following format dddd:dd:dd.d. For example
+             0000:00:12.0. This information can be used to
+             pass as metadata during the VM creation.";
+          type string;
+        }
+
+        uses manotypes:vm-flavor;
+        uses manotypes:guest-epa;
+        uses manotypes:vswitch-epa;
+        uses manotypes:hypervisor-epa;
+        uses manotypes:host-epa;
+
+        list alarm {
+          key "alarm-id";
+
+          uses manotypes:alarm;
+        }
+
+        uses manotypes:image-properties;
+
+        choice cloud-init-input {
+          description
+              "Indicates how the contents of cloud-init script are provided.
+              There are 2 choices - inline or in a file";
+
+          case inline {
+            leaf cloud-init {
+              description
+                  "Contents of cloud-init script, provided inline, in cloud-config format";
+              type string;
+            }
+          }
+
+          case filename {
+            leaf cloud-init-file {
+              description
+                  "Name of file with contents of cloud-init script in cloud-config format";
+              type string;
+            }
+          }
+        }
+
+        uses manotypes:supplemental-boot-data;
+
+        list internal-connection-point {
+          key "id";
+          description
+              "List for internal connection points. Each VNFC
+              has zero or more internal connection points.
+              Internal connection points are used for connecting
+              the VNF with components internal to the VNF. If a VNF
+              has only one VNFC, it may not have any internal
+              connection points.";
+
+          uses common-connection-point;
+        }
+
+        list internal-interface {
+          description
+              "List of internal interfaces for the VNF";
+          key name;
+
+          leaf name {
+            description
+                "Name of internal interface. Note that this
+                name has only local significance to the VDU.";
+            type string;
+          }
+
+          leaf vdu-internal-connection-point-ref {
+            type leafref {
+              path "../../internal-connection-point/id";
+            }
+          }
+          uses virtual-interface;
+        }
+
+        list external-interface {
+          description
+              "List of external interfaces for the VNF.
+              The external interfaces enable sending
+              traffic to and from VNF.";
+          key name;
+
+          leaf name {
+            description
+                "Name of the external interface. Note that
+                this name has only local significance to
+                the VDU.";
+            type string;
+          }
+
+          leaf vnfd-connection-point-ref {
+            description
+              "Name of the external connection point.";
+            type leafref {
+              path "../../../connection-point/name";
+            }
+          }
+          uses virtual-interface;
+        }
+
+        list volumes {
+          key "name";
+
+          leaf name {
+            description "Name of the disk-volumes, e.g. vda, vdb etc";
+            type string;
+          }
+
+          uses manotypes:volume-info;
+        }
+      }
+
+      list vdu-dependency {
+        description
+            "List of VDU dependencies.";
+
+        key vdu-source-ref;
+        leaf vdu-source-ref {
+          type leafref {
+            path "../../vdu/id";
+          }
+        }
+
+        leaf vdu-depends-on-ref {
+          description
+              "Reference to the VDU on which
+              the source VDU depends.";
+          type leafref {
+            path "../../vdu/id";
+          }
+        }
+      }
+
+      leaf service-function-chain {
+        description "Type of node in Service Function Chaining Architecture";
+
+        type enumeration {
+          enum UNAWARE;
+          enum CLASSIFIER;
+          enum SF;
+          enum SFF;
+        }
+        default "UNAWARE";
+      }
+
+      leaf service-function-type {
+        description
+            "Type of Service Function.
+             NOTE: This needs to map with Service Function Type in ODL to
+             support VNFFG. Service Function Type is mandatory param in ODL
+             SFC. This is temporarily set to string for ease of use";
+            type string;
+      }
+
+      uses manotypes:monitoring-param;
+
+      list placement-groups {
+        description "List of placement groups at VNF level";
+
+        key "name";
+        uses manotypes:placement-group-info;
+
+        list member-vdus {
+
+          description
+              "List of VDUs that are part of this placement group";
+          key "member-vdu-ref";
+
+          leaf member-vdu-ref {
+            type leafref {
+              path "../../../vdu/id";
+            }
+          }
+        }
+      }
+  }
+
+  container vnfd-catalog {
+    description
+        "Virtual Network Function Descriptor (VNFD).";
+
+    list vnfd {
+      key "id";
+
+      uses vnfd-descriptor;
+     }
+  }
+}
+
+// vim: sw=2