Honeynode test tool
[transportpce.git] / tests / honeynode / honeynode-plugin-api / src / main / yang / org-openroadm-device@2017-02-06.yang
1 module org-openroadm-device {
2   namespace "http://org/openroadm/device";
3   prefix org-openroadm-device;
4
5   import ietf-yang-types {
6     prefix ietf-yang-types;
7   }
8   import ietf-inet-types {
9     prefix ietf-inet-types;
10   }
11   import ietf-netconf {
12     prefix ietf-nc;
13   }
14   import org-openroadm-common-types {
15     prefix org-openroadm-common-types;
16     revision-date 2016-10-14;
17   }
18   import org-openroadm-resource-types {
19     prefix org-openroadm-resource-types;
20   }
21   import org-openroadm-wavelength-map {
22       prefix org-openroadm-wavelength-map;
23       revision-date 2016-10-14; 
24   }
25   import org-openroadm-physical-types {
26     prefix org-openroadm-physical-types;
27   }
28   import org-openroadm-user-mgmt {
29     prefix org-openroadm-user-mgmt;
30   }
31   import org-openroadm-port-types {
32     prefix org-openroadm-port-types;
33   }
34   import org-openroadm-interfaces {
35     prefix org-openroadm-interfaces;
36   }
37   import org-openroadm-swdl {
38     prefix org-openroadm-swdl;
39   }
40   import org-openroadm-equipment-states-types {
41     prefix org-openroadm-equipment-states-types;
42   }
43
44   organization "Open ROADM MSA";
45   contact
46     "OpenROADM.org";
47   description
48     "YANG definitions of ROADM device
49
50      Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
51      AT&T Intellectual Property.  All other rights reserved.
52
53      Redistribution and use in source and binary forms, with or without modification,
54      are permitted provided that the following conditions are met:
55
56      * Redistributions of source code must retain the above copyright notice, this
57        list of conditions and the following disclaimer.
58      * Redistributions in binary form must reproduce the above copyright notice,
59        this list of conditions and the following disclaimer in the documentation and/or
60        other materials provided with the distribution.
61      * Neither the Members of the Open ROADM MSA Agreement nor the names of its
62        contributors may be used to endorse or promote products derived from this software
63        without specific prior written permission.
64
65      THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
66      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
67      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
68      IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
69      INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
70      NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
71      OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
72      WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
73      ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
74      POSSIBILITY OF SUCH DAMAGE.
75
76      Also contains code components extracted from IETF netconf.  These code components
77      are copyrighted and licensed as follows:
78
79      Copyright (c) 2016 IETF Trust and the persons identified as the document authors.
80      All rights reserved.
81
82      This document is subject to BCP 78 and the IETF Trust’s Legal Provisions Relating
83      to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of
84      publication of this document. Please review these documents carefully, as they
85      describe your rights and restrictions with respect to this document. Code Components
86      extracted from this document must include Simplified BSD License text as described in
87      Section 4.e of the Trust Legal Provisions and are provided without warranty as
88      described in the Simplified BSD License.";
89
90   revision 2017-02-06 {
91     description
92       "Version 1.2.1 - removed pattern for current-datetime in info tree and rpc";
93   }
94
95   revision 2016-10-14 {
96     description
97       "Version 1.2";
98   }
99
100   rpc get-connection-port-trail {
101     input {
102       leaf connection-number {
103         type string;
104         mandatory true;
105       }
106     }
107     output {
108       uses org-openroadm-common-types:rpc-response-status;
109       list ports {
110         uses org-openroadm-common-types:physical-location;
111         uses port-name {
112           refine "circuit-pack-name" {
113             mandatory true;
114           }
115           refine "port-name" {
116             mandatory true;
117           }
118         }
119       }
120     }
121   }
122   rpc disable-automatic-shutoff {
123     input {
124       leaf amp {
125         type leafref {
126           path "/org-openroadm-device/shelves/shelf-name";
127         }
128         mandatory true;
129         description
130           "The shelf where amp is located";
131       }
132       leaf degree-number {
133         type uint16;
134         mandatory true;
135       }
136       leaf support-timer {
137         type uint16 {
138           range "1..600";
139         }
140         default "20";
141       }
142     }
143     output {
144       uses org-openroadm-common-types:rpc-response-status;
145     }
146   }
147   rpc start-scan {
148     input {
149       leaf degree-number {
150         type uint16;
151         mandatory true;
152       }
153       leaf port-direction {
154         type org-openroadm-common-types:direction;
155       }
156       leaf distance {
157         type uint32;
158       }
159       leaf resolution {
160         type uint32;
161       }
162     }
163     output {
164       uses org-openroadm-common-types:rpc-response-status;
165     }
166   }
167
168   notification otdr-scan-result {
169     leaf status {
170       type enumeration {
171         enum "Completed" {
172           value 1;
173         }
174         enum "Failed" {
175           value 2;
176         }
177       }
178       mandatory true;
179       description
180         "Completed or Failed for the scan's final status";
181     }
182     leaf result-file {
183       type string;
184     }
185   }
186
187   rpc set-current-datetime {
188     description
189       "Set the info/current-datetime leaf to the specified value.";
190     input {
191      leaf current-datetime {
192         type ietf-yang-types:date-and-time;
193         mandatory true;
194         description
195           "The current system date and time in UTC. Format: YYYY-MM-DDTHH:MM:SS";
196       }
197     }
198
199     output {
200       uses org-openroadm-common-types:rpc-response-status;
201     }
202   }
203
204   grouping device-common {
205     leaf node-id {
206       type string;
207       description
208         "Globally unique identifer for a device.";
209       default "openroadm";
210     }
211     leaf node-number {
212       type uint32;
213       description
214         "Number assigned to a ROADM node at a
215          given office";
216     }
217     leaf node-type {
218       type org-openroadm-common-types:node-types;
219       description
220         "Identifier for node-type e.g Roadm, xponder";
221       config false;
222       mandatory true;
223     }
224     leaf clli {
225       type string;
226       description
227         "Common Language Location Identifier.";
228     }
229     uses org-openroadm-physical-types:node-info;
230     leaf ipAddress {
231       type ietf-inet-types:ip-address;
232       description
233         "IP Address of device";
234     }
235     leaf prefix-length {
236       type uint8 {
237         range "0..128";
238       }
239       description
240         "The length of the subnet prefix";
241     }
242     leaf defaultGateway {
243       type ietf-inet-types:ip-address;
244       description
245         "Default Gateway";
246     }
247     leaf source {
248       type enumeration {
249         enum "static" {
250           value 1;
251         }
252         enum "dhcp" {
253           value 2;
254         }
255       }
256       config false;
257     }
258     leaf current-ipAddress {
259       type ietf-inet-types:ip-address;
260       config false;
261       description
262         "Current IP Address of device";
263     }
264     leaf current-prefix-length {
265       type uint8 {
266         range "0..128";
267       }
268       config false;
269       description
270         "The current length of the subnet prefix";
271     }
272     leaf current-defaultGateway {
273       type ietf-inet-types:ip-address;
274       config false;
275       description
276         "Current Default Gateway";
277     }
278     leaf macAddress {
279       type ietf-yang-types:mac-address;
280       description
281         "MAC Address of device";
282       config false;
283     }
284     leaf softwareVersion {
285       type string;
286       config false;
287       description
288         "Software version";
289     }
290     leaf template {
291       type string;
292       description
293         "Template information used in the deployment.";
294     }
295     leaf current-datetime {
296       type ietf-yang-types:date-and-time;
297       config false;
298       description
299         "The current system date and time in UTC. Format: YYYY-MM-DDTHH:MM:SS.mm+ ";
300     }
301     container geoLocation {
302       description
303         "GPS location";
304       leaf latitude {
305         type decimal64 {
306           fraction-digits 16;
307           range "-90 .. 90";
308         }
309         description
310           "[From wikipedia] Latitude is an angle (defined below)
311            which ranges from 0° at the Equator to 90° (North or
312            South) at the poles";
313       }
314       leaf longitude {
315         type decimal64 {
316           fraction-digits 16;
317           range "-180 .. 180";
318         }
319         description
320           "[From wikipedia] The longitude is measured as the
321            angle east or west from the Prime Meridian, ranging
322            from 0° at the Prime Meridian to +180° eastward and
323            âˆ’180° westward.";
324       }
325     }
326   }
327
328   grouping slot-info {
329     description
330       "slots information. To be populated by NE during retrieval.";
331     leaf slot-name {
332       type string;
333       description
334         "The name of this slot.";
335     }
336     leaf label {
337       type string;
338       description
339         "Faceplate label";
340     }
341     leaf provisioned-circuit-pack {
342       type leafref {
343         path "/org-openroadm-device/circuit-packs/circuit-pack-name";
344       }
345       description
346         "The supported circuit-pack. It will be empty if no provision on this slot.";
347     }
348   }
349   grouping shelves {
350     list shelves {
351       key "shelf-name";
352       uses shelf;
353     }
354   }
355   grouping shelf {
356     leaf shelf-name {
357       description
358         "Unique identifier for this shelf within a device";
359       type string;
360     }
361     leaf shelf-type {
362       description
363         "The shelf type: describe the shelf with a unique string.";
364       type string;
365       mandatory true;
366     }
367     leaf rack {
368       description
369         "Reflect the shelf physical location data including floor, aisle, bay values.";
370       type string;
371     }
372     leaf shelf-position {
373       description
374         "Reflect the shelf vertical position within an equipment bay.";
375       type string;
376     }
377     leaf administrative-state {
378       description
379         "Admin State of the shelf";
380       type org-openroadm-equipment-states-types:admin-states;
381     }
382     uses org-openroadm-physical-types:common-info;
383     leaf equipment-state {
384       type org-openroadm-equipment-states-types:states;
385       description
386         "equipment state for the shelf, used to track the lifecycle state.";
387     }
388     leaf due-date {
389       type ietf-yang-types:date-and-time;
390       description
391         "due date for the shelf.";
392     }
393     list slots {
394       description
395           "List of slots on this shelf. To be populated by NE during retrieval.";
396       key "slot-name";
397       config false;
398       uses slot-info;
399     }
400   }
401
402   grouping circuit-packs {
403     list circuit-packs {
404       description
405         "List of circuit packs. This includes common equipment, like fans, power supplies, etc.";
406       key "circuit-pack-name";
407       leaf circuit-pack-type {
408         description
409           "Type of circuit-pack";
410         type string;
411         mandatory true;
412       }
413       leaf circuit-pack-product-code {
414         description
415           "Product Code for the circuit-pack";
416         type string;
417       }
418       uses circuit-pack;
419     }
420   }
421
422   grouping circuit-pack {
423     leaf circuit-pack-name {
424       description
425         "Unique identifier for this circuit-pack within a device";
426       type string;
427     }
428     leaf administrative-state {
429       description
430         "Administrative state of circuit-pack";
431       type org-openroadm-equipment-states-types:admin-states;
432     }
433     uses org-openroadm-physical-types:common-info;
434     container circuit-pack-category {
435       description
436         "General type of circuit-pack";
437       uses org-openroadm-common-types:equipment-type;
438       config false;
439     }
440     leaf equipment-state {
441       description
442         "Equipment state, which complements operational state.";
443       type org-openroadm-equipment-states-types:states;
444     }
445     leaf circuit-pack-mode {
446       description
447         "Circuit-pack mode allowed. e.g. NORMAL or REGEN";
448       type string;
449       default "NORMAL";
450     }
451     leaf shelf {
452       type leafref {
453         path "/org-openroadm-device/shelves/shelf-name";
454       }
455       mandatory true;
456     }
457     leaf slot {
458       type string;
459       mandatory true;
460     }
461     leaf subSlot {
462       type string;
463       mandatory false;
464     }
465     leaf due-date {
466       type ietf-yang-types:date-and-time;
467       description
468         "due date for this circuit-pack.";
469     }
470     container parent-circuit-pack {
471       description
472         "In the case of circuit packs that contain other equipment (modules or pluggables), this captures the hierarchy of that equipment.  It is a vendor specific design decision if the ports for single-port pluggables are modeled as children of the parent circuit-pack, or as children of the pluggable circuit-pack contained in the parent circuit-pack.  For modules with multiple ports, it is recommended that ports be children of the module and not the carrier, to help in fault correlation and isolation in the case of a module failure.";
473       uses circuit-pack-name;
474       leaf cp-slot-name {
475         type string;
476         description
477           "Slot name on parent-circuit-pack.";
478       }
479     }
480     list cp-slots {
481       description
482           "List of circuit-pack slots on this circuit-pack. To be populated by NE during retrieval.";
483       key "slot-name";
484       config false;
485       uses slot-info;
486     }
487     list ports {
488       key "port-name";
489       description
490         "List of ports on this circuit-pack.  For single port pluggables, the port may be modeled against the pluggable itself, or against the parent-circuit-pack.  For mulit-port pluggables, it is recommended that ports be modeled against the module itself.  Modeling ports as close to the equipment hierarchy as possible will help in fault correlation and isolation since common failures associated with supporting equipment can be used to help identify symptomatic failures on the contained ports.";
491       uses port;
492       container roadm-port {
493         when "../port-qual='roadm-external'";
494         uses org-openroadm-port-types:roadm-port;
495       }
496       container transponder-port {
497         when "../port-qual='xpdr-network' or ../port-qual='xpdr-client'";
498         uses org-openroadm-port-types:common-port;
499       }
500       container otdr-port {
501         when "../port-qual='otdr'";
502         description
503           "Settings for otdr port.";
504         leaf launch-cable-length {
505           type uint32;
506           default "30";
507           units "m";
508         }
509         leaf port-direction {
510           type org-openroadm-common-types:direction;
511         }
512       }
513     }
514   }
515
516   grouping connection {
517     description
518       "Grouping used to define connections.";
519     leaf connection-number {
520       type string;
521     }
522     leaf wavelength-number {
523       type uint32;
524       mandatory true;
525       description
526         "wavelength-number, can be used to access wavelength-map
527          to get wavelength value in nm.";
528     }
529     leaf opticalControlMode {
530       description
531         "Whether connection is currently in power or gain/loss mode";
532       type org-openroadm-common-types:optical-control-mode;
533       reference "openroadm.org: Open ROADM MSA Specification.";
534       default "off";
535     }
536     leaf target-output-power {
537       type org-openroadm-common-types:power-dBm;
538       description
539         "The output target power for this connection. When set, the ROADM will work to ensure that current-output-power reaches this level.";
540     }
541     container source {
542       leaf src-if {
543         type leafref {
544           path "/org-openroadm-device/interface/name";
545         }
546         mandatory true;
547       }
548     }
549     container destination {
550       leaf dst-if {
551         type leafref {
552           path "/org-openroadm-device/interface/name";
553         }
554         mandatory true;
555       }
556     }
557   }
558
559   grouping degree {
560     leaf degree-number {
561       type uint16;
562       must "not( current() > /org-openroadm-device/info/max-degrees) and current() > 0" {
563         error-message "Degree not supported by device ";
564         description
565           "Validating if the degree is supported by device";
566       }
567     }
568     leaf max-wavelengths {
569       type uint16;
570       description
571         "maximum number of wavelengths";
572       config false;
573       mandatory true;
574     }
575     list circuit-packs {
576       key "index";
577       description
578         "list for Cards associated with a degree";
579       leaf index {
580         type uint32;
581       }
582       uses circuit-pack-name {
583         refine "circuit-pack-name" {
584           mandatory true;
585         }
586       }
587     }
588     list connection-ports {
589       description
590         "Port associated with degree: One if bi-directional; two if uni-directional";
591       key "index";
592       leaf index {
593         type uint32;
594       }
595       uses port-name {
596         refine "circuit-pack-name" {
597           mandatory true;
598         }
599         refine "port-name" {
600           mandatory true;
601         }
602       }
603     }
604     container otdr-port {
605       description
606         "otdr port associated with degree.";
607       uses port-name;
608     }
609   }
610
611   grouping external-links {
612     description
613       "YANG definitions for external links..
614        - physical links between ROADMs and between the ROADMs and XPonders, which can be added and removed maually.";
615     list external-link {
616       key "external-link-name";
617       uses external-link;
618     }
619   }
620
621   grouping external-link {
622     leaf external-link-name {
623       type string;
624     }
625     container source {
626       uses org-openroadm-resource-types:device-id {
627         refine "node-id" {
628           mandatory true;
629         }
630       }
631       uses org-openroadm-resource-types:port-name {
632         refine "circuit-pack-name" {
633           mandatory true;
634         }
635         refine "port-name" {
636           mandatory true;
637         }
638       }
639     }
640     container destination {
641       uses org-openroadm-resource-types:device-id {
642         refine "node-id" {
643           mandatory true;
644         }
645       }
646       uses org-openroadm-resource-types:port-name {
647         refine "circuit-pack-name" {
648           mandatory true;
649         }
650         refine "port-name" {
651           mandatory true;
652         }
653       }
654     }
655   }
656
657   grouping internal-links {
658     list internal-link {
659       key "internal-link-name";
660       config false;
661       uses internal-link;
662     }
663   }
664
665   grouping internal-link {
666     leaf internal-link-name {
667       type string;
668     }
669     container source {
670       uses port-name {
671         refine "circuit-pack-name" {
672           mandatory true;
673         }
674         refine "port-name" {
675           mandatory true;
676         }
677       }
678     }
679     container destination {
680       uses port-name {
681         refine "circuit-pack-name" {
682           mandatory true;
683         }
684         refine "port-name" {
685           mandatory true;
686         }
687       }
688     }
689   }
690
691   grouping physical-links {
692     description
693       "YANG definitions for physical links.
694        - phyical links between cards within a ROADM, which are populated by the ROADM and cannot be added or removed manually. ";
695     list physical-link {
696       key "physical-link-name";
697       uses physical-link;
698     }
699   }
700
701   grouping physical-link {
702     leaf physical-link-name {
703       type string;
704     }
705     container source {
706       uses port-name {
707         refine "circuit-pack-name" {
708           mandatory true;
709         }
710         refine "port-name" {
711           mandatory true;
712         }
713       }
714     }
715     container destination {
716       uses port-name {
717         refine "circuit-pack-name" {
718           mandatory true;
719         }
720         refine "port-name" {
721           mandatory true;
722         }
723       }
724     }
725   }
726
727   grouping srg {
728     leaf max-add-drop-ports {
729       type uint16;
730       config false;
731       mandatory true;
732     }
733     leaf srg-number {
734       type uint16;
735       must "not(current()>/org-openroadm-device/info/max-srgs) and current()>0" {
736         error-message "invalid SRG";
737         description
738           "Validating if the srg is supported by add/drop group";
739       }
740     }
741     leaf wavelengthDuplication {
742       description
743         "Whether the SRG can handle duplicate wavelengths and if so to what extent.";
744       config false;
745       mandatory true;
746       type enumeration {
747         enum "onePerSRG" {
748           description
749             "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.";
750           value 1;
751         }
752         enum "onePerDegree" {
753           description
754             "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.";
755           value 2;
756         }
757       }
758     }
759     list circuit-packs {
760       key "index";
761       description
762         "list for Cards associated with an add/drop group and srg";
763       leaf index {
764         type uint32;
765       }
766       uses circuit-pack-name {
767         refine "circuit-pack-name" {
768           mandatory true;
769         }
770       }
771     }
772   }
773
774   grouping degree-number {
775     leaf degree-number {
776       description
777         "Degree identifier. Unique within the context of a device.";
778       type leafref {
779         path "/org-openroadm-device/degree/degree-number";
780       }
781     }
782   }
783
784   grouping circuit-pack-name {
785     leaf circuit-pack-name {
786       description
787         "Circuit-Pack identifier. Unique within the context of a device.";
788       type leafref {
789         path "/org-openroadm-device/circuit-packs/circuit-pack-name";
790       }
791     }
792   }
793
794   grouping port-name {
795     uses circuit-pack-name;
796     leaf port-name {
797       description
798         "Port identifier. Unique within the context of a circuit-pack.";
799       type leafref {
800         path "/org-openroadm-device/circuit-packs[circuit-pack-name=current()/../circuit-pack-name]/ports/port-name";
801       }
802     }
803   }
804
805   grouping srg-number {
806     leaf srg-number {
807       description
808         "Shared Risk Group identifier. Unique within the context of a device.";
809       type leafref {
810         path "/org-openroadm-device/shared-risk-group/srg-number";
811       }
812     }
813   }
814
815   grouping supporting-port-name {
816     leaf supporting-circuit-pack-name {
817       description
818         "Identifier of the supporting circuit-pack.";
819       type leafref {
820         path "/org-openroadm-device/circuit-packs/circuit-pack-name";
821       }
822       mandatory true;
823     }
824     leaf supporting-port {
825       description
826         "Identifier of the supporting port.";
827       mandatory true;
828       type leafref {
829         path "/org-openroadm-device/circuit-packs[circuit-pack-name=current()/../supporting-circuit-pack-name]/ports/port-name";
830       }
831     }
832   }
833
834   grouping interface-name {
835     leaf interface-name {
836       description
837         "Name of an interface. Unique within the context of a device.";
838       type leafref {
839         path "/org-openroadm-device/interface/name";
840       }
841       config false;
842     }
843   }
844
845   grouping interfaces-grp {
846     description
847       "OpenROADM Interface configuration parameters.";
848     list interface {
849       key "name";
850       description
851         "The list of configured interfaces on the device.";
852       leaf name {
853         type string;
854         description
855           "The name of the interface.";
856       }
857       leaf description {
858         type string;
859         description
860           "A textual description of the interface.";
861       }
862       leaf type {
863         type identityref {
864           base org-openroadm-interfaces:interface-type;
865         }
866         mandatory true;
867         description
868           "The type of the interface.";
869       }
870       leaf administrative-state {
871         type org-openroadm-equipment-states-types:admin-states;
872       }
873       leaf operational-state {
874         type org-openroadm-common-types:state;
875         config false;
876       }
877       leaf circuit-id {
878         type string {
879           length "0..45";
880         }
881         description
882           "circuit identifier/user label,
883            can be used in alarm correlation and/or connection management ";
884       }
885       leaf supporting-interface {
886         type leafref {
887           path "/org-openroadm-device/interface/name";
888         }
889       }
890       uses supporting-port-name;
891     }
892   }
893
894   grouping port {
895     description
896       "Grouping of attributes related to a port object.";
897     leaf port-name {
898       type string;
899       mandatory true;
900       description
901         "Identifier for a port, unique within a circuit pack";
902     }
903     leaf port-type {
904       type string;
905       description
906         "Type of the pluggable or fixed port.";
907     }
908     leaf port-qual {
909       type enumeration {
910         enum "roadm-internal" {
911           value 1;
912         }
913         enum "roadm-external" {
914           value 2;
915         }
916         enum "xpdr-network" {
917           value 3;
918         }
919         enum "xpdr-client" {
920           value 4;
921         }
922         enum "otdr" {
923           value 5;
924         }
925       }
926     }
927     leaf port-wavelength-type {
928       type org-openroadm-port-types:port-wavelength-types;
929       config false;
930       description
931         "Type of port - single, multiple-wavelength, etc.";
932     }
933     leaf port-direction {
934       type org-openroadm-common-types:direction;
935       config false;
936       mandatory true;
937       description
938         "Whether port is uni (tx/rx) or bi-directional and";
939     }
940     leaf label {
941       type string;
942       config false;
943       description
944         "Faceplate label";
945     }
946     leaf circuit-id{
947       type string{
948         length "0..45";
949       }
950       description
951           "circuit identifier/user label,
952            can be used in alarm correlation and/or connection management ";
953
954     }
955     leaf administrative-state {
956       type org-openroadm-equipment-states-types:admin-states;
957       description
958         "Administrative state of port. The value of this field independant of the state of its contained and containing resources.  Setting this a port to administratively down will impact both its operational state, as well the operational state of its contained resources.  If this port is an endpoint to a connection, internal-link, physical-link, etc, then administratevely disabling this port will impact the operational state of those items unless they are using some form of port-protection schema.";
959       default "outOfService";
960     }
961     leaf operational-state {
962       type org-openroadm-common-types:state;
963       config false;
964       mandatory true;
965       description
966         "Operational state of a port";
967     }
968     leaf-list supported-interface-capability {
969       description
970         "Interface types supported on this port";
971       config false;
972       type identityref {
973         base org-openroadm-port-types:supported-if-capability;
974       }
975     }
976     leaf logical-connection-point {
977       type string;
978       description
979         "delete or replace with list logical-ports or connections?";
980     }
981     container partner-port {
982       config false;
983       description
984         "For ports which are not identified as having a direction of bidirectional, this field is used to identify the port which corresponds to the reverse direction. A port pair should include a port for each direction (tx, rx) and report their mate as partner-port.";
985       uses port-name;
986     }
987     container parent-port {
988       config false;
989       description
990         "In the case of port hierarchy, this is the parent port, which is also modeled as port within this circuit-pack. This is used in the case of a port that supports a parallel connector that contains subports.  The parent-port of the subport will be the port that contains this subport.  This can be used to help isolate faults when a single fault on a parallel connector introduces symptomatic failures on the contained subports.";
991       uses port-name;
992     }
993     list interfaces {
994       config false;
995       description
996         "List of the interfaces this port supports.  This is a list of names of instances in the flat instance list";
997       uses interface-name;
998     }
999   }
1000
1001   uses org-openroadm-device-container;
1002
1003   grouping org-openroadm-device-container {
1004     container org-openroadm-device {
1005       container info {
1006         uses device-common;
1007         leaf max-degrees {
1008           type uint16;
1009           description
1010             "Max. number of degrees supported by device";
1011           config false;
1012         }
1013         leaf max-srgs {
1014           type uint16;
1015           description
1016             "Max. number of SRGs in an add/drop group";
1017           config false;
1018         }
1019       }
1020       container users {
1021         description
1022           "Stores a list of users";
1023         uses org-openroadm-user-mgmt:user-profile;
1024       }
1025       container pending-sw {
1026         config false;
1027         uses org-openroadm-swdl:sw-bank;
1028       }
1029       uses shelves;
1030       uses circuit-packs;
1031       uses interfaces-grp;
1032       container protocols {
1033         description
1034           "Contains the supported protocols";
1035       }
1036       container wavelength-map {
1037         description
1038           "The wavelength-number and center frequency, wavelength mapping";
1039         config false;
1040         uses org-openroadm-wavelength-map:wavelength-map-g;
1041       }
1042       uses internal-links;
1043       uses physical-links;
1044       uses external-links;
1045       list degree {
1046         when "/org-openroadm-device/info/node-type='rdm'";
1047         key "degree-number";
1048         uses degree;
1049       }
1050       list shared-risk-group {
1051         when "/org-openroadm-device/info/node-type='rdm'";
1052         key "srg-number";
1053         uses srg;
1054       }
1055       list roadm-connections {
1056         when "/org-openroadm-device/info/node-type='rdm'";
1057         key "connection-number";
1058         uses connection;
1059       }
1060       list connection-map {
1061         key "connection-map-number";
1062         config false;
1063         leaf connection-map-number {
1064           description
1065             "Unique identifier for this connection-map entry";
1066           type uint32;
1067         }
1068         container source {
1069           leaf circuit-pack-name {
1070             type leafref {
1071               path "/org-openroadm-device/circuit-packs/circuit-pack-name";
1072             }
1073             mandatory true;
1074           }
1075           leaf port-name {
1076             description
1077               "Port identifier. Unique within the context of a circuit-pack.";
1078             type leafref {
1079               path "/org-openroadm-device/circuit-packs[circuit-pack-name=current()/../circuit-pack-name]/ports/port-name";
1080             }
1081             mandatory true;
1082           }
1083         }
1084         list destination {
1085           key "circuit-pack-name port-name";
1086           min-elements 1;
1087           leaf circuit-pack-name {
1088             type leafref {
1089               path "/org-openroadm-device/circuit-packs/circuit-pack-name";
1090             }
1091             mandatory true;
1092           }
1093           leaf port-name {
1094             description
1095               "Port identifier. Unique within the context of a circuit-pack.";
1096             type leafref {
1097               path "/org-openroadm-device/circuit-packs[circuit-pack-name=current()/../circuit-pack-name]/ports/port-name";
1098             }
1099             mandatory true;
1100           }
1101         }
1102       }
1103     }
1104   }
1105
1106   grouping common-session-parms {
1107     description
1108       "Common session parameters to identify a
1109        management session.";
1110
1111     leaf username {
1112       type string;
1113       mandatory true;
1114       description
1115         "Name of the user for the session.";
1116     }
1117
1118     leaf session-id {
1119       type ietf-nc:session-id-or-zero-type;
1120       mandatory true;
1121       description
1122         "Identifier of the session.
1123          A NETCONF session MUST be identified by a non-zero value.
1124          A non-NETCONF session MAY be identified by the value zero.";
1125     }
1126
1127     leaf source-host {
1128       type ietf-inet-types:ip-address;
1129       description
1130         "Address of the remote host for the session.";
1131     }
1132   }
1133   grouping changed-by-parms {
1134     description
1135       "Common parameters to identify the source
1136        of a change event, such as a configuration
1137        or capability change.";
1138
1139      container changed-by {
1140        description
1141          "Indicates the source of the change.
1142           If caused by internal action, then the
1143           empty leaf 'server' will be present.
1144           If caused by a management session, then
1145           the name, remote host address, and session ID
1146           of the session that made the change will be reported.";
1147        choice server-or-user {
1148          leaf server {
1149            type empty;
1150            description
1151              "If present, the change was caused
1152               by the server.";
1153          }
1154
1155          case by-user {
1156            uses common-session-parms;
1157          }
1158        } // choice server-or-user
1159      } // container changed-by-parms
1160   }
1161   notification change-notification {
1162     description
1163       "The Notification that a resource has been added, modified or removed.
1164        This notification can be triggered by changes in configuration and operational data.
1165        It shall contain the changed field pointed by the xpath.
1166        Typically it is not intended for frequently changing volatile data e.g. PM, power levels";
1167
1168     leaf change-time {
1169       description "The time the change occurs.";
1170       type ietf-yang-types:date-and-time;
1171     }
1172     uses changed-by-parms;
1173
1174     leaf datastore {
1175       type enumeration {
1176         enum running {
1177           description "The <running> datastore has changed.";
1178         }
1179         enum startup {
1180           description "The <startup> datastore has changed";
1181         }
1182       }
1183       default "running";
1184       description
1185         "Indicates which configuration datastore has changed.";
1186     }
1187     list edit {
1188       description
1189         "An edit (change) record SHOULD be present for each distinct
1190          edit operation that the server has detected on
1191          the target datastore.  This list MAY be omitted
1192          if the detailed edit operations are not known.
1193          The server MAY report entries in this list for
1194          changes not made by a NETCONF session.";
1195
1196       leaf target {
1197         type instance-identifier;
1198         description
1199             "Topmost node associated with the configuration or operationa change.
1200              A server SHOULD set this object to the node within
1201              the datastore that is being altered.  A server MAY
1202              set this object to one of the ancestors of the actual
1203              node that was changed, or omit this object, if the
1204              exact node is not known.";
1205       }
1206       leaf operation {
1207         type ietf-nc:edit-operation-type;
1208         description
1209           "Type of edit operation performed.
1210          A server MUST set this object to the NETCONF edit
1211          operation performed on the target datastore.";
1212       }
1213     } // list edit
1214   } // notification change-notification
1215 }