Sync Common folder
[transportpce.git] / ordmodels / common / src / main / yang / org-openroadm-common-types@2017-12-15.yang
1 module org-openroadm-common-types {
2   namespace "http://org/openroadm/common-types";
3   prefix org-openroadm-common-types;
4
5   organization
6     "Open ROADM MSA";
7   contact
8     "OpenROADM.org";
9   description
10     "YANG definitions of common types.
11        
12       Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016, 
13       AT&T Intellectual Property.  All other rights reserved.
14       
15       Redistribution and use in source and binary forms, with or without modification, 
16       are permitted provided that the following conditions are met:
17       
18       * Redistributions of source code must retain the above copyright notice, this 
19         list of conditions and the following disclaimer.
20       * Redistributions in binary form must reproduce the above copyright notice, 
21         this list of conditions and the following disclaimer in the documentation and/or 
22         other materials provided with the distribution.
23       * Neither the Members of the Open ROADM MSA Agreement nor the names of its 
24         contributors may be used to endorse or promote products derived from this software 
25         without specific prior written permission.
26       
27       THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS'' 
28       AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
29       WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
30       IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT, 
31       INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
32       NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA, 
33       OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 
34       WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
35       ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
36       POSSIBILITY OF SUCH DAMAGE";
37
38   revision 2017-12-15 {
39     description
40       "Version 2.2";
41   }
42   revision 2017-09-29 {
43     description
44       "Version 2.1";
45   }
46   revision 2017-06-26 {
47     description
48       "Version 2.0";
49   }
50   revision 2016-10-14 {
51     description
52       "Version 1.2";
53   }
54
55   identity och-rate-identity {
56     description
57       "A unique och rate identification";
58   }
59
60   identity R200G {
61     base och-rate-identity;
62     description
63       "Identity for 200G Rate";
64   }
65
66   identity R100G {
67     base och-rate-identity;
68     description
69       "Identity for 100G Rate";
70   }
71
72   identity R10.7G {
73     base och-rate-identity;
74     description
75       "Identity for 10.7G Rate";
76   }
77
78   identity R11.1G {
79     base och-rate-identity;
80     description
81       "Identity for 11.1G Rate";
82   }
83
84   typedef node-types {
85     type enumeration {
86       enum "rdm" {
87         value 1;
88       }
89       enum "xpdr" {
90         value 2;
91       }
92       enum "ila" {
93         value 3;
94       }
95       enum "extplug" {
96         value 4;
97       }
98     }
99     description
100       "Identifier for node type
101        1. rdm for ROADM
102        2. xpdr for Transponder, Regen
103        3. ila for in-line amplifier
104        4. extplug for external plugable";
105   }
106
107   typedef node-id-type {
108     type string {
109       length "7..63";
110       pattern "([a-zA-Z][a-zA-Z0-9-]{5,18}[a-zA-Z0-9])" {
111         error-message
112           "A node-id must be 7 to 63 characters in length.
113            A node-id can contain letters, numbers, and hyphens.
114            The first character must be a letter.
115            The last character must be a letter or number.";
116       }
117     }
118     description
119       "Globally unique identifer for a device.";
120   }
121
122   typedef xpdr-node-types {
123     type enumeration {
124       enum "tpdr" {
125         value 1;
126       }
127       enum "mpdr" {
128         value 2;
129       }
130       enum "switch" {
131         value 3;
132       }
133       enum "regen" {
134         value 4;
135       }
136       enum "regen-uni" {
137         value 5;
138       }
139     }
140     description
141       "Identifier for Xponder node type
142        1. Transponder
143        2. Muxponder
144        3. OTN switchponder
145        4. Regenerator
146        5. Regenerator based on unidirectional model";
147   }
148
149   typedef frequency-THz {
150     type decimal64 {
151       fraction-digits 8;
152     }
153     units "THz";
154     description
155       "Frequency value in THz.";
156   }
157
158   typedef frequency-GHz {
159     type decimal64 {
160       fraction-digits 5;
161     }
162     units "GHz";
163     description
164       "Frequency value in GHz.";
165   }
166
167   typedef power-dBm {
168     type decimal64 {
169       fraction-digits 2;
170     }
171     units "dBm";
172     description
173       "Power value in dBm.";
174   }
175
176   typedef ratio-dB {
177     type decimal64 {
178       fraction-digits 3;
179     }
180     units "dB";
181     description
182       "Power ratio in dB.";
183   }
184
185   typedef fiber-pmd {
186     type decimal64 {
187       fraction-digits 2;
188     }
189     units "ps/(km[1/2])";
190     description
191       "Polarization Mode Dispersion expressed in ps/km(1/2).";
192   }
193
194   typedef amplifier-types {
195     type enumeration {
196       enum "standard" {
197         value 1;
198       }
199     }
200     description
201       "identifier for amplifier type
202        1. standard for amplifier as defined initially in the ROADM MSA specifications
203        To be completed if/when additional amplifier types are required ";
204   }
205
206   typedef line-amplifier-control-mode {
207     type enumeration {
208       enum "gainLoss" {
209         value 2;
210       }
211       enum "off" {
212         value 3;
213       }
214     }
215     description
216       "Identifies the line amplifier control mode, either off or gain.";
217   }
218
219   typedef amplifier-gain-range {
220     type enumeration {
221       enum "gain-range-1" {
222         value 1;
223       }
224       enum "gain-range-2" {
225         value 2;
226       }
227       enum "gain-range-3" {
228         value 3;
229       }
230       enum "gain-range-4" {
231         value 4;
232       }
233     }
234     description
235       "Operational mode for the amplifier:  
236        this parameter allows modeling different operational modes (gain ranges) ,notably for switched-gain amplifiers.
237        It indicates which performance model shall be used by the path feasibility engine. 
238        For standard amplifier, or when performance evaluation is based on incremental noise, use gain-range-1.
239        When performance evaluation is based on advanced parameters, specify used gain-range (1 to 4).
240        Up to release 2.1, only gain-range-1 is to be used (default value) ";
241   }
242
243   typedef severity {
244     type enumeration {
245       enum "critical" {
246         value 1;
247       }
248       enum "major" {
249         value 2;
250       }
251       enum "minor" {
252         value 3;
253       }
254       enum "warning" {
255         value 4;
256       }
257       enum "clear" {
258         value 5;
259       }
260       enum "indeterminate" {
261         value 6;
262       }
263     }
264     description
265       "Severity, based on X.733 perceived severity";
266   }
267
268   typedef activate-notification-type {
269     type enumeration {
270       enum "activate" {
271         value 1;
272         description
273           "software or database activation";
274       }
275       enum "commit" {
276         value 2;
277         description
278           "commit the software or database. 
279            For software activate, this event can happen in the following scenarios:
280              1) immediately when user issue db-activate command without rollBackTimer
281                 or if the rollBackTimer is specified as 00-00-00;
282              2) when user issue cancel-rollback-timer before it expires and with accept=true.
283            For database activate, this event can occur in the following scenarios:
284              1) immediately when user issue db-activate command without rollBackTimer
285                 or if the rollBackTimer is specified as 00-00-00;
286              2) when user issue cancel-rollback-timer before it expires and with accept=true.";
287       }
288       enum "cancel" {
289         value 3;
290         description
291           "cancel the database or software activation operation.
292            For software activate, this event can happen in the following cases:
293              1) when the rollBackTimer expires;
294              2) when the user issues cancel-rollback-timer with accept=false.  
295            For database activate, this event can happen in the following cases:
296              1) when the rollBackTimer expires;
297              2) when the user issues cancel-rollback-timer with accept=false.";
298       }
299     }
300     description
301       "Type of notification on software or database activation events";
302   }
303
304   typedef rpc-status {
305     type enumeration {
306       enum "Successful" {
307         value 1;
308       }
309       enum "Failed" {
310         value 2;
311       }
312     }
313     description
314       "status of RPC ";
315   }
316
317   typedef extended-rpc-status {
318     type enumeration {
319       enum "Successful" {
320         value 1;
321       }
322       enum "Failed" {
323         value 2;
324       }
325       enum "In-progress" {
326         value 3;
327       }
328     }
329     description
330       "status of RPC ";
331   }
332
333   typedef lifecycle-state {
334     type enumeration {
335       enum "deployed" {
336         value 1;
337       }
338       enum "planned" {
339         value 2;
340       }
341       enum "maintenance" {
342         value 3;
343       }
344       enum "deploying" {
345         value 4;
346       }
347       enum "undeploying" {
348         value 5;
349       }
350       enum "undeployed" {
351         value 6;
352       }
353       enum "proposed" {
354         value 7;
355       }
356       enum "draft" {
357         value 8;
358       }
359       enum "deploy-failed" {
360         value 9;
361       }
362       enum "undeploy-failed" {
363         value 10;
364       }
365     }
366     description
367       "Lifecycle state.";
368   }
369
370   typedef state {
371     type enumeration {
372       enum "inService" {
373         value 1;
374       }
375       enum "outOfService" {
376         value 2;
377       }
378       enum "degraded" {
379         value 3;
380       }
381     }
382     description
383       "State that indicates whether the resource is able to provide fullfill its role - carry traffic, etc.";
384   }
385
386   typedef optic-types {
387     type enumeration {
388       enum "gray" {
389         value 1;
390       }
391       enum "dwdm" {
392         value 2;
393       }
394     }
395   }
396
397   typedef equipment-type-enum {
398     type enumeration {
399       enum "other" {
400         value 1;
401       }
402       enum "powerSupply" {
403         value 2;
404       }
405       enum "shelfProcessor" {
406         value 3;
407       }
408       enum "crossConnect" {
409         value 4;
410       }
411       enum "fan" {
412         value 5;
413       }
414       enum "accessPanel" {
415         value 6;
416       }
417       enum "circuitPack" {
418         value 7;
419       }
420     }
421   }
422
423   typedef optical-control-mode {
424     type enumeration {
425       enum "power" {
426         value 1;
427       }
428       enum "gainLoss" {
429         value 2;
430       }
431       enum "off" {
432         value 3;
433       }
434     }
435     description
436       "Optical Control Mode: identifies specific algorithm related to power management and general optical control.";
437     reference "openroadm.org: Open ROADM MSA Specification.";
438   }
439
440   typedef direction {
441     type enumeration {
442       enum "tx" {
443         value 1;
444       }
445       enum "rx" {
446         value 2;
447       }
448       enum "bidirectional" {
449         value 3;
450       }
451       enum "notApplicable" {
452         value 4;
453       }
454     }
455   }
456
457   typedef location {
458     type enumeration {
459       enum "notApplicable" {
460         value 1;
461       }
462       enum "nearEnd" {
463         value 2;
464       }
465       enum "farEnd" {
466         value 3;
467       }
468     }
469   }
470
471   typedef wavelength-duplication-type {
472     type enumeration {
473       enum "one-per-srg" {
474         value 1;
475         description
476           "The SRG cannot handle wavelength duplication. Attempting to provision a connection on this SRG that uses the same wavelength as an existing service will result in failure.";
477       }
478       enum "one-per-degree" {
479         value 2;
480         description
481           "The SRG can handle wavelength duplication, but only one per degree. Attempting to provision a connection on this SRG that uses the same wavelength as an existing service will succeed, so long as the connections are not using the same degree.";
482       }
483     }
484     description
485       "One per srg is applied to C/D add/drop group
486        one per degree is applied to C/D/C add drop group";
487   }
488
489   typedef port-qual {
490     type enumeration {
491       enum "roadm-internal" {
492         value 1;
493       }
494       enum "roadm-external" {
495         value 2;
496       }
497       enum "xpdr-network" {
498         value 3;
499       }
500       enum "xpdr-client" {
501         value 4;
502       }
503       enum "otdr" {
504         value 5;
505       }
506       enum "switch-network" {
507         value 6;
508       }
509       enum "switch-client" {
510         value 7;
511       }
512       enum "ila-external" {
513         value 8;
514       }
515       enum "ila-internal" {
516         value 9;
517       }
518     }
519   }
520
521   typedef modulation-format {
522     type enumeration {
523       enum "bpsk" {
524         value 0;
525         description
526           "binary phase-shift keying";
527       }
528       enum "dc-dp-bpsk" {
529         value 1;
530         description
531           "DC dual-polarization binary phase-shift keying";
532       }
533       enum "qpsk" {
534         value 2;
535         description
536           "quadrature phase-shift keying";
537       }
538       enum "dp-qpsk" {
539         value 3;
540         description
541           "dual-polarization binary phase-shift keying";
542       }
543       enum "qam16" {
544         value 4;
545         description
546           "quadrature amplitude modulation 16";
547       }
548       enum "dp-qam16" {
549         value 5;
550         description
551           "dual-polarization quadrature amplitude modulation 16";
552       }
553       enum "dc-dp-qam16" {
554         value 6;
555         description
556           "DC dual-polarization quadrature amplitude modulation 16";
557       }
558       enum "qam8" {
559         value 7;
560         description
561           "quadrature amplitude modulation 8";
562       }
563       enum "dp-qam8" {
564         value 8;
565         description
566           "dual-polarization quadrature amplitude modulation 8";
567       }
568       enum "dc-dp-qam8" {
569         value 9;
570         description
571           "DC dual-polarization quadrature amplitude modulation 8";
572       }
573     }
574     description
575       "Modulation format";
576   }
577
578   grouping physical-location {
579     leaf rack {
580       type string;
581       mandatory false;
582     }
583     leaf shelf {
584       type string;
585       mandatory false;
586     }
587     leaf slot {
588       type string;
589       mandatory false;
590     }
591     leaf subSlot {
592       type string;
593       mandatory false;
594     }
595   }
596
597   grouping rpc-response-status {
598     leaf status {
599       type rpc-status;
600       mandatory true;
601       description
602         "Successful or Failed";
603     }
604     leaf status-message {
605       type string;
606       description
607         "Gives a more detailed status";
608     }
609   }
610
611   grouping extended-rpc-response-status {
612     leaf status {
613       type extended-rpc-status;
614       mandatory true;
615       description
616         "Successful, Failed or In-progress";
617     }
618     leaf status-message {
619       type string;
620       description
621         "Gives a more detailed status.";
622     }
623   }
624
625   grouping equipment-type {
626     leaf type {
627       type equipment-type-enum;
628       config false;
629       mandatory true;
630     }
631     leaf extension {
632       type string;
633       config false;
634       mandatory false;
635       description
636         "Populated with equipment type when enum value is set to vendorExtension";
637     }
638   }
639 }