upgrade models to OpenROADM service 5.1.0
[transportpce.git] / ordmodels / service / src / main / yang / org-openroadm-common-service-types@2019-05-31.yang
1 module org-openroadm-common-service-types {
2   namespace "http://org/openroadm/common/service/types";
3   prefix org-openroadm-common-service-types;
4
5   import ietf-yang-types {
6     prefix yang;
7     revision-date 2013-07-15;
8   }
9   import ietf-inet-types {
10     prefix inet;
11     revision-date 2013-07-15;
12   }
13   import org-openroadm-routing-constraints {
14     prefix org-openroadm-routing-constraints;
15     revision-date 2019-03-29;
16   }
17   import org-openroadm-topology {
18     prefix org-openroadm-topology;
19     revision-date 2019-05-31;
20   }
21   import org-openroadm-common-equipment-types {
22     prefix org-openroadm-common-equipment-types;
23     revision-date 2018-11-30;
24   }
25   import org-openroadm-common-state-types {
26     prefix org-openroadm-common-state-types;
27     revision-date 2018-11-30;
28   }
29   import org-openroadm-common-node-types {
30     prefix org-openroadm-common-node-types;
31     revision-date 2018-11-30;
32   }
33   import org-openroadm-resource-types {
34     prefix org-openroadm-resource-types;
35     revision-date 2018-11-30;
36   }
37   import org-openroadm-otn-common-types {
38     prefix org-openroadm-otn-common-types;
39     revision-date 2018-11-30;
40   }
41   import org-openroadm-common-types {
42     prefix org-openroadm-common-types;
43     revision-date 2019-05-31;
44   }
45   import org-openroadm-equipment-states-types {
46     prefix org-openroadm-equipment-states-types;
47     revision-date 2018-11-30;
48   }
49   import org-openroadm-service-format {
50     prefix org-openroadm-service-format;
51     revision-date 2019-05-31;
52   }
53
54   organization
55     "Open ROADM MSA";
56   contact
57     "OpenROADM.org";
58   description
59     "YANG definitions of common service types.
60
61       Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
62       All other rights reserved.
63
64       Redistribution and use in source and binary forms, with or without modification,
65       are permitted provided that the following conditions are met:
66
67       * Redistributions of source code must retain the above copyright notice, this
68         list of conditions and the following disclaimer.
69       * Redistributions in binary form must reproduce the above copyright notice,
70         this list of conditions and the following disclaimer in the documentation and/or
71         other materials provided with the distribution.
72       * Neither the Members of the Open ROADM MSA Agreement nor the names of its
73         contributors may be used to endorse or promote products derived from this software
74         without specific prior written permission.
75
76       THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
77       AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
78       WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
79       IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
80       INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
81       NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
82       OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
83       WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
84       ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
85       POSSIBILITY OF SUCH DAMAGE";
86
87   revision 2019-05-31 {
88     description
89       "Version 5.1.0";
90   }
91   revision 2019-03-29 {
92     description
93       "Version 5.0.0";
94   }
95   revision 2018-11-30 {
96     description
97       "Version 4.1.0";
98   }
99   revision 2018-09-28 {
100     description
101       "Version 4.0.0";
102   }
103   revision 2018-05-30 {
104     description
105       "Version 3.1.0";
106   }
107   revision 2018-03-30 {
108     description
109       "Version 3.0.0";
110   }
111   revision 2017-12-15 {
112     description
113       "Version 2.2";
114   }
115   revision 2017-09-29 {
116     description
117       "Version 2.1";
118   }
119   revision 2017-07-28 {
120     description
121       "Version 2.0.1 - added revision-date to imports";
122   }
123   revision 2017-06-26 {
124     description
125       "Version 2.0";
126   }
127   revision 2016-10-14 {
128     description
129       "Version 1.2";
130   }
131
132   identity service-resiliency-type-identity {
133     description
134       "A unique resiliency type identification of the service.";
135   }
136
137   identity unprotected {
138     base service-resiliency-type-identity;
139     description
140       "the service is not protected in the OpenROADM layer";
141   }
142
143   identity unprotected-diversely-routed {
144     base service-resiliency-type-identity;
145     description
146       "the service is not protected in the OpenROADM layer, but may be protected in a higher layer
147           a coupled service that may be routed partially or fully disjointly is defined";
148   }
149
150   identity protected {
151     base service-resiliency-type-identity;
152     description
153       "the service is protected in the OpenROADM layer : the protection is handled
154        autonomously in this layer";
155   }
156
157   identity restorable {
158     base service-resiliency-type-identity;
159     description
160       "the service can be restored autonomously in the OpenROADM layer";
161   }
162
163   identity external-trigger-restorable {
164     base service-resiliency-type-identity;
165     description
166       "the service can be restored in the OpenROADM layer, but the restoration is triggered
167        at a higher layer through service models' rpc";
168   }
169
170   typedef rpc-actions {
171     type enumeration {
172       enum "service-create" {
173         value 1;
174       }
175       enum "service-feasibility-check" {
176         value 2;
177       }
178       enum "service-delete" {
179         value 3;
180       }
181       enum "equipment-notification" {
182         value 4;
183       }
184       enum "temp-service-create" {
185         value 5;
186       }
187       enum "temp-service-delete" {
188         value 6;
189       }
190       enum "service-roll" {
191         value 7;
192       }
193       enum "service-reconfigure" {
194         value 8;
195       }
196       enum "service-restoration" {
197         value 9;
198       }
199       enum "service-reversion" {
200         value 10;
201       }
202       enum "service-reroute" {
203         value 11;
204       }
205       enum "service-reroute-confirm" {
206         value 12;
207       }
208       enum "network-re-optimization" {
209         value 13;
210       }
211       enum "service-feasibility-check-bulk" {
212         value 14;
213       }
214       enum "ber-test" {
215         value 15;
216       }
217     }
218     description
219       "rpc-actions include all the rpc methods";
220   }
221
222   typedef ethernet-encoding-type {
223     type enumeration {
224       enum "10GBASE-W" {
225         value 1;
226       }
227       enum "10GBASE-R" {
228         value 2;
229       }
230     }
231   }
232
233   typedef mapping-mode-type {
234     type enumeration {
235       enum "GFP-F" {
236         value 1;
237         reference "GFP-F - ITU-T G.7041 SubClause 7.1, Payload Only";
238       }
239       enum "GFP-E" {
240         value 2;
241         reference "GFP-E - ITU-T G.7041 SubClause 7.9, Payload + Preamble + Ordered Sets";
242       }
243       enum "PCS-Transparent" {
244         value 3;
245         reference "PCS-Transparent - ITU-T G.709 Subclause 17.2 , CBR10G3 mapping to ODU2e";
246       }
247     }
248   }
249
250   typedef service-layer-type {
251     type enumeration {
252       enum "wdm" {
253         value 1;
254       }
255       enum "otn" {
256         value 2;
257       }
258     }
259   }
260
261   typedef service-notification-types {
262     type enumeration {
263       enum "service-create-result" {
264         value 1;
265       }
266       enum "service-reconfigure-result" {
267         value 2;
268       }
269       enum "service-delete-result" {
270         value 3;
271       }
272       enum "service-roll-result" {
273         value 4;
274       }
275       enum "service-revert-result" {
276         value 5;
277       }
278       enum "service-reroute-result" {
279         value 6;
280       }
281       enum "service-restoration-result" {
282         value 7;
283       }
284     }
285   }
286
287   typedef connection-type {
288     type enumeration {
289       enum "service" {
290         value 1;
291       }
292       enum "infrastructure" {
293         value 2;
294       }
295       enum "roadm-line" {
296         value 3;
297       }
298     }
299   }
300
301   typedef service-condition {
302     type enumeration {
303       enum "restored-temporarily" {
304         value 1;
305       }
306       enum "re-routed-temporarily" {
307         value 2;
308       }
309       enum "activated-for-service" {
310         value 3;
311       }
312       enum "activated-for-further-check" {
313         value 4;
314       }
315       enum "activated-for-troubleshooting-failure" {
316         value 5;
317       }
318     }
319   }
320
321   grouping service-and-supporting-services {
322     description
323         "Service identifiers and supporting services details";
324     uses service-identifiers-container;
325     uses supporting-services-identifiers-and-ends;
326   }
327
328   grouping supporting-services-identifiers-and-ends {
329     container supporting-services {
330       list supporting-service-details {
331         key "index";
332         leaf index {
333           type uint16;
334           description
335             "Service number of the supporting service";
336         }
337         uses service-identifiers-container;
338         uses service-ends-container;
339       }
340     }
341   }
342
343   grouping service-ends-container {
344     container service-a-end {
345       uses service-endpoint-summary;
346     }
347     container service-z-end {
348       uses service-endpoint-summary;
349     }
350   }
351
352   grouping service-endpoint-summary {
353     description
354         "Brief form of service-endpoint";
355     container service-endpoint-details {
356       leaf clli {
357         type string;
358         mandatory true;
359         description
360           "CLLI. Note this CLLI must match the site associated with the device-id of this endpoint";
361       }
362       uses org-openroadm-resource-types:device-id;
363       container tx-direction {
364         uses service-port;
365       }
366       container rx-direction {
367         uses service-port;
368       }
369     }
370   }
371
372   grouping service-identifiers-container {
373     container service-identifiers {
374       leaf service-name {
375         type string;
376       }
377       leaf common-id {
378         type string;
379       }
380       leaf version-number {
381         type uint64;
382       }
383     }
384   }
385
386   grouping configuration-response-common {
387     container configuration-response-common {
388       leaf request-id {
389         type string;
390         mandatory true;
391       }
392       leaf response-code {
393         type string;
394         mandatory true;
395       }
396       leaf response-message {
397         type string;
398       }
399       leaf ack-final-indicator {
400         type string;
401         mandatory true;
402       }
403     }
404   }
405
406   grouping response-parameters {
407     container response-parameters {
408       description
409         "Violated soft constraints";
410       uses org-openroadm-routing-constraints:routing-constraints;
411     }
412   }
413
414   grouping subrate-eth-sla {
415     container subrate-eth-sla {
416       presence "Explicit assignment of subrate ethernet allocation";
417       description
418         "SLA (Service Level Agreement) for subrate Ethernet";
419       uses org-openroadm-common-types:eth-rate-and-burst-size;
420     }
421   }
422
423   grouping service-endpoint {
424     leaf service-format {
425       type org-openroadm-service-format:service-format;
426       mandatory true;
427       description
428         "Format of the requested service: Ethernet, OTU, etc.";
429     }
430     leaf service-rate {
431       when "../service-format != 'OMS' and ../service-format != 'ODU'" {
432         description
433           "service rate not applicable when service
434            format is roadmline or ODU; valid for OTU since service-rate has
435            already been supported for wdm layer OTU services (100 for OTU4)";
436       }
437       type uint32;
438       description
439         "Rate of the requested service in GBps";
440     }
441     leaf other-service-format-and-rate {
442       type string;
443       description
444         "Used when service-format is set to other in the bookend xponder use case.
445          The use of other-service-format-and-rate is not standardized in the Open ROADM MSA
446          and intended to allow the controller to support non-Open ROADM service formats.
447          This value encodes both the service format and the rate supported.
448          This field should not be specified when service format != other.";
449     }
450     leaf otu-service-rate {
451       when "../service-format = 'OTU'" {
452         description
453           "only applicable for OTU services";
454       }
455       type identityref {
456         base org-openroadm-otn-common-types:otu-rate-identity;
457       }
458       description
459         "OTU Rate of the requested service";
460     }
461     leaf odu-service-rate {
462       when "../service-format = 'ODU'" {
463         description
464           "only applicable for ODU services";
465       }
466       type identityref {
467         base org-openroadm-otn-common-types:odu-rate-identity;
468       }
469       description
470         "ODU Rate of the requested service";
471     }
472     leaf ethernet-encoding {
473       when
474         "(../service-format='Ethernet')
475          and
476          (../service-rate=10)" {
477         description
478           "Applicable only to Ethernet 10G services";
479       }
480       type ethernet-encoding-type;
481       description
482         "Ethernet encoding type";
483     }
484     leaf mapping-mode {
485       when
486         "(../service-format='Ethernet')
487          and
488          (../service-rate=10)" {
489         description
490           "Mapping Mode, currently only defined for Ethernet 10G services";
491       }
492       type mapping-mode-type;
493       description
494         "Mapping mode.";
495     }
496     leaf clli {
497       type string;
498       mandatory true;
499       description
500         "CLLI. Note this CLLI must match the site associated with the device-id of this
501          endpoint";
502     }
503     uses org-openroadm-resource-types:device-id;
504     container tx-direction {
505       uses service-port;
506       uses service-lgx;
507       uses service-tail;
508     }
509     container rx-direction {
510       uses service-port;
511       uses service-lgx;
512       uses service-tail;
513     }
514     leaf optic-type {
515       type org-openroadm-common-equipment-types:optic-types;
516     }
517     container router {
518       description
519         "Needed for communication with DWDM pluggable";
520       leaf node-id {
521         type org-openroadm-common-node-types:node-id-type;
522         description
523           "Node id. This is reported against the service, but may not get reflected in the service in the network.";
524       }
525       leaf ip-address {
526         type inet:ip-address;
527         description
528           "Router IP Address. This is reported against the service, but may not get reflected in the service in the network.";
529       }
530       leaf url {
531         type string;
532         description
533           "URL needed for communication with DWDM pluggable. This is reported against the service, but may not get reflected in the service in the network.";
534       }
535     }
536     leaf user-label {
537       type string;
538       mandatory false;
539       description
540         "Label for service endpoint, defined by the user";
541     }
542     container subrate-eth-sla {
543       when "(../service-format='Ethernet')" {
544         description
545           "For any Ethernet services";
546       }
547       uses org-openroadm-common-service-types:subrate-eth-sla;
548     }
549   }
550
551   grouping sdnc-request-header {
552     container sdnc-request-header {
553       leaf request-id {
554         type string;
555       }
556       leaf rpc-action {
557         type rpc-actions;
558       }
559       leaf notification-url {
560         type string;
561       }
562       leaf request-system-id {
563         type string;
564       }
565     }
566   }
567
568   grouping service-port {
569     container port {
570       description
571         "From the device model perspective the port-device-name plus the port-circuit-pack-name plus the port-name uniquely identifies the port.
572          From the network model perspective the openroadm-topology-ref plus port-device-name plus port-name uniquely identify the termination point in the network model.";
573       leaf port-device-name {
574         type string;
575       }
576       leaf port-circuit-pack-name {
577         type string;
578       }
579       leaf port-type {
580         type string;
581       }
582       leaf port-name {
583         type string;
584       }
585       leaf port-rack {
586         type string;
587       }
588       leaf port-shelf {
589         type string;
590       }
591       leaf port-slot {
592         type string;
593       }
594       leaf port-sub-slot {
595         type string;
596       }
597     }
598   }
599
600   grouping service-lgx {
601     container lgx {
602       leaf lgx-device-name {
603         type string;
604       }
605       leaf lgx-port-name {
606         type string;
607       }
608       leaf lgx-port-rack {
609         type string;
610       }
611       leaf lgx-port-shelf {
612         type string;
613       }
614     }
615   }
616
617   grouping service-tail {
618     container tail {
619       container tail-roadm {
620         description
621           "ROADM on which the transponder is connected to (TID, IP Address,
622            or FQDN)";
623         uses org-openroadm-resource-types:device-id;
624       }
625       container xponder-port {
626         description
627           "Muxponder port used in tail, that will get used as a service endpoint.";
628         leaf circuit-pack-name {
629           type string;
630         }
631         leaf port-name {
632           type string;
633         }
634       }
635       leaf tail-roadm-port-aid {
636         type string;
637         description
638           "This will provide the transponder port needed to inter-city ROADM
639            connection";
640       }
641       leaf tail-roadm-port-rack-location {
642         type string;
643         description
644           "Transponder's location";
645       }
646     }
647   }
648
649   grouping service-information {
650     leaf due-date {
651       type yang:date-and-time;
652       description
653         "Date and time service to be turn up. If time is not specified for a given date, default to midnight. Service turned up immediately if no due date is specified";
654     }
655     leaf end-date {
656       type yang:date-and-time;
657       mandatory false;
658       description
659         "Date and time service to be removed";
660     }
661     uses eventHorizon;
662     leaf nc-code {
663       type string;
664       description
665         "NC code applied to wavelength service only. This is reported against the service, but may not get reflected in the service in the network.";
666     }
667     leaf nci-code {
668       type string;
669       description
670         "NCI code applied to wavelength service only. This is reported against the service, but may not get reflected in the service in the network.";
671     }
672     leaf secondary-nci-code {
673       type string;
674       description
675         "NC code applied to wavelength service only. This is reported against the service, but may not get reflected in the service in the network.";
676     }
677     leaf customer {
678       type string;
679       description
680         "To be included in ticket information. This is reported against the service, but may not get reflected in the service in the network.";
681     }
682     leaf customer-contact {
683       type string;
684       description
685         "Customer contact information to be included in ticket information. This is reported against the service, but may not get reflected in the service in the network.";
686     }
687     leaf operator-contact {
688       type string;
689       description
690         "Operator contact information to be included in ticket information. This is reported against the service, but may not get reflected in the service in the network.";
691     }
692     leaf service-layer {
693       type service-layer-type;
694       default "wdm";
695       description
696         "Layer associated with service (e.g. wdm or otn)";
697     }
698     leaf clli-network-ref {
699       type string;
700       description
701         "Assumption: a service would not span multiple clli-network layers.
702          Reference to the network-id of the clli-network layer.";
703     }
704     leaf openroadm-network-ref {
705       type string;
706       description
707         "Assumption: a service would not span multiple openroadm-network layers.
708          Reference to the network-id of the openroadm-network layer.";
709     }
710     leaf openroadm-topology-ref {
711       type string;
712       description
713         "Assumption: a service would not span multiple topology layers.
714          Reference to the network-id of either the openroadm-topology
715          or the otn-topology layer depending upon service-layer (wdm or otn).";
716     }
717     leaf bandwidth-calendaring {
718       type boolean;
719       description
720         "True if service is active only during a specific time period";
721     }
722     container bw-calendaring-parameters {
723       when "../bandwidth-calendaring = 'true'" {
724         description
725           "Includes all attributes associated with bandwidth calendaring option.
726            Used to set service profile : each service corresponds to one specific
727            time-period. Services defined on complementary time periods can be linked
728            together through the coupled-service attribute ";
729       }
730       list bw-calendaring-coupled-services {
731         key "service-index";
732         leaf service-index {
733           type uint16;
734           description
735             "service-number of the service that may be associated to the considered service";
736         }
737         leaf service-name {
738           type string;
739           description
740             "service-name of the service that may be associated to the considered service in service-list";
741         }
742         leaf common-id {
743           type string;
744           description
745             "common-id of the service that may be associated to the considered service in temp-service-list";
746         }
747         leaf version-number {
748           type uint64;
749           description
750             "common-id of the service that may be associated to the considered service in versioned-service-list";
751         }
752       }
753       list recurrence-pattern {
754         key "recurrence-id";
755         leaf recurrence-id {
756           type uint32;
757           description
758             "id of the pattern defining the time during which the service is active ";
759         }
760         leaf-list day-of-the-week {
761           type enumeration {
762             enum "Monday" {
763               value 1;
764             }
765             enum "Tuesday" {
766               value 2;
767             }
768             enum "Wednesday" {
769               value 3;
770             }
771             enum "Thursday" {
772               value 4;
773             }
774             enum "Friday" {
775               value 5;
776             }
777             enum "Saturday" {
778               value 6;
779             }
780             enum "Sunday" {
781               value 7;
782             }
783           }
784           description
785             "Each day for which the service is active from stat-time to end-time";
786         }
787         leaf start-time {
788           type string {
789             pattern "\\d{2}:\\d{2}:\\d{2}";
790           }
791           description
792             "start time expressed as hour:min:seconds";
793         }
794         leaf end-time {
795           type string {
796             pattern "\\d{2}:\\d{2}:\\d{2}";
797           }
798           description
799             "end time expressed as hour:min:seconds";
800         }
801       }
802     }
803   }
804
805   grouping routing-metric {
806     container routing-metric {
807       description
808         "Describes the metrics used to route a service.
809          All parameters of integer type, to set the priority of the routing criterion
810          '0' means the criterion is not used,
811          '1'coresponds to the highest priority,
812          '255'coresponds to the lowest priority.
813          Priority might be handled in several way : 1) To select one from several paths with the same metrics,
814          using lower priority metrics until metrics calculated allow the selection; 2) Using priority as
815          a weight for composite metric calculation";
816       leaf wdm-hop-count {
817         type uint8 {
818           range "0..255";
819         }
820         default "1";
821         description
822           "Metric corresponding to the number of hop in the wdm layer";
823       }
824       leaf otn-hop-count {
825         type uint8 {
826           range "0..255";
827         }
828         default "0";
829         description
830           "Metric corresponding to the number of hop in the otn layer";
831       }
832       leaf wdm-load {
833         type uint8 {
834           range "0..255";
835         }
836         default "0";
837         description
838           "Metric corresponding to the load of the wdm layer
839            Can be used to avoid using heavy loaded links ";
840       }
841       leaf otn-load {
842         type uint8 {
843           range "0..255";
844         }
845         default "0";
846         description
847           "Metric corresponding to the load of the otn layer.
848            Can be used to avoid using heavy loaded links/switchs ";
849       }
850       leaf latency {
851         type uint8 {
852           range "0..255";
853         }
854         default "0";
855         description
856           "Metric corresponding to the latency. Total path latency can be calculated from
857            SRLG length of the OMS and the latency introduced by the equipment";
858       }
859       leaf distance {
860         type uint8 {
861           range "0..255";
862         }
863         default "0";
864         description
865           "Metric associated with the distance. Total path distance can be
866            calculated from SRLG length of the OMS";
867       }
868       leaf wdm-TE-metric {
869         type uint8 {
870           range "0..255";
871         }
872         default "0";
873         description
874           "Used when routing shall be performed according to specific pre-defined
875            TE-Metric. Total path metric can be calculated from OMS TE-metric attribute
876            defined in org-openroadm-link module";
877       }
878       leaf adaptation-number {
879         type uint8 {
880           range "0..255";
881         }
882         default "0";
883         description
884           "Metric associated with the adaptation between layers. Total path metric can
885            can be calculated from the total number of transition between layers";
886       }
887       leaf otn-TE-metric {
888         type uint8 {
889           range "0..255";
890         }
891         default "0";
892         description
893           "Used when routing shall be performed according to specific pre-defined
894            metric associated with OTN (OTU/ODU level)";
895       }
896     }
897   }
898
899   grouping service-resiliency {
900     container service-resiliency {
901       leaf resiliency {
902         type identityref {
903           base service-resiliency-type-identity;
904         }
905         description
906           "describes the type of resiliency and the associated layer ";
907       }
908       leaf revertive {
909         when "../resiliency != 'unprotected' and ../resiliency != 'unprotected-diversely-routed'" {
910           description
911             "revertive not applicable when service is neither protected nor restorable";
912         }
913         type boolean;
914         description
915           "defines if the service shall revert to the initial working path
916            after protection or restoration has been triggered and fault condition
917            has disappeared";
918       }
919       leaf wait-to-restore {
920         when "../revertive = 'true'" {
921           description
922             "wait-to-restore applies for service defined as revertive ";
923         }
924         type uint64;
925         units "ms";
926         description
927           "time delay to revert to initial path after conditions for reversion are satisfied";
928       }
929       leaf holdoff-time {
930         when "../resiliency != 'unprotected' and ../resiliency != 'unprotected-diversely-routed'" {
931           description
932             "holdoff-time applies when services are either protected or restorable";
933         }
934         type uint64;
935         units "ms";
936         description
937           "time delay to initiate a protection or restoration event";
938       }
939       leaf pre-calculated-backup-path-number {
940         when "../resiliency = 'restorable' or ../resiliency = 'external-trigger-restorable'" {
941           description
942             "when service is restorable, defines the
943              number of paths that shall be or have been pre-calculated";
944         }
945         type uint8;
946         description
947           "Associated to service-create / reconfigure / feasibility-check rpcs
948            --> defines the target number of backup-paths to be calculated by PCE. This is an
949            optional parameter : operator can provide it to conform with specific engineering rules.
950            If not provided, PCE will evaluate the number of backup path to be provided automously.
951            Associated with service --> gives the effective number of backup-paths
952            returned/calculated by PCE that can be find in topology container";
953       }
954       container coupled-service {
955         when "../resiliency = 'unprotected-diversely-routed'" {
956           description
957             "for unprotected-diversely-routed services only one path is defined.
958              Allows providing a link between services that are coupled
959              through a routing disjonction criterion";
960         }
961         list coupled-services {
962           key "service-index";
963           leaf service-index {
964             type uint16;
965             description
966               "service-number of the service that may be routed disjointly to the considered service";
967           }
968           leaf service-name {
969             type string;
970             description
971               "service-name of the service that may be routed disjointly to the considered service in service-list";
972           }
973           leaf common-id {
974             type string;
975             description
976               "common-id of the service that may be routed disjointly to the considered service in temp-service-list";
977           }
978           leaf version-number {
979             type uint64;
980             description
981               "common-id of the service that may be routed disjointly to the considered service in versioned-service-list";
982           }
983         }
984       }
985     }
986   }
987
988   grouping service {
989     leaf service-name {
990       type string;
991       description
992         "Identifier for the service to be created in
993          the ROADM network, e.g., CLFI, CLCI, etc.";
994     }
995     leaf common-id {
996       type string;
997       description
998         "To be used by the ROADM controller to identify the routing
999          constraints received from planning application (PED).";
1000     }
1001     uses sdnc-request-header;
1002     uses service-resiliency;
1003     uses routing-metric;
1004     leaf connection-type {
1005       type connection-type;
1006       mandatory true;
1007       description
1008         "Connection type";
1009     }
1010     leaf lifecycle-state {
1011       type org-openroadm-common-state-types:lifecycle-state;
1012       description
1013         "Lifecycle State of service. Whether it is planned, deployed, in maintenance, etc.";
1014     }
1015     leaf administrative-state {
1016       type org-openroadm-equipment-states-types:admin-states;
1017       description
1018         "Administrative State: Intended state of service";
1019     }
1020     leaf operational-state {
1021       type org-openroadm-common-state-types:state;
1022       config false;
1023       description
1024         "Operational State: Actual state of service";
1025     }
1026     leaf condition {
1027       type service-condition;
1028       description
1029         "Service Condition: Additional information about the state of the service. Only sent when applicable.";
1030     }
1031     container service-a-end {
1032       uses service-endpoint;
1033     }
1034     container service-z-end {
1035       uses service-endpoint;
1036     }
1037     uses org-openroadm-routing-constraints:routing-constraints;
1038     uses service-information;
1039     leaf latency {
1040       type uint32;
1041       description
1042         "Latency on service";
1043     }
1044     leaf-list fiber-span-srlgs {
1045       type string;
1046       description
1047         "Shared risk link group identifiers";
1048     }
1049     list equipment-srgs {
1050       key "srg-number";
1051       uses org-openroadm-resource-types:srg-number;
1052     }
1053     leaf-list supporting-service-name {
1054       type string;
1055       description
1056         "The service name that this runs over top. If connection-type is service, then this is the related
1057          connection-type = infrastructure service, for example.";
1058     }
1059     leaf current-active-path-id {
1060       type uint8;
1061       description
1062         "defines the current active path : '0' if active path is the working path
1063          id of the active backup path if protection or restoration has been triggered";
1064     }
1065     container topology {
1066       description
1067         "topology corresponds to working-path which is the default path. It defines the initial path
1068          to which services defined as revertive may revert to when the failure condition disappear";
1069       uses org-openroadm-topology:topology;
1070     }
1071     container backup-topology {
1072       list backup-path {
1073         key "backup-path-id";
1074         leaf backup-path-id {
1075           type uint8 {
1076             range "1..255";
1077           }
1078           description
1079             "Several backup paths may be used when backup-paths are pre-calculated.
1080              Backup-path-id avoids 0 which is associated with working path in current-active-path";
1081         }
1082         leaf failure-case-id {
1083           type string;
1084           description
1085             "A failure case Id can be used to associate a backup-path to a specific failure (srlg, OMS,...)";
1086         }
1087         uses org-openroadm-topology:topology;
1088       }
1089     }
1090     container network-topology {
1091       uses org-openroadm-topology:network-topology;
1092     }
1093     container network-backup-topology {
1094       list backup-path {
1095         key "backup-path-id";
1096         leaf backup-path-id {
1097           type uint8 {
1098             range "1..255";
1099           }
1100           description
1101             "Several backup paths may be used when backup-paths are pre-calculated.
1102              Backup-path-id avoids 0 which is associated with working path in current-active-path";
1103         }
1104         leaf failure-case-id {
1105           type string;
1106           description
1107             "A failure case Id can be used to associate a backup-path to a specific failure (srlg, OMS,...)";
1108         }
1109         uses org-openroadm-topology:network-topology;
1110       }
1111     }
1112     leaf is-bandwidth-locked {
1113       type boolean;
1114       default "false";
1115       description
1116         "Bandwidth lock (true, false) indicates whether the service is administratively
1117          prohibited from taking on more capacity - ie whether it can be used as a supporting
1118          service in any new service creations. Unlike administrative status, this does not
1119          impact any previous planned or deployed services.";
1120     }
1121   }
1122
1123   grouping service-notification-result {
1124     leaf service-name {
1125       type string;
1126       description
1127         "Identifier for the service e.g., CLFI, CLCI, etc.";
1128     }
1129     leaf version-number {
1130       type uint64;
1131       description
1132         "Identifier for the versioned service";
1133     }
1134     leaf common-id {
1135       type string;
1136       description
1137         "Identifier for the temp service";
1138     }
1139     leaf actual-date {
1140       type yang:date-and-time;
1141       description
1142         "Actual date and time (if successful)";
1143     }
1144   }
1145
1146   grouping equipment-info {
1147     leaf equipment-identifier {
1148       type string;
1149     }
1150     leaf equipment-type {
1151       type string;
1152       description
1153         "The set of valid value is derived from the equipment-type grouping used in the device model.";
1154     }
1155     leaf equipment-quantity {
1156       type uint32;
1157     }
1158     leaf lifecycle-state {
1159       type org-openroadm-common-state-types:lifecycle-state;
1160     }
1161   }
1162
1163   grouping eventHorizon {
1164     leaf eventHorizonStart {
1165       type yang:date-and-time;
1166       description
1167         "Start time to ensure that the service is routable and viable. Required resources shall
1168          be considered reserved from this time. If not provided, defaults to due-date.";
1169     }
1170     leaf eventHorizonEnd {
1171       type yang:date-and-time;
1172       description
1173         "End time to ensure that the service is routable and viable. Required resources shall
1174          be considered reserved until this time. If not provided, defaults to end-date.";
1175     }
1176   }
1177 }