e52b12bea67d9540288aaf60dfcf34bd31ad1fa6
[transportpce.git] / ordmodels / common / src / main / yang / org-openroadm-common-types@2016-10-14.yang
1 module org-openroadm-common-types {
2   namespace "http://org/openroadm/common-types";
3   prefix org-openroadm-common-types;
4
5   organization "Open ROADM MSA";
6   contact
7     "OpenROADM.org";
8   description
9     "YANG definitions of common types.
10
11       Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
12       AT&T Intellectual Property.  All other rights reserved.
13
14       Redistribution and use in source and binary forms, with or without modification,
15       are permitted provided that the following conditions are met:
16
17       * Redistributions of source code must retain the above copyright notice, this
18         list of conditions and the following disclaimer.
19       * Redistributions in binary form must reproduce the above copyright notice,
20         this list of conditions and the following disclaimer in the documentation and/or
21         other materials provided with the distribution.
22       * Neither the Members of the Open ROADM MSA Agreement nor the names of its
23         contributors may be used to endorse or promote products derived from this software
24         without specific prior written permission.
25
26       THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
27       AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28       WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
29       IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
30       INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
31       NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
32       OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
33       WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34       ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35       POSSIBILITY OF SUCH DAMAGE";
36
37   revision 2016-10-14 {
38     description
39       "Version 1.2";
40   }
41
42   grouping physical-location {
43     leaf rack {
44       type string;
45       mandatory false;
46     }
47     leaf shelf {
48       type string;
49       mandatory false;
50     }
51     leaf slot {
52       type string;
53       mandatory false;
54     }
55     leaf subSlot {
56       type string;
57       mandatory false;
58     }
59   }
60
61   typedef node-types {
62     type enumeration {
63       enum "rdm" {
64         value 1;
65       }
66       enum "xpdr" {
67         value 2;
68       }
69     }
70     description
71       "3 digit identifier for node type
72        1. rdm for ROADM
73        2. xpdr for Transponder, Regen";
74   }
75
76   typedef power-dBm {
77     description
78       "Power value in dBm.";
79     type decimal64 {
80       fraction-digits 2;
81     }
82     units "dBm";
83   }
84
85   typedef ratio-dB {
86     description
87       "Power ratio in dB.";
88     type decimal64 {
89       fraction-digits 3;
90     }
91     units "dB";
92   }
93
94   typedef severity {
95     description
96       "Severity, based on X.733 perceived severity";
97     type enumeration {
98       enum "critical" {
99         value 1;
100       }
101       enum "major" {
102         value 2;
103       }
104       enum "minor" {
105         value 3;
106       }
107       enum "warning" {
108         value 4;
109       }
110       enum "clear" {
111         value 5;
112       }
113       enum "indeterminate" {
114         value 6;
115       }
116     }
117   }
118
119   typedef rpc-status {
120     description
121       "status of RPC ";
122     type enumeration {
123       enum "Successful" {
124         value 1;
125       }
126       enum "Failed" {
127         value 2;
128       }
129     }
130   }
131
132   grouping rpc-response-status {
133     leaf status {
134       type rpc-status;
135       mandatory true;
136       description
137         "Successful or Failed";
138     }
139     leaf status-message {
140       type string;
141       description
142         "Gives a more detailed reason for failure";
143     }
144   }
145
146   typedef lifecycle-state {
147     description
148       "Lifecycle state.";
149     type enumeration {
150       enum "deployed" {
151         value 1;
152       }
153       enum "planned" {
154         value 2;
155       }
156       enum "maintenance" {
157         value 3;
158       }
159       enum "deploying" {
160         value 4;
161       }
162       enum "undeploying" {
163         value 5;
164       }
165     }
166   }
167
168   typedef state {
169     description
170       "State that indicates whether the resource is able to provide fullfill its role - carry traffic, etc.";
171     type enumeration {
172       enum "inService" {
173         value 1;
174       }
175       enum "outOfService" {
176         value 2;
177       }
178       enum "degraded" {
179         value 3;
180       }
181     }
182   }
183
184   typedef optic-types {
185     type enumeration {
186       enum "gray" {
187         value 1;
188       }
189       enum "dwdm" {
190         value 2;
191       }
192     }
193   }
194   grouping equipment-type {
195     leaf type {
196       type equipment-type-enum;
197       mandatory true;
198       config false;
199     }
200     leaf extension {
201       description
202         "Populated with equipment type when enum value is set to vendorExtension";
203       type string;
204       mandatory false;
205       config false;
206     }
207   }
208
209   typedef equipment-type-enum {
210     type enumeration {
211       enum "other" {
212         value 1;
213       }
214       enum "powerSupply" {
215         value 2;
216       }
217       enum "shelfProcessor" {
218         value 3;
219       }
220       enum "crossConnect" {
221         value 4;
222       }
223       enum "fan" {
224         value 5;
225       }
226       enum "accessPanel" {
227         value 6;
228       }
229       enum "circuitPack" {
230         value 7;
231       }
232     }
233   }
234
235   typedef optical-control-mode {
236     description
237       "Optical Control Mode: identifies specific algorithm related to power management and general optical control.";
238     type enumeration {
239       enum "power" {
240         value 1;
241       }
242       enum "gainLoss" {
243         value 2;
244       }
245       enum "off" {
246         value 3;
247       }
248     }
249     reference "openroadm.org: Open ROADM MSA Specification.";
250   }
251
252   typedef direction {
253     type enumeration {
254       enum "tx" {
255         value 1;
256       }
257       enum "rx" {
258         value 2;
259       }
260       enum "bidirectional" {
261         value 3;
262       }
263     }
264   }
265
266   typedef pm-direction {
267     type enumeration {
268       enum "tx" {
269         value 1;
270       }
271       enum "rx" {
272         value 2;
273       }
274       enum "bidirectional" {
275         value 3;
276       }
277       enum "notApplicable" {
278         value 4;
279       }
280     }
281   }
282 }