--- /dev/null
+
+/*
+ *
+ * Copyright 2017 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-base
+{
+ namespace "http://riftio.com/ns/riftware-1.0/vnfd-base";
+ prefix "vnfd-base";
+
+ import mano-types {
+ prefix "manotypes";
+ }
+
+ import ietf-inet-types {
+ prefix "inet";
+ }
+
+ revision 2017-02-28 {
+ description
+ "Initial revision. This YANG file defines
+ the common types for Virtual Network Function
+ (VNF) descriptor";
+ 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;
+ }
+ }
+
+ typedef interface-type {
+ type enumeration {
+ enum INTERNAL;
+ enum EXTERNAL;
+ }
+ }
+
+ 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 {
+ length "1..63";
+ }
+ }
+
+ 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:vca-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 {
+ 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 string;
+ }
+ }
+
+ }
+ }
+
+ 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;
+
+ leaf internal-vld-ref {
+ type leafref {
+ path "../../../internal-vld/id";
+ }
+ }
+ }
+
+ list interface {
+ description
+ "List of Interfaces (external and internal) for the VNF";
+ key name;
+
+ leaf name {
+ description
+ "Name of the interface. Note that this
+ name has only local significance to the VDU.";
+ type string;
+ }
+
+ leaf position {
+ description
+ "Explicit Position of the interface within the list";
+ type uint32;
+ }
+
+ leaf type {
+ description
+ "Type of the Interface";
+ type interface-type;
+
+ default "EXTERNAL";
+ }
+
+ choice connection-point-type {
+ case internal {
+ leaf internal-connection-point-ref {
+ description
+ "Leaf Ref to the particular internal connection point";
+ type leafref {
+ path "../../internal-connection-point/id";
+ }
+ }
+ }
+ case external {
+ leaf external-connection-point-ref {
+ description
+ "Leaf Ref to the particular 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";
+ }
+ }
+ }
+ }
+ }
+}
+
+// vim: sw=2