Rift.IO OSM R1 Initial Submission
[osm/UI.git] / skyquake / plugins / composer / src / schemas / yang / rw-nsr.yang.src
diff --git a/skyquake/plugins/composer/src/schemas/yang/rw-nsr.yang.src b/skyquake/plugins/composer/src/schemas/yang/rw-nsr.yang.src
new file mode 100755 (executable)
index 0000000..d259300
--- /dev/null
@@ -0,0 +1,306 @@
+
+/*
+ * 
+ *   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 rw-nsr
+{
+  namespace "http://riftio.com/ns/riftware-1.0/rw-nsr";
+  prefix "rw-nsr";
+
+  import mano-types {
+    prefix "manotypes";
+  }
+
+  import nsr {
+    prefix "nsr";
+  }
+
+  import nsd {
+    prefix "nsd";
+  }
+
+  import rw-cloud {
+    prefix "rw-cloud";
+  }
+
+  import ietf-yang-types {
+    prefix "yang";
+  }
+
+  revision 2015-09-10 {
+    description
+      "Initial revision. This YANG file augments
+       the base MANO VNFD";
+    reference
+      "Derived from earlier versions of base YANG files";
+  }
+
+  grouping operational-events {
+    list operational-events {
+      key "id";
+      description
+        "Recent operational events for this network service.
+        Though the model does not impose any restrictions on the numbe of events, 
+        the max operational events will be limited to the most recent 10"; 
+
+      leaf id {
+        description "The id of the instance";
+        type uint64;
+      }
+
+      leaf timestamp {
+        description
+          "The timestamp of this event expressed as seconds since
+          unix epoch - 1970-01-01T00:00:00Z";
+        type uint32;
+      }
+      leaf event {
+        description "Short description of the event";
+        type string;
+      }
+      leaf description {
+        description
+          "The description of this event";
+        type string;
+      }
+    }
+  }
+
+  grouping nsd-ref-count {
+    list nsd-ref-count {
+      key "nsd-id-ref";
+      description "This table maintains the number of NSRs used by each NSD";
+
+      leaf nsd-id-ref {
+        description "Reference to NSD";
+        type leafref {
+          path "/nsd:nsd-catalog/nsd:nsd/nsd:id";
+        }
+      }
+      leaf instance-ref-count {
+        description
+          "Reference count for the number of NSRs refering this NSD.
+           Every NS record instantiated using this descriptor takes
+           a reference on the NSD and releases the reference when the
+           network service is terminated. This desciptor cannot be
+           deleted when this counter is non zero";
+        type uint64;
+      }
+    }
+  }
+
+  augment /nsr:ns-instance-config/nsr:nsr {
+    leaf cloud-account {
+      description
+        "The configured cloud account which the NSR is instantiated within.
+         All VDU's, Virtual Links, and provider networks will be requested
+         using the cloud-account's associated CAL instance";
+      type leafref {
+        path "/rw-cloud:cloud/rw-cloud:account/rw-cloud:name";
+      }
+    }
+
+    leaf om-datacenter {
+      description
+        "Openmano datacenter name to use when instantiating
+         the network service.  This is only used when openmano
+         is selected as the cloud account.  This should be superceded
+         by multiple cloud accounts when that becomes available.";
+      type string;
+    }
+  }
+
+  augment /nsr:ns-instance-opdata/nsr:nsr {
+    uses manotypes:action-param;
+    uses manotypes:control-param;
+
+    leaf cloud-account {
+      description
+        "The configured cloud account which the NSR is instantiated within.
+         All VDU's, Virtual Links, and provider networks will be requested
+         using the cloud-account's associated CAL instance";
+      type leafref {
+        path "/rw-cloud:cloud/rw-cloud:account/rw-cloud:name";
+      }
+    }
+
+    container nfvi-metrics {
+      container vm {
+        leaf label {
+          description
+            "Label to show in UI";
+          type string;
+          default "VM";
+        }
+
+        leaf active-vm {
+          description
+            "The number of active VMs.";
+          type uint64;
+        }
+
+        leaf inactive-vm {
+          description
+            "The number of inactive VMs.";
+          type uint64;
+        }
+      }
+
+      uses manotypes:nfvi-metrics;
+    }
+
+    container epa-param {
+      container ovs-acceleration {
+        leaf label {
+          description
+            "Label to show in UI for the param";
+          type string;
+          default "OVS ACCELERATION";
+        }
+
+        leaf vm {
+          description
+            "Number of VMs with the EPA attribute";
+          type uint64;
+        }
+
+        leaf unit {
+          description
+            "Unit label to show in the UI";
+          type string;
+          default "vms";
+        }
+      }
+
+      container ovs-offload {
+        leaf label {
+          description
+            "Label to show in UI for the param";
+          type string;
+          default "OVS OFFLOAD";
+        }
+
+        leaf vm {
+          description
+            "Number of VMs with the EPA attribute";
+          type uint64;
+        }
+
+        leaf unit {
+          description
+            "Unit label to show in the UI";
+          type string;
+          default "vms";
+        }
+
+      }
+
+      container ddio {
+        leaf label {
+          description
+            "Label to show in UI for the param";
+          type string;
+          default "DDIO";
+        }
+
+        leaf vm {
+          description
+            "Number of VMs with the EPA attribute";
+          type uint64;
+        }
+
+        leaf unit {
+          description
+            "Unit label to show in the UI";
+          type string;
+          default "vms";
+        }
+
+      }
+
+      container cat {
+        leaf label {
+          description
+            "Label to show in UI for the param";
+          type string;
+          default "CAT";
+        }
+
+        leaf vm {
+          description
+            "Number of VMs with the EPA attribute";
+          type uint64;
+        }
+
+        leaf unit {
+          description
+            "Unit label to show in the UI";
+          type string;
+          default "vms";
+        }
+      }
+
+      container cmt {
+        leaf label {
+          description
+            "Label to show in UI for the param";
+          type string;
+          default "CMT";
+        }
+
+        leaf vm {
+          description
+            "Number of VMs with the EPA attribute";
+          type uint64;
+        }
+
+        leaf unit {
+          description
+            "Unit label to show in the UI";
+          type string;
+          default "vms";
+        }
+
+      }
+    }
+    uses operational-events;
+  }
+
+  augment /nsr:ns-instance-opdata {
+    uses nsd-ref-count;
+  }
+
+  augment /nsr:ns-instance-opdata/nsr:nsr/nsr:vlr {
+    leaf assigned-subnet {
+      description "Subnet added for the VL";
+      type string;
+    }
+  }
+
+  augment /nsr:ns-instance-config {
+    leaf nfvi-polling-period {
+      description
+        "Defines the period (secons) that the NFVI metrics are polled at";
+      type uint64;
+      default 4;
+    }
+  }
+}
+
+// vim: sw=2