New feature: Code changes for project support
[osm/SO.git] / models / plugins / yang / mano-types.yang
index c3ea698..89fbca0 100644 (file)
@@ -1,7 +1,7 @@
 
 /*
  * 
- *   Copyright 2016 RIFT.IO Inc
+ *   Copyright 2016-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.
@@ -31,6 +31,15 @@ module mano-types
     prefix "rwpb";
   }
 
+  import rw-project {
+    prefix "rw-project";
+  }
+
+  revision 2017-02-08 {
+    description
+      "Update model to support projects.";
+  }
+
   revision 2015-04-23 {
     description
       "Initial revision. This YANG file defines
@@ -40,6 +49,14 @@ module mano-types
       "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;
@@ -133,6 +150,37 @@ module mano-types
       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 {
+        type string;
+      }
+    }
+  }
 
   grouping vnf-configuration {
     container vnf-configuration {
@@ -282,30 +330,9 @@ module mano-types
       list initial-config-primitive {
         rwpb:msg-new InitialConfigPrimitive;
         description
-            "Initial set of configuration primitives.";
+          "Initial set of configuration primitives.";
         key "seq";
-        leaf seq {
-          description
-              "Sequence number for the configuration primitive.";
-          type uint64;
-        }
-
-        leaf name {
-          description 
-              "Name of the configuration primitive.";
-          type string;
-        }
-
-        list parameter {
-          key "name";
-          leaf name {
-            type string;
-          }
-
-          leaf value {
-            type string;
-          }
-        }
+        uses initial-config;
       }
 
       leaf config-template {
@@ -1173,9 +1200,11 @@ module mano-types
       }
 
       leaf http-endpoint-ref {
-        type leafref {
-          path "../../http-endpoint/path";
-        }
+        // TODO (Philip): Fix this
+        // type leafref {
+        //   path "../../http-endpoint/path";
+        // }
+        type string;
       }
 
       leaf json-query-method {
@@ -2025,6 +2054,35 @@ module mano-types
     }
   }
 
+  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";
 
@@ -2056,46 +2114,37 @@ module mano-types
         uses image-properties;
       }
 
-      case volume {
-        leaf volume-ref {
-          description "Reference for pre-existing volume in VIM";
-          type string;
-        }
-      }
     }
 
-    container boot-params {
-      leaf boot-volume {
-        description "This flag indicates if this is boot volume or not";
-        type boolean;
-      }
-      leaf boot-priority {
-        description "Boot priority associated with volume";
-        type int32;
+    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;
       }
     }
 
-    container guest-params {
-      description "Guest virtualization parameter associated with volume";
-
-      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 {
+    leaf device_type {
+      description "The type of device as exposed to guest";
+      type enumeration {
           enum disk;
           enum cdrom;
           enum floppy;
           enum lun;
-        }
+      }
+    }
+
+  }
+
+  grouping rpc-project-name {
+    leaf project-name {
+      mandatory true;
+      description
+        "Project to which this belongs";
+      type leafref {
+        path "/rw-project:project/rw-project:name";
       }
     }
   }