update from RIFT as of 696b75d2fe9fb046261b08c616f1bcf6c0b54a9b second try
[osm/SO.git] / common / plugins / yang / rw-ro-account.yang
diff --git a/common/plugins/yang/rw-ro-account.yang b/common/plugins/yang/rw-ro-account.yang
new file mode 100644 (file)
index 0000000..c267007
--- /dev/null
@@ -0,0 +1,180 @@
+
+/*
+ * 
+ *   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 rw-ro-account {
+
+       namespace "http://riftio.com/ns/riftware-1.0/rw-ro-account";
+       prefix "rw-ro-account";
+
+  import ietf-yang-types {
+    prefix "yang";
+  }
+
+       import rw-project {
+               prefix "rw-project";                    
+       }
+
+  import mano-types {
+    prefix "manotypes";
+  }
+
+       revision 2017-05-15 {
+               description
+                 "Initial revision.";
+       }
+               
+  typedef resource-orchestrator-account-type {
+    description "RO account type";
+    type enumeration {
+      enum rift-ro;
+      enum openmano;
+    }
+  }
+
+       typedef connection-status {
+               description "Connection status for the RO account";
+               type enumeration {
+                       enum unknown;
+                       enum validating;
+                       enum success;
+                       enum failure;
+               }
+       }
+
+  augment "/rw-project:project" {
+       container ro-account {
+           list account {
+             key "name";
+             description "Configure RO Accounts";
+       
+             leaf name {
+               type string;
+             }
+       
+             leaf ro-account-type {
+               type resource-orchestrator-account-type;
+             }
+       
+             choice resource-orchestrator {
+               description
+                 "The resource orchestrator to use by the Launchpad";
+               
+               case openmano {
+                 description
+                   "Use OpenMano as RO";
+       
+                 container openmano {
+                   leaf host {
+                     type string;
+                     default "localhost";
+                   }
+       
+                   leaf port {
+                     type uint16;
+                     default 9090;
+                   }
+       
+                   leaf tenant-id {
+                     type string {
+                       length "36";
+                     }
+                     mandatory true;
+                   }
+                 }
+               }               
+                       }
+                 }
+               }
+       }
+
+  augment "/rw-project:project" {
+       container ro-account-state {
+               config false;
+           
+           list account {
+             key "name";
+             description "RO Account Operational State";
+       
+             leaf name {
+               type string;
+             }
+       
+                       container connection-status {
+                                       leaf status {
+                                               type connection-status;
+                                       }
+                                       leaf details {
+                                               type string;
+                                       }
+                         }
+                               
+                               container instance-ref-count{
+                                       leaf count {
+                                               type uint16;
+                                               description "No of NSD that got instantiated using this RO account";
+                                       }
+                       }
+                       
+                       container datacenters {
+               list datacenters {
+                 key "name";
+                 
+                 leaf uuid {
+                   description "The UUID of the data center";
+                   type yang:uuid;
+                 }
+       
+                 leaf name {
+                   description "The name of the data center";
+                   type string;
+                 }
+                 
+                                               leaf datacenter-type
+                                               {
+                                                       description "The type for the data center";
+                                                       type manotypes:cloud-account-type;
+                                               }                 
+               }
+        }
+        
+        container config-data{
+               leaf ro-account-type {
+                       default "rift";
+                       type string; 
+                     }
+                   }
+           }
+         }
+  }
+
+       rpc update-ro-account-status {
+               description "update ro account connection status";
+               input {
+                       leaf ro-account {
+                               mandatory true;
+                               description
+                                 "The RO account name to update connection status for";
+                               type string;
+                       }
+                       uses manotypes:rpc-project-name;                
+               }       
+       }
+
+}