Sync Common folder
[transportpce.git] / ordmodels / common / src / main / yang / org-openroadm-resource-types@2017-12-15.yang
1 module org-openroadm-resource-types {
2   namespace "http://org/openroadm/resource/types";
3   prefix org-openroadm-resource-types;
4
5   import org-openroadm-common-types {
6     prefix org-openroadm-common-types;
7     revision-date 2017-12-15;
8   }
9
10   organization
11     "Open ROADM MSA";
12   contact
13     "OpenROADM.org";
14   description
15     "YANG definitions of common resource types.
16        
17       Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
18       AT&T Intellectual Property.  All other rights reserved.
19       
20       Redistribution and use in source and binary forms, with or without modification, 
21       are permitted provided that the following conditions are met:
22       
23       * Redistributions of source code must retain the above copyright notice, this 
24         list of conditions and the following disclaimer.
25       * Redistributions in binary form must reproduce the above copyright notice, 
26         this list of conditions and the following disclaimer in the documentation and/or 
27         other materials provided with the distribution.
28       * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
29         contributors may be used to endorse or promote products derived from this software 
30         without specific prior written permission.
31       
32       THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
33       AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
34       WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
35       IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
36       INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
37       NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
38       OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
39       WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
40       ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
41       POSSIBILITY OF SUCH DAMAGE";
42
43   revision 2017-12-15 {
44     description
45       "Version 2.2";
46   }
47   revision 2017-09-29 {
48     description
49       "Version 2.1";
50   }
51   revision 2017-06-26 {
52     description
53       "Version 2.0";
54   }
55   revision 2016-10-14 {
56     description
57       "Version 1.2";
58   }
59
60   typedef resource-type-enum {
61     type enumeration {
62       enum "other" {
63         value 1;
64         description
65           "Resource of type not found in list.";
66       }
67       enum "device" {
68         value 2;
69         description
70           "device - ROAMD, Xponder, etc";
71       }
72       enum "degree" {
73         value 3;
74         description
75           "degree";
76       }
77       enum "shared-risk-group" {
78         value 4;
79         description
80           "shared-risk-group";
81       }
82       enum "connection" {
83         value 5;
84         description
85           "connection - this is used by roadm-connection and odu-connection
86            since they are mutually exclusive in the model";
87       }
88       enum "connection-map" {
89         value 6;
90         description
91           "connection-map";
92       }
93       enum "port" {
94         value 7;
95         description
96           "port";
97       }
98       enum "circuit-pack" {
99         value 8;
100         description
101           "circuit pack";
102       }
103       enum "internal-link" {
104         value 9;
105         description
106           "internal-link";
107       }
108       enum "physical-link" {
109         value 10;
110         description
111           "physical-link";
112       }
113       enum "interface" {
114         value 11;
115         description
116           "interface";
117       }
118       enum "shelf" {
119         value 12;
120         description
121           "shelf";
122       }
123       enum "service" {
124         value 13;
125         description
126           "service";
127       }
128       enum "odu-sncp-pg" {
129         value 14;
130         description
131           "odu-sncp-pg";
132       }
133       enum "line-amplifier" {
134         value 15;
135         description
136           "line-amplifier";
137       }
138       enum "xponder" {
139         value 16;
140         description
141           "xponder";
142       }
143       enum "versioned-service" {
144         value 17;
145         description
146           "versioned-service";
147       }
148       enum "temp-service" {
149         value 18;
150         description
151           "temp-service";
152       }
153     }
154   }
155
156   typedef resource-notification-type {
157     type enumeration {
158       enum "resourceCreation" {
159         value 1;
160         description
161           "A new instance of a resource has been created.";
162       }
163       enum "resourceModification" {
164         value 2;
165         description
166           "An exhisting instance of a resource has been modified. This shall be triggered by changes in configuration, state, status etc.
167            It shall not be triggered by changes in performance measurements, power and temperature readings or any other data that is highlyvolatile. ";
168       }
169       enum "resourceDeletion" {
170         value 3;
171         description
172           "An exhisting instance of a resource has been removed.";
173       }
174     }
175     description
176       "Type of notification about a resource";
177   }
178
179   grouping resource-type {
180     leaf type {
181       type resource-type-enum;
182       mandatory true;
183     }
184     leaf extension {
185       type string;
186       mandatory false;
187     }
188   }
189
190   grouping device-id {
191     description
192       "Device identifier. Unique within the Controller.";
193     leaf node-id {
194       type org-openroadm-common-types:node-id-type;
195       description
196         "Node Id is a globally unique identifier for a device. 
197          Same as leafref value in model, if applicable.";
198     }
199   }
200
201   grouping circuit-pack-name {
202     leaf circuit-pack-name {
203       type string;
204       mandatory true;
205       description
206         "Circuit-Pack identifier. Unique within the context of a device.
207          Same as leafref value in model, if applicable.";
208     }
209   }
210
211   grouping port-name {
212     uses circuit-pack-name;
213     leaf port-name {
214       type string;
215       description
216         "Port identifier. Unique within the context of a circuit-pack. 
217          Same as leafref value in model, if applicable.";
218     }
219   }
220
221   grouping physical-link-name {
222     leaf physical-link-name {
223       type string;
224       mandatory true;
225       description
226         "Physical Link identifier. Unique within the context of a device. 
227          Same as leafref value in model, if applicable.";
228     }
229   }
230
231   grouping internal-link-name {
232     leaf internal-link-name {
233       type string;
234       mandatory true;
235       description
236         "Internal Link identifier. Unique within the context of a device. 
237          Same as leafref value in model, if applicable.";
238     }
239   }
240
241   grouping connection-name {
242     leaf connection-name {
243       type string;
244       description
245         "Connection name. Unique within the context of a device. 
246          Same as leafref value in model, if applicable.";
247     }
248   }
249
250   grouping degree-number {
251     leaf degree-number {
252       type uint16;
253       description
254         "Degree identifier. Unique within the context of a device. 
255          Same as leafref value in model, if applicable.";
256     }
257   }
258
259   grouping srg-number {
260     leaf srg-number {
261       type uint16;
262       description
263         "Shared Risk Group identifier. Unique within the context of a device. 
264          Same as leafref value in model, if applicable.";
265     }
266   }
267
268   grouping shelf-name {
269     leaf shelf-name {
270       type string;
271       mandatory true;
272       description
273         "Shelf-id identifier. Unique within the context of a device.  
274          Same as leafref value in model, if applicable.";
275     }
276   }
277
278   grouping service-name {
279     leaf service-name {
280       type string;
281       mandatory true;
282       description
283         "Service identifier. Unique within the context of a network.  
284          Same as leafref value in model, if applicable.";
285     }
286   }
287
288   grouping versioned-service-name {
289     leaf versioned-service-name {
290       type string;
291       mandatory true;
292       description
293         "Service identifier. Unique within the context of a network.  
294          Same as leafref value in model, if applicable.";
295     }
296     leaf version-number {
297       type uint64;
298       mandatory true;
299       description
300         "version-number of the service";
301     }
302   }
303
304   grouping temp-service-name {
305     leaf common-id {
306       type string;
307       mandatory true;
308       description
309         "Service identifier. Unique within the context of a network.  
310          Same as leafref value in model, if applicable.";
311     }
312   }
313
314   grouping interface-name {
315     leaf interface-name {
316       type string;
317       mandatory true;
318       description
319         "Interface identifier.";
320     }
321   }
322
323   grouping other-resource-id {
324     leaf other-resource-id {
325       type string;
326       mandatory true;
327       description
328         "resource-id for other.";
329     }
330   }
331
332   grouping odu-sncp-pg-name {
333     leaf odu-sncp-pg-name {
334       type string;
335       mandatory true;
336       description
337         "name of the odu-snc-pg";
338     }
339   }
340
341   grouping amp-number {
342     leaf amp-number {
343       type uint8;
344       mandatory true;
345       description
346         "number of the line-amplifier";
347     }
348   }
349
350   grouping xpdr-number {
351     leaf xpdr-number {
352       type uint16;
353       mandatory true;
354       description
355         "number of the xponder";
356     }
357   }
358 }