Merge from OSM SO master
[osm/SO.git] / rwcal / plugins / yang / rwcal.yang
index 53caade..dcd653e 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.
@@ -43,6 +43,15 @@ module rwcal
     prefix "manotypes";
   }
 
+  import rw-project {
+    prefix "rw-project";
+  }
+
+  revision 2017-02-08 {
+    description
+      "Update model to support projects.";
+  }
+
   revision 2014-12-30 {
     description
         "Initial revision.";
@@ -100,62 +109,6 @@ module rwcal
 
   uses connection-status;
 
-  typedef sdn-account-type {
-    description "SDN account type";
-    type enumeration {
-      enum odl;
-      enum mock;
-      enum sdnsim;
-    }
-  }
-
-  grouping sdn-provider-auth {
-    leaf account-type {
-      type sdn-account-type;
-    }
-
-    choice provider-specific-info {
-      container odl {
-        leaf username {
-          type string {
-            length "1..255";
-          }
-        }
-
-        leaf password {
-          type string {
-            length "1..32";
-          }
-        }
-
-        leaf url {
-          type string {
-            length "1..255";
-          }
-        }
-      }
-      container mock {
-        leaf username {
-          type string;
-        }
-        leaf plugin-name {
-          type string;
-          default "rwsdn_mock";
-        }
-      }
-
-      container sdnsim {
-        leaf username {
-          type string;
-        }
-        leaf plugin-name {
-          type string;
-          default "rwsdn_sim";
-        }
-      }
-    }
-  }
-
   grouping provider-auth {
     leaf account-type {
       type manotypes:cloud-account-type;
@@ -231,11 +184,27 @@ module rwcal
           mandatory true;
         }
 
+        leaf user-domain {
+          type string;
+          default "Default";
+          description "Domain of the OpenStack user";
+        }
+        leaf project-domain {
+          type string;
+          default "Default";
+          description "Domain of the OpenStack project";
+        }
+
         leaf tenant {
           type string;
           mandatory true;
         }
 
+        leaf region {
+          type string;
+          default "RegionOne";
+        }
+        
         leaf admin {
           type boolean;
           default false;
@@ -679,149 +648,153 @@ module rwcal
     }
   }
 
-  container cloud-accounts {
-    list cloud-account-list {
-      rwpb:msg-new CloudAccount;
-      key "name";
+  augment "/rw-project:project" {
+    container cloud-accounts {
+      list cloud-account-list {
+        rwpb:msg-new CloudAccount;
+        key "name";
 
-      leaf name {
-        type string;
+        leaf name {
+          type string;
+        }
+        uses provider-auth;
       }
-      uses provider-auth;
     }
   }
 
-  container vim-resources {
-    rwpb:msg-new VimResources;
-    config false;
-
-    list vminfo-list {
-      rwpb:msg-new VMInfoItem;
+  augment "/rw-project:project" {
+    container vim-resources {
+      rwpb:msg-new VimResources;
       config false;
-      key "vm-id";
-
-      uses vm-info-item;
-    }
 
-    list imageinfo-list {
-      rwpb:msg-new ImageInfoItem;
-      config false;
-      key "id";
+      list vminfo-list {
+        rwpb:msg-new VMInfoItem;
+        config false;
+        key "vm-id";
 
-      uses image-info-item;
-    }
+        uses vm-info-item;
+      }
 
-    list tenantinfo-list {
-      rwpb:msg-new TenantInfoItem;
-      config false;
-      key "tenant-id";
+      list imageinfo-list {
+        rwpb:msg-new ImageInfoItem;
+        config false;
+        key "id";
 
-      leaf tenant-name {
-        rwpb:field-inline "true";
-        rwpb:field-string-max 64;
-        type string;
+        uses image-info-item;
       }
 
-      leaf tenant-id {
-        rwpb:field-inline "true";
-        rwpb:field-string-max 64;
-        type string;
-      }
-    }
+      list tenantinfo-list {
+        rwpb:msg-new TenantInfoItem;
+        config false;
+        key "tenant-id";
 
-    list userinfo-list {
-      rwpb:msg-new UserInfoItem;
-      config false;
-      key "user-id";
+        leaf tenant-name {
+          rwpb:field-inline "true";
+          rwpb:field-string-max 64;
+          type string;
+        }
 
-      leaf user-name{
-        rwpb:field-inline "true";
-        rwpb:field-string-max 64;
-        type string;
+        leaf tenant-id {
+          rwpb:field-inline "true";
+          rwpb:field-string-max 64;
+          type string;
+        }
       }
 
-      leaf user-id {
-        rwpb:field-inline "true";
-        rwpb:field-string-max 64;
-        type string;
-      }
-    }
+      list userinfo-list {
+        rwpb:msg-new UserInfoItem;
+        config false;
+        key "user-id";
 
-    list roleinfo-list {
-      rwpb:msg-new RoleInfoItem;
-      config false;
-      key "role-id";
+        leaf user-name{
+          rwpb:field-inline "true";
+          rwpb:field-string-max 64;
+          type string;
+        }
 
-      leaf role-name {
-        rwpb:field-inline "true";
-        rwpb:field-string-max 64;
-        type string;
+        leaf user-id {
+          rwpb:field-inline "true";
+          rwpb:field-string-max 64;
+          type string;
+        }
       }
 
-      leaf role-id {
-        rwpb:field-inline "true";
-        rwpb:field-string-max 64;
-        type string;
-      }
-    }
+      list roleinfo-list {
+        rwpb:msg-new RoleInfoItem;
+        config false;
+        key "role-id";
 
-    list hostinfo-list {
-      rwpb:msg-new HostInfoItem;
-      config false;
-      key "host-id";
+        leaf role-name {
+          rwpb:field-inline "true";
+          rwpb:field-string-max 64;
+          type string;
+        }
 
-      leaf host-name {
-        rwpb:field-inline "true";
-        rwpb:field-string-max 64;
-        type string;
+        leaf role-id {
+          rwpb:field-inline "true";
+          rwpb:field-string-max 64;
+          type string;
+        }
       }
 
-      leaf host-id {
-        rwpb:field-inline "true";
-        rwpb:field-string-max 64;
-        type string;
-      }
-    }
+      list hostinfo-list {
+        rwpb:msg-new HostInfoItem;
+        config false;
+        key "host-id";
 
-    list networkinfo-list {
-      rwpb:msg-new NetworkInfoItem;
-      config false;
-      key "network-id";
+        leaf host-name {
+          rwpb:field-inline "true";
+          rwpb:field-string-max 64;
+          type string;
+        }
 
-      uses network-info-item;
-    }
+        leaf host-id {
+          rwpb:field-inline "true";
+          rwpb:field-string-max 64;
+          type string;
+        }
+      }
 
-    list portinfo-list {
-      rwpb:msg-new PortInfoItem;
-      config false;
-      key "port-id";
+      list networkinfo-list {
+        rwpb:msg-new NetworkInfoItem;
+        config false;
+        key "network-id";
 
-      uses port-info-item;
-    }
+        uses network-info-item;
+      }
 
-    list flavorinfo-list {
-      rwpb:msg-new FlavorInfoItem;
-      config false;
-      key "id";
+      list portinfo-list {
+        rwpb:msg-new PortInfoItem;
+        config false;
+        key "port-id";
 
-      leaf id {
-        rwpb:field-inline "true";
-        rwpb:field-string-max 64;
-        type string;
+        uses port-info-item;
       }
 
-      leaf name {
-        rwpb:field-inline "true";
-        rwpb:field-string-max 255;
-        type string;
-      }
+      list flavorinfo-list {
+        rwpb:msg-new FlavorInfoItem;
+        config false;
+        key "id";
+
+        leaf id {
+          rwpb:field-inline "true";
+          rwpb:field-string-max 64;
+          type string;
+        }
 
-      uses manotypes:vm-flavor;
-      uses manotypes:guest-epa;
-      uses manotypes:vswitch-epa;
-      uses manotypes:hypervisor-epa;
-      uses manotypes:host-epa;
-      uses manotypes:placement-group-input;
+        leaf name {
+          rwpb:field-inline "true";
+          rwpb:field-string-max 255;
+          type string;
+        }
+
+        uses manotypes:vm-flavor;
+        uses manotypes:guest-epa;
+        uses manotypes:vswitch-epa;
+        uses manotypes:hypervisor-epa;
+        uses manotypes:host-epa;
+        uses manotypes:placement-group-input;
+      }
     }
   }
 
@@ -854,24 +827,31 @@ module rwcal
   }
 
 
-  container virtual-link-req-params {
-    description "This object defines the parameters required to create a virtual-link";
-    rwpb:msg-new VirtualLinkReqParams;
-    uses virtual-link-create-params;
+  augment "/rw-project:project" {
+    container virtual-link-req-params {
+      description "This object defines the parameters required to create a virtual-link";
+      rwpb:msg-new VirtualLinkReqParams;
+      uses virtual-link-create-params;
+    }
   }
 
-
   grouping connection-point-type {
     leaf type {
       description
           "Specifies the type of connection point
              VIRTIO          : Use the traditional VIRTIO interface.
              PCI-PASSTHROUGH : Use PCI-PASSTHROUGH interface.
-             SR-IOV          : Use SR-IOV interface.";
+             SR-IOV          : Use SR-IOV interface.
+             E1000           : Emulate E1000 interface.
+             RTL8139         : Emulate RTL8139 interface.
+             PCNET           : Emulate PCNET interface.";
       type enumeration {
         enum VIRTIO;
         enum PCI-PASSTHROUGH;
         enum SR-IOV;
+        enum E1000;
+        enum RTL8139;
+        enum PCNET;
       }
       default "VIRTIO";
     }
@@ -965,10 +945,21 @@ module rwcal
         description "Name of the security group";
         type string;
       }
+      leaf port-security-enabled {
+        description "Enables the port security";
+        type boolean;
+      }
 
       uses connection-point-type;
     }
 
+    leaf mgmt-network {
+      description 
+          "Explicit mgmt-network name, otherwise the mgmt-network from
+           Cloud account is used";
+      type string;
+    }
+
     leaf allocate-public-address {
       description "If this VDU needs public IP address";
       type boolean;
@@ -985,57 +976,77 @@ module rwcal
         type string;
       }
     }
-  }
+    uses manotypes:supplemental-boot-data;
 
-  container vdu-init-params {
-    description "This object defines the parameters required to create a VDU";
-    rwpb:msg-new VDUInitParams;
-    uses vdu-create-params;
-  }
+    list volumes {
+      key "name";
 
-  container vdu-modify-params {
-    description "This object defines the parameters required to modify VDU";
-    rwpb:msg-new VDUModifyParams;
+      leaf name {
+        description "Name of the disk-volumes, e.g. vda, vdb etc";
+        type string;
+      }
+      uses manotypes:volume-info;
+    } 
+  }
 
-    leaf vdu-id {
-      description "CAL assigned id for VDU to which this connection point belongs";
-      rwpb:field-inline "true";
-      rwpb:field-string-max 64;
-      type string;
+  augment "/rw-project:project" {
+    container vdu-init-params {
+      description "This object defines the parameters required to create a VDU";
+      rwpb:msg-new VDUInitParams;
+      uses vdu-create-params;
     }
+  }
 
-    leaf image-id {
-      description "CAL assigned image-id for the VDU image";
-      rwpb:field-inline "true";
-      rwpb:field-string-max 64;
-      type string;
-    }
+  augment "/rw-project:project" {
+    container vdu-modify-params {
+      description "This object defines the parameters required to modify VDU";
+      rwpb:msg-new VDUModifyParams;
 
-    list connection-points-add {
-      key "name";
-      leaf name {
-        description "Name of the connection point";
-        type string;
-      }
-      leaf virtual-link-id {
-        description "CAL assigned resource Id for the Virtual Link";
+      leaf vdu-id {
+        description "CAL assigned id for VDU to which this connection point belongs";
+        rwpb:field-inline "true";
+        rwpb:field-string-max 64;
         type string;
       }
-      leaf associate-public-ip {
-        type boolean;
-        default false;
-      }
-
-      uses connection-point-type;
-    }
 
-    list connection-points-remove {
-      key "connection-point-id";
-      leaf connection-point-id {
+      leaf image-id {
+        description "CAL assigned image-id for the VDU image";
         rwpb:field-inline "true";
         rwpb:field-string-max 64;
         type string;
       }
+
+      list connection-points-add {
+        key "name";
+        leaf name {
+          description "Name of the connection point";
+          type string;
+        }
+        leaf virtual-link-id {
+          description "CAL assigned resource Id for the Virtual Link";
+          type string;
+        }
+        leaf associate-public-ip {
+          type boolean;
+          default false;
+        }
+        leaf port-security-enabled {
+          description "Enables the port security";
+          type boolean;
+        }
+
+        uses connection-point-type;
+      }
+
+      list connection-points-remove {
+        key "connection-point-id";
+        leaf connection-point-id {
+          rwpb:field-inline "true";
+          rwpb:field-string-max 64;
+          type string;
+        }
+      }
     }
   }
 
@@ -1086,6 +1097,12 @@ module rwcal
       rwpb:field-string-max 64;
       type string;
     }
+
+    leaf mac-addr {
+      rwpb:field-inline "true";
+      rwpb:field-string-max 48;
+      type string;
+    }
   }
 
   grouping virtual-link-info-params {
@@ -1201,24 +1218,45 @@ module rwcal
       type string;
       description "Console URL from the VIM, if available";
     }
+
+    uses manotypes:supplemental-boot-data;
+
+    list volumes {
+      key "name";
+
+      leaf name {
+        description "Name of the disk-volumes, e.g. vda, vdb etc";
+        type string;
+      }
+
+      leaf volume-id {
+        description "CAL assigned volume-id ";
+        rwpb:field-inline "true";
+        rwpb:field-string-max 64;
+        type string;
+      }
+    } 
   }
 
-  container vnf-resources {
-    rwpb:msg-new VNFResources;
-    config false;
 
-    list virtual-link-info-list {
-      rwpb:msg-new VirtualLinkInfoParams;
+  augment "/rw-project:project" {
+    container vnf-resources {
+      rwpb:msg-new VNFResources;
       config false;
-      key virtual-link-id;
-      uses virtual-link-info-params;
-    }
 
-    list vdu-info-list {
-      rwpb:msg-new VDUInfoParams;
-      config false;
-      key vdu-id;
-      uses vdu-info-params;
+      list virtual-link-info-list {
+        rwpb:msg-new VirtualLinkInfoParams;
+        config false;
+        key virtual-link-id;
+        uses virtual-link-info-params;
+      }
+
+      list vdu-info-list {
+        rwpb:msg-new VDUInfoParams;
+        config false;
+        key vdu-id;
+        uses vdu-info-params;
+      }
     }
   }
 }