update from RIFT as of 696b75d2fe9fb046261b08c616f1bcf6c0b54a9b second try
[osm/SO.git] / common / plugins / yang / rw-ro-account.yang
1
2 /*
3  * 
4  *   Copyright 2017 RIFT.IO Inc
5  *
6  *   Licensed under the Apache License, Version 2.0 (the "License");
7  *   you may not use this file except in compliance with the License.
8  *   You may obtain a copy of the License at
9  *
10  *       http://www.apache.org/licenses/LICENSE-2.0
11  *
12  *   Unless required by applicable law or agreed to in writing, software
13  *   distributed under the License is distributed on an "AS IS" BASIS,
14  *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  *   See the License for the specific language governing permissions and
16  *   limitations under the License.
17  *
18  *
19  */
20  
21 module rw-ro-account {
22
23         namespace "http://riftio.com/ns/riftware-1.0/rw-ro-account";
24         prefix "rw-ro-account";
25
26   import ietf-yang-types {
27     prefix "yang";
28   }
29
30         import rw-project {
31                 prefix "rw-project";                    
32         }
33
34   import mano-types {
35     prefix "manotypes";
36   }
37
38         revision 2017-05-15 {
39                 description
40                   "Initial revision.";
41         }
42                 
43   typedef resource-orchestrator-account-type {
44     description "RO account type";
45     type enumeration {
46       enum rift-ro;
47       enum openmano;
48     }
49   }
50
51         typedef connection-status {
52                 description "Connection status for the RO account";
53                 type enumeration {
54                         enum unknown;
55                         enum validating;
56                         enum success;
57                         enum failure;
58                 }
59         }
60
61   augment "/rw-project:project" {
62         container ro-account {
63             list account {
64               key "name";
65               description "Configure RO Accounts";
66         
67               leaf name {
68                 type string;
69               }
70         
71               leaf ro-account-type {
72                 type resource-orchestrator-account-type;
73               }
74         
75               choice resource-orchestrator {
76                 description
77                   "The resource orchestrator to use by the Launchpad";
78                 
79                 case openmano {
80                   description
81                     "Use OpenMano as RO";
82         
83                   container openmano {
84                     leaf host {
85                       type string;
86                       default "localhost";
87                     }
88         
89                     leaf port {
90                       type uint16;
91                       default 9090;
92                     }
93         
94                     leaf tenant-id {
95                       type string {
96                         length "36";
97                       }
98                       mandatory true;
99                     }
100                   }
101                 }               
102                         }
103                   }
104                 }
105         }
106
107   augment "/rw-project:project" {
108         container ro-account-state {
109                 config false;
110             
111             list account {
112               key "name";
113               description "RO Account Operational State";
114         
115               leaf name {
116                 type string;
117               }
118         
119                         container connection-status {
120                                         leaf status {
121                                                 type connection-status;
122                                         }
123                                         leaf details {
124                                                 type string;
125                                         }
126                           }
127                                 
128                                 container instance-ref-count{
129                                         leaf count {
130                                                 type uint16;
131                                                 description "No of NSD that got instantiated using this RO account";
132                                         }
133                         }
134                         
135                         container datacenters {
136                 list datacenters {
137                   key "name";
138                   
139                   leaf uuid {
140                     description "The UUID of the data center";
141                     type yang:uuid;
142                   }
143         
144                   leaf name {
145                     description "The name of the data center";
146                     type string;
147                   }
148                   
149                                                 leaf datacenter-type
150                                                 {
151                                                         description "The type for the data center";
152                                                         type manotypes:cloud-account-type;
153                                                 }                 
154                 }
155         }
156         
157         container config-data{
158                 leaf ro-account-type {
159                         default "rift";
160                         type string; 
161                       }
162                     }
163             }
164           }
165   }
166
167         rpc update-ro-account-status {
168                 description "update ro account connection status";
169                 input {
170                         leaf ro-account {
171                                 mandatory true;
172                                 description
173                                   "The RO account name to update connection status for";
174                                 type string;
175                         }
176                         uses manotypes:rpc-project-name;                
177                 }       
178         }
179
180 }