ccaa6f41f58c0424f6f18f6c9f6b6c94ed0d0b8c
[transportpce.git] / api / src / main / yang / service_path / transportpce-common-types@2021-09-30.yang
1 module transportpce-common-types {
2   namespace "http://org/transportpce/common-types";
3   prefix org-transportpce-common-types;
4
5   import org-openroadm-resource-types {
6     prefix org-openroadm-resource-types;
7     revision-date 2016-10-14;
8   }
9   import org-openroadm-pm-types {
10     prefix org-openroadm-pm-types;
11     revision-date 2016-10-14;
12   }
13   import org-openroadm-common-types {
14     prefix org-openroadm-common-types;
15     revision-date 2018-10-19;
16   }
17
18   revision 2021-09-30 {
19     description
20       "Replace leaf width in optical-renderer-input by mc-width and nmc-width";
21   }
22   revision 2021-06-18 {
23     description
24       "Replace olm-renderer-input by optical-rendrer-input.
25        Create optical-renderer-nodes and otn-renderer-nodes groupings";
26   }
27   revision 2020-12-11 {
28     description
29       "Update grouping olm-renderer-input, adding min, max frequencies
30        lower spectral slot number and higher spectral slot number
31        fix center-freq unit";
32   }
33   revision 2020-06-15 {
34     description
35       "Updated grouping olm-renderer-input to enable support for flex-grid";
36   }
37   revision 2020-01-28 {
38     description
39       "Add necessary parameters to consolidate OTN and address ONAP
40        MDONS use case, including grouping otn-renderer-input";
41   }
42   revision 2019-12-12 {
43     description
44       "Add grouping otn-renderer-input";
45   }
46   revision 2017-09-07 {
47     description
48       "Initial revision of TransportPCE common-types";
49   }
50
51   typedef pm-names-enum {
52     type enumeration {
53       enum vendorExtension {
54         value 1;
55         description
56           "vendor extension";
57       }
58       enum bitErrorRate {
59         value 2;
60         description
61           "Bit error rate (BER)";
62       }
63       enum opticalPowerOutput {
64         value 3;
65         description
66           "Optical Power Output (OPOUT-OTS, OPOUT-OMS, OPT-OCH). Total optical power includes Variable Optical Attenuator (VOA) attenuation";
67       }
68       enum opticalReturnLoss {
69         value 4;
70         description
71           "Optical Return Loss (ORL-OTS) - at MW port(s) B";
72       }
73       enum opticalPowerInput {
74         value 5;
75         description
76           "Optical Power Input (OPIN-OTS, OPIN-OMS, OPR-OCH). Total optical power";
77       }
78       enum codeViolations {
79         value 8;
80         description
81           "Code Violations (CV)";
82       }
83       enum erroredSeconds {
84         value 9;
85         description
86           "Errored Seconds (ES)";
87       }
88       enum severelyErroredSeconds {
89         value 10;
90         description
91           "Severely Errored Seconds (SES)";
92       }
93       enum unavailableSeconds {
94         value 11;
95         description
96           "Unavailable Seconds (UAS)";
97       }
98       enum inFrames {
99         value 12;
100         description
101           "In frames (INFRAMES-E)";
102       }
103       enum inFramesErrored {
104         value 13;
105         description
106           "In frames errored (INFRAMESERR-E)";
107       }
108       enum outFrames {
109         value 14;
110         description
111           "Out frames (OUTFRAMES-E)";
112       }
113       enum erroredSecondsEthernet {
114         value 15;
115         description
116           "Errored Seconds Ethernet (ES-E)";
117       }
118       enum severelyErroredSecondsEthernet {
119         value 16;
120         description
121           "Severly Errored Seconds, Ethernet (SES-E)";
122       }
123       enum unavailableSecondsEthernet {
124         value 17;
125         description
126           "Unavailable Seconds, Ethernet (UAS-E)";
127       }
128       enum erroredBlockCount {
129         value 18;
130         description
131           "Errored block count";
132       }
133       enum delay {
134         value 19;
135         description
136           "Number of frames between a DMValue toggle event and the received DMp signal value toggle event";
137       }
138       enum defectSeconds {
139         value 20;
140         description
141           "Defect Seconds (DS)";
142       }
143       enum backwardIncomingAlignmentError {
144         value 21;
145         description
146           "Backward Incoming Alignment Error (BIAE)";
147       }
148       enum incomingAlignmentError {
149         value 22;
150         description
151           "Incoming Alignment Error (IAE)";
152       }
153       enum opticalPowerOutputMin {
154         value 23;
155         description
156           "Minimum Optical Power Output (OPOUT-OTS). Total optical power includes Variable Optical Attenuator (VOA) attenuation";
157       }
158       enum opticalPowerOutputMax {
159         value 24;
160         description
161           "Maximum Optical Power Output (OPOUT-OTS). Total optical power includes Variable Optical Attenuator (VOA) attenuation";
162       }
163       enum opticalPowerOutputAvg {
164         value 25;
165         description
166           "Average Optical Power Output (OPOUT-OTS). Total optical power includes Variable Optical Attenuator (VOA) attenuation";
167       }
168       enum opticalPowerInputMin {
169         value 26;
170         description
171           "Minimum Optical Power Input (OPIN-OTS). Total optical power";
172       }
173       enum opticalPowerInputMax {
174         value 27;
175         description
176           "Maximum Optical Power Input (OPIN-OTS). Total optical power";
177       }
178       enum opticalPowerInputAvg {
179         value 28;
180         description
181           "Average Optical Power Input (OPIN-OTS). Total optical power";
182       }
183       enum opticalPowerOutputOSC {
184         value 29;
185         description
186           "OSC Optical Power Output (OPT-OSC). OSC Transmit power on MW port";
187       }
188       enum opticalPowerOutputOSCMin {
189         value 30;
190         description
191           "Minimum OSC Optical Power Output (OPT-OSC). OSC Transmit power on MW port";
192       }
193       enum opticalPowerOutputOSCMax {
194         value 31;
195         description
196           "Maximum OSC Optical Power Output (OPT-OSC). OSC Transmit power on MW port";
197       }
198       enum opticalPowerOutputOSCAvg {
199         value 32;
200         description
201           "Average OSC Optical Power Output (OPT-OSC). OSC Transmit power on MW port";
202       }
203       enum opticalPowerInputOSC {
204         value 33;
205         description
206           "OSC Optical Power Input (OPR-OSC). OSC Receive power on MW port";
207       }
208       enum opticalPowerInputOSCMin {
209         value 34;
210         description
211           "Minimum OSC Optical Power Input (OPR-OSC). OSC Receive power on MW port";
212       }
213       enum opticalPowerInputOSCMax {
214         value 35;
215         description
216           "Maximum OSC Optical Power Input (OPR-OSC). OSC Receive power on MW port";
217       }
218       enum opticalPowerInputOSCAvg {
219         value 36;
220         description
221           "Average OSC Optical Power Input (OPR-OSC). OSC Receive power on MW port";
222       }
223       enum preFECCorrectedErrors {
224         value 37;
225         description
226           "pFEC corrected Errors";
227       }
228       enum totalOpticalPowerInput {
229         value 38;
230         description
231           "Total Optical Power Input.";
232       }
233       enum totalOpticalPowerInputMin {
234         value 39;
235         description
236           "Minumun Total Optical Power Input.";
237       }
238       enum totalOpticalPowerInputMax {
239         value 40;
240         description
241           "Maximum Total Optical Power Input.";
242       }
243       enum totalOpticalPowerInputAvg {
244         value 41;
245         description
246           "Average Total Optical Power Input.";
247       }
248       enum FECCorrectableBlocks {
249         value 42;
250         description
251           "FEC Correctable Blocks.";
252       }
253       enum FECUncorrectableBlocks {
254         value 43;
255         description
256           "FEC Uncorrectable Blocks.";
257       }
258       enum BIPErrorCounter {
259         value 56;
260         description
261           "BIP Error Counter";
262       }
263       enum protectionSwitchingCount {
264         value 57;
265         description
266           "Protection Switching Count (PSC)";
267       }
268       enum protectionSwitchingDuration {
269         value 58;
270         description
271           "Protection Switching Duration in seconds (PSD)";
272       }
273       enum erroredBlockCountTCM1-up {
274         value 59;
275         description
276           "errored Blocks Count on TCM1 up direction.";
277       }
278       enum erroredBlockCountTCM2-up {
279         value 60;
280         description
281           "errored Blocks Count on TCM2 up direction.";
282       }
283       enum erroredBlockCountTCM3-up {
284         value 61;
285         description
286           "errored Blocks Count on TCM3 up direction.";
287       }
288       enum erroredBlockCountTCM4-up {
289         value 62;
290         description
291           "errored Blocks Count on TCM4 up direction.";
292       }
293       enum erroredBlockCountTCM5-up {
294         value 63;
295         description
296           "errored Blocks Count on TCM5 up direction.";
297       }
298       enum erroredBlockCountTCM6-up {
299         value 64;
300         description
301           "errored Blocks Count on TCM6 up direction.";
302       }
303       enum delayTCM1-up {
304         value 65;
305         description
306           "Delay on TCM1 up direction.";
307       }
308       enum delayTCM2-up {
309         value 66;
310         description
311           "Delay on TCM2 up direction.";
312       }
313       enum delayTCM3-up {
314         value 67;
315         description
316           "Delay on TCM3 up direction.";
317       }
318       enum delayTCM4-up {
319         value 68;
320         description
321           "Delay on TCM4 up direction.";
322       }
323       enum delayTCM5-up {
324         value 69;
325         description
326           "Delay on TCM5 up direction.";
327       }
328       enum delayTCM6-up {
329         value 70;
330         description
331           "Delay on TCM6 up direction.";
332       }
333       enum erroredBlockCountTCM1-down {
334         value 71;
335         description
336           "errored Blocks Count on TCM1 down direction.";
337       }
338       enum erroredBlockCountTCM2-down {
339         value 72;
340         description
341           "errored Blocks Count on TCM2 down direction.";
342       }
343       enum erroredBlockCountTCM3-down {
344         value 73;
345         description
346           "errored Blocks Count on TCM3 down direction.";
347       }
348       enum erroredBlockCountTCM4-down {
349         value 74;
350         description
351           "errored Blocks Count on TCM4 down direction.";
352       }
353       enum erroredBlockCountTCM5-down {
354         value 75;
355         description
356           "errored Blocks Count on TCM5 down direction.";
357       }
358       enum erroredBlockCountTCM6-down {
359         value 76;
360         description
361           "errored Blocks Count on TCM6 down direction.";
362       }
363       enum delayTCM1-down {
364         value 77;
365         description
366           "Delay on TCM1 down direction.";
367       }
368       enum delayTCM2-down {
369         value 78;
370         description
371           "Delay on TCM2 down direction.";
372       }
373       enum delayTCM3-down {
374         value 79;
375         description
376           "Delay on TCM3 down direction.";
377       }
378       enum delayTCM4-down {
379         value 80;
380         description
381           "Delay on TCM4 down direction.";
382       }
383       enum delayTCM5-down {
384         value 81;
385         description
386           "Delay on TCM5 down direction.";
387       }
388       enum delayTCM6-down {
389         value 82;
390         description
391           "Delay on TCM6 down direction.";
392       }
393     }
394   }
395
396   typedef location {
397     type enumeration {
398       enum notApplicable {
399         value 1;
400       }
401       enum nearEnd {
402         value 2;
403       }
404       enum farEnd {
405         value 3;
406       }
407     }
408   }
409
410   typedef direction {
411     type enumeration {
412       enum tx {
413         value 1;
414       }
415       enum rx {
416         value 2;
417       }
418       enum bidirectional {
419         value 3;
420       }
421       enum notApplicable {
422         value 4;
423       }
424     }
425   }
426
427   grouping link-tp {
428     list link-tp {
429       leaf node-id {
430         type string;
431       }
432       leaf tp-id {
433         type string;
434       }
435     }
436   }
437
438   grouping optical-renderer-nodes {
439     list nodes {
440       key "node-id";
441       ordered-by user;
442       leaf node-id {
443         type string;
444         description
445           "Gloabally unique identifier for the node";
446       }
447       leaf src-tp {
448         type string;
449         mandatory true;
450         description
451           "Source termination point ";
452       }
453       leaf dest-tp {
454         type string;
455         mandatory true;
456         description
457           "Destination termination point ";
458       }
459     }
460   }
461
462   grouping otn-renderer-nodes {
463     list nodes {
464       key "node-id";
465       ordered-by user;
466       leaf node-id {
467         type string;
468         description
469           "Globally unique identifier for the node";
470       }
471       leaf network-tp {
472         type string;
473         description
474           "Source termination point ";
475       }
476       leaf client-tp {
477         type string;
478         description
479           "Destination termination point for end nodes";
480       }
481       leaf network2-tp {
482         type string;
483         description
484           "Destination termination point for intermediate switch";
485       }
486     }
487   }
488
489   grouping optical-renderer-input {
490     description
491       "Type to be used by OLM and Renderer RPCs";
492     leaf service-name {
493       type string;
494     }
495     leaf wave-number {
496       type uint32;
497     }
498     leaf center-freq {
499       type org-openroadm-common-types:frequency-THz;
500     }
501     leaf nmc-width {
502       description
503        " Width of network media channel nmc";
504       type org-openroadm-common-types:frequency-GHz;
505     }
506     leaf mc-width {
507       description
508        " Width of media channel (mc)";
509       type org-openroadm-common-types:frequency-GHz;
510     }
511     leaf min-freq {
512       type org-openroadm-common-types:frequency-THz;
513     }
514     leaf max-freq {
515       type org-openroadm-common-types:frequency-THz;
516     }
517     leaf lower-spectral-slot-number {
518       type uint32;
519     }
520     leaf higher-spectral-slot-number {
521       type uint32;
522     }
523     uses optical-renderer-nodes;
524     uses node-interfaces;
525   }
526
527   grouping otn-renderer-input {
528     description
529       "Type to be used by OLM and Renderer RPCs for OTN";
530     leaf service-name {
531       type string;
532     }
533     uses otn-renderer-nodes;
534   }
535
536   grouping olm-get-pm-input {
537     leaf node-id {
538       type string;
539       mandatory true;
540       description
541         "Gloabally unique identifier
542          for the node";
543     }
544     leaf resource-type {
545       type org-openroadm-resource-types:resource-type-enum;
546       mandatory true;
547       description
548         "Type of the PM resource";
549     }
550     container resource-identifier {
551       leaf resource-name {
552         type string;
553         mandatory true;
554         description
555           "Identifier of particular resource of given type";
556       }
557       leaf circuit-pack-name {
558         when "../../resource-type = 'port'";
559         type string;
560         mandatory true;
561         description
562           "In case resource type is port, then particular resource is identified by port-name
563            (resource-name) and circuit-pack-name (this leaf).";
564       }
565     }
566     leaf granularity {
567       type org-openroadm-pm-types:pm-granularity;
568       mandatory true;
569       description
570         "Granularity of PM bin can be
571          notApplicable,15min,24Hour";
572     }
573     leaf pm-name-type {
574       type pm-names-enum;
575     }
576     leaf pm-extension {
577       type string;
578     }
579     leaf location {
580       type location;
581     }
582     leaf direction {
583       type direction;
584     }
585   }
586
587   grouping node-interfaces {
588     list node-interface {
589       key "node-id";
590       leaf node-id {
591         type string;
592       }
593       leaf-list och-interface-id {
594         type string;
595       }
596       leaf-list otu-interface-id {
597         type string;
598       }
599       leaf-list odu-interface-id {
600         type string;
601       }
602       leaf-list eth-interface-id {
603         type string;
604       }
605       leaf-list connection-id {
606         type string;
607       }
608     }
609   }
610
611   grouping otn-constraint {
612     container otn-constraints {
613       leaf trib-port-number {
614         type uint16;
615         description
616           "defines a trib-port that must be used at A or Z end";
617       }
618       leaf-list opu-trib-slots {
619         type uint16;
620         description
621           "defines a list of trib-slots that must be used at A or Z end";
622       }
623       leaf-list opucn-trib-slots {
624         type string;
625         description
626           "defines a list of opucn-trib-slots that must be used at A or
627            Z end";
628       }
629       container imposed-api {
630         description
631           "defines constraints on access point identifier to be used by
632            local device when one end point of the path (service) is located
633            in a remote domain not handled by the controller. These parameters
634            are passed to the local controller (transportpce) for interoperability
635            purposes.
636            SAPI : The source api (local domain) to be used by A
637            or Z end as expected by remote controller.
638            DAPI: defines the destination api (remote domain) to be used by A
639            or Z end as exposed in the remote domain. Used when the end of the path
640            is in an external domain, handled by a remote controller.
641            EXPECTED-SAPI : The api of the remote end of the path (in an external
642            domain) as expected to be received by A or Z end.
643            EXPECTED-DAPI : defines the destination api to be used by remote end
644            as exposed in the local domain. Used when the end of the path is in an
645            external domain, handled by a remote controller";
646         uses api-info;
647       }
648     }
649   }
650
651   grouping api-info {
652     leaf sapi {
653       type string;
654       description
655         "The source api used by the node";
656     }
657     leaf dapi {
658       type string;
659       description
660         "the destination api of the other end of the path";
661     }
662     leaf expected-sapi {
663       type string;
664       description
665         "The api of the remote end of the path as expected to be received
666          by the node";
667     }
668     leaf expected-dapi {
669       type string;
670       description
671         "api of the node itself, supposed to be used by remote end as
672          the destination";
673     }
674   }
675 }