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