aboutsummaryrefslogtreecommitdiffstats
path: root/sdnr/wt/devicemanager-openroadm/provider/src/main/yang/org-openroadm-device.yang
blob: 0180be8f54b25ffac56e57aad9cb4c7cd6795220 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
module org-openroadm-device {
  namespace "http://org/openroadm/device";
  prefix org-openroadm-device;

  import ietf-yang-types {
    prefix ietf-yang-types;
    revision-date 2013-07-15;
  }
  import ietf-inet-types {
    prefix ietf-inet-types;
    revision-date 2013-07-15;
  }
  import ietf-netconf {
    prefix ietf-nc;
    revision-date 2011-06-01;
  }
  import org-openroadm-common-types {
    prefix org-openroadm-common-types;
    revision-date 2019-11-29;
  }
  import org-openroadm-common-alarm-pm-types {
    prefix org-openroadm-common-alarm-pm-types;
    revision-date 2019-11-29;
  }
  import org-openroadm-common-equipment-types {
    prefix org-openroadm-common-equipment-types;
    revision-date 2019-11-29;
  }
  import org-openroadm-common-state-types {
    prefix org-openroadm-common-state-types;
    revision-date 2019-11-29;
  }
  import org-openroadm-common-amplifier-types {
    prefix org-openroadm-common-amplifier-types;
    revision-date 2019-11-29;
  }
  import org-openroadm-common-link-types {
    prefix org-openroadm-common-link-types;
    revision-date 2019-11-29;
  }
  import org-openroadm-common-node-types {
    prefix org-openroadm-common-node-types;
    revision-date 2019-11-29;
  }
  import org-openroadm-common-optical-channel-types {
    prefix org-openroadm-common-optical-channel-types;
    revision-date 2019-11-29;
  }
  import org-openroadm-device-types {
    prefix org-openroadm-device-types;
    revision-date 2019-11-29;
  }
  import org-openroadm-resource-types {
    prefix org-openroadm-resource-types;
    revision-date 2019-11-29;
  }
  import org-openroadm-physical-types {
    prefix org-openroadm-physical-types;
    revision-date 2019-11-29;
  }
  import org-openroadm-user-mgmt {
    prefix org-openroadm-user-mgmt;
    revision-date 2019-11-29;
  }
  import org-openroadm-port-types {
    prefix org-openroadm-port-types;
    revision-date 2019-11-29;
  }
  import org-openroadm-interfaces {
    prefix org-openroadm-interfaces;
    revision-date 2019-11-29;
  }
  import org-openroadm-swdl {
    prefix org-openroadm-swdl;
    revision-date 2019-11-29;
  }
  import org-openroadm-equipment-states-types {
    prefix org-openroadm-equipment-states-types;
    revision-date 2019-11-29;
  }
  import org-openroadm-switching-pool-types {
    prefix org-openroadm-switching-pool-types;
    revision-date 2019-11-29;
  }

  organization
    "Open ROADM MSA";
  contact
    "OpenROADM.org";
  description
    "YANG definitions of ROADM device
     Copyright of the Members of the Open ROADM MSA Agreement dated (c) 2016,
     All other rights reserved.
     Redistribution and use in source and binary forms, with or without modification,
     are permitted provided that the following conditions are met:
     * Redistributions of source code must retain the above copyright notice, this
       list of conditions and the following disclaimer.
     * Redistributions in binary form must reproduce the above copyright notice,
       this list of conditions and the following disclaimer in the documentation and/or
       other materials provided with the distribution.
     * Neither the Members of the Open ROADM MSA Agreement nor the names of its
       contributors may be used to endorse or promote products derived from this software
       without specific prior written permission.
     THIS SOFTWARE IS PROVIDED BY THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT ''AS IS''
     AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     IN NO EVENT THE MEMBERS OF THE OPEN ROADM MSA  AGREEMENT BE LIABLE FOR ANY DIRECT,
     INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;  LOSS OF USE, DATA,
     OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     POSSIBILITY OF SUCH DAMAGE.
     Also contains code components extracted from IETF netconf.  These code components
     are copyrighted and licensed as follows:
     Copyright (c) 2016 IETF Trust and the persons identified as the document authors.
     All rights reserved.
     This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating
     to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of
     publication of this document. Please review these documents carefully, as they
     describe your rights and restrictions with respect to this document. Code Components
     extracted from this document must include Simplified BSD License text as described in
     Section 4.e of the Trust Legal Provisions and are provided without warranty as
     described in the Simplified BSD License.";

  revision 2019-11-29 {
    description
      "Version 6.1.0";
  }
  revision 2019-09-27 {
    description
      "Version 6.0.0";
  }
  revision 2019-05-31 {
    description
      "Version 5.1.0";
  }
  revision 2019-03-29 {
    description
      "Version 5.0.0";
  }
  revision 2018-11-30 {
    description
      "Version 4.1.0";
  }
  revision 2018-09-28 {
    description
      "Version 4.0.0";
  }
  revision 2018-05-30 {
    description
      "Version 3.1.0";
  }
  revision 2018-03-30 {
    description
      "Version 3.0.0";
  }
  revision 2017-12-15 {
    description
      "Version 2.2";
  }
  revision 2017-09-29 {
    description
      "Version 2.1";
  }
  revision 2017-07-28 {
    description
      "Version 2.0.1 - added revision-date to imports";
  }
  revision 2017-06-26 {
    description
      "Version 2.0";
  }
  revision 2017-02-06 {
    description
      "Version 1.2.1 - removed pattern for current-datetime in info tree and rpc";
  }
  revision 2016-10-14 {
    description
      "Version 1.2";
  }

  identity connection-direction-identity {
    description
      "Bidrectional capable, or Bi and Unidirectional capable";
  }

  identity connection-direction_bi {
    base connection-direction-identity;
    description
      "Bidrectional capable";
  }

  identity connection-direction_bi_and_uni {
    base connection-direction-identity;
    description
      "Bi and Unidirectional capable";
  }

  typedef interface-ref {
    type leafref {
      path "/org-openroadm-device:org-openroadm-device/org-openroadm-device:interface/org-openroadm-device:name";
    }
    description
      "This type is used by data models that need to reference
       configured interfaces.";
  }

  grouping create-tech-info-group {
    leaf shelf-id {
      type leafref {
        path "/org-openroadm-device/shelves/shelf-name";
      }
      description
        "shelf ID";
    }
    leaf log-file-name {
      type string;
      description
        "The log file name a vendor can specify for a given log collection operation";
    }
  }

  grouping device-common {
    leaf node-id {
      type org-openroadm-common-node-types:node-id-type;
      default "openroadm";
      description
        "Globally unique identifier for a device.";
    }
    leaf node-number {
      type uint32;
      description
        "Number assigned to a ROADM node at a
         given office";
    }
    leaf node-type {
      type org-openroadm-device-types:node-types;
      config true;
      mandatory true;
      description
        "Identifier for node-type e.g Roadm, xponder.
         Once the node-type is configured, it should not be modified.";
    }
    leaf clli {
      type string;
      description
        "Common Language Location Identifier.";
    }
    uses org-openroadm-physical-types:node-info;
    leaf ipAddress {
      type ietf-inet-types:ip-address;
      description
        "IP Address of device";
    }
    leaf prefix-length {
      type uint8 {
        range "0..128";
      }
      description
        "The length of the subnet prefix";
    }
    leaf defaultGateway {
      type ietf-inet-types:ip-address;
      description
        "Default Gateway";
    }
    leaf source {
      type enumeration {
        enum static {
          value 1;
        }
        enum dhcp {
          value 2;
        }
      }
      config false;
    }
    leaf current-ipAddress {
      type ietf-inet-types:ip-address;
      config false;
      description
        "Current IP Address of device";
    }
    leaf current-prefix-length {
      type uint8 {
        range "0..128";
      }
      config false;
      description
        "The current length of the subnet prefix";
    }
    leaf current-defaultGateway {
      type ietf-inet-types:ip-address;
      config false;
      description
        "Current Default Gateway";
    }
    leaf macAddress {
      type ietf-yang-types:mac-address;
      config false;
      description
        "MAC Address of device";
    }
    leaf softwareVersion {
      type string;
      config false;
      description
        "Software version";
    }
    leaf software-build {
      type string;
      config false;
      description
        "Software build version";
    }
    leaf openroadm-version {
      type org-openroadm-common-types:openroadm-version-type;
      config false;
      description
        "openroadm version used on the device";
    }
    leaf template {
      type string;
      description
        "Template information used in the deployment.";
    }
    leaf current-datetime {
      type ietf-yang-types:date-and-time;
      config false;
      description
        "The current system date and time in UTC. Format: YYYY-MM-DDTHH:MM:SS.mm+ ";
    }
    leaf lifecycle-state {
      type org-openroadm-common-state-types:lifecycle-state;
      description
        "Lifecycle State of the device node. Whether it is planned, deployed, in maintenance, etc.";
    }
    container geoLocation {
      description
        "GPS location";
      leaf latitude {
        type decimal64 {
          fraction-digits 16;
          range "-90 .. 90";
        }
        description
          "[From wikipedia] Latitude is an angle (defined below)
           which ranges from 0 at the Equator to 90 (North or
           South) at the poles";
      }
      leaf longitude {
        type decimal64 {
          fraction-digits 16;
          range "-180 .. 180";
        }
        description
          "[From wikipedia] The longitude is measured as the
           angle east or west from the Prime Meridian, ranging
           from 0 at the Prime Meridian to +180 eastward and
           -180 westward.";
      }
    }
  }

  grouping slot-info {
    description
      "slots information. To be populated by NE during retrieval.";
    leaf slot-name {
      type string;
      description
        "The name of this slot.";
    }
    leaf label {
      type string;
      description
        "Faceplate label";
    }
    leaf provisioned-circuit-pack {
      type leafref {
        path "/org-openroadm-device/circuit-packs/circuit-pack-name";
      }
      description
        "The supported circuit-pack. It will be empty if holder status is empty-not-prov, or installed-not-prov";
    }
    leaf slot-status {
      type enumeration {
        enum empty-not-prov {
          value 1;
          description
            "Slot is empty and not provisioned";
        }
        enum empty-prov-match {
          value 2;
          status deprecated;
          description
            "(Deprecated) Slot is empty and expected type is provisioned";
        }
        enum empty-prov-mismatch {
          value 3;
          status deprecated;
          description
            "(Deprecated) Slot is empty and an unsupported type is provisioned";
        }
        enum installed-not-prov {
          value 4;
          description
            "Slot is occupied but not provisioned";
        }
        enum installed-prov-match {
          value 5;
          description
            "Slot is occupied with matching provisioned type";
        }
        enum installed-prov-mismatch {
          value 6;
          description
            "Slot is occupied with mismatched provisioned type";
        }
        enum empty-prov {
          value 7;
          description
            "Slot is empty and provisioned";
        }
      }
    }
  }

  grouping shelves {
    list shelves {
      key "shelf-name";
      uses shelf;
    }
  }

  grouping user-description-grp {
    description
      "user description group";
    leaf user-description {
      type string;
      description
        "user provided description";
    }
  }

  grouping shelf {
    leaf shelf-name {
      type string;
      description
        "Unique identifier for this shelf within a device";
    }
    leaf shelf-type {
      type string;
      mandatory true;
      description
        "The shelf type: describe the shelf with a unique string.";
    }
    leaf rack {
      type string;
      description
        "Reflect the shelf physical location data including floor, aisle, bay values.";
    }
    leaf shelf-position {
      type string;
      description
        "Reflect the shelf vertical position within an equipment bay.";
    }
    leaf lifecycle-state {
      type org-openroadm-common-state-types:lifecycle-state;
      description
        "Lifecycle State of shelf. Whether it is planned, deployed, in maintenance, etc.";
    }
    leaf administrative-state {
      type org-openroadm-equipment-states-types:admin-states;
      mandatory true;
      description
        "Admin State of the shelf";
    }
    uses org-openroadm-physical-types:common-info;
    leaf equipment-state {
      type org-openroadm-equipment-states-types:states;
      description
        "equipment state for the shelf, used to track the lifecycle state.";
    }
    leaf is-physical {
      type boolean;
      config false;
      mandatory true;
      description
        "is the entity physical or logical";
    }
    leaf is-passive {
      type boolean;
      config false;
      mandatory true;
      description
        "is the entity passive and not actively managed by the device;
         e.g., no physical inventory or plug-in notification supported";
    }
    leaf faceplate-label {
      type string;
      config false;
      mandatory true;
      description
        "label on the faceplace silk screening";
    }
    uses user-description-grp;
    leaf due-date {
      type ietf-yang-types:date-and-time;
      description
        "due date for the shelf.";
    }
    list slots {
      key "slot-name";
      config false;
      description
        "List of slots on this shelf. To be populated by NE during retrieval.";
      uses slot-info;
    }
  }

  grouping circuit-packs {
    list circuit-packs {
      key "circuit-pack-name";
      description
        "List of circuit packs. This includes common equipment, like fans, power supplies, etc.";
      leaf circuit-pack-type {
        type string;
        mandatory true;
        description
          "Type of circuit-pack";
      }
      leaf circuit-pack-product-code {
        type string;
        description
          "Product Code for the circuit-pack";
      }
      uses circuit-pack;
    }
  }

  grouping circuit-pack-features {
    leaf software-load-version {
      type string;
      config false;
      description
        "Software version running on the circuit pack.";
    }
    list circuit-pack-features {
      key "to-be-deleted";
      config false;
      leaf to-be-deleted {
        type string;
        description
        "Key to be deleted.";
      }
      container feature {
        description
          "List of features supported by the installed load and indications on whether the features have been applied or not.";
        leaf description {
          type string;
          description
            "Feature description.";
        }
        leaf boot {
          type boolean;
          description
            "Flag to indicate boot loader or unprotected firmware update required";
        }
        leaf activated {
          type boolean;
          description
            "Indicator if the feature has been activated.";
        }
      }
    }
    list circuit-pack-components {
      key "to-be-deleted";
      config false;
      leaf to-be-deleted {
        type string;
        description
        "Key to be deleted.";
      }
      container component {
        description
          "Optional list of components on the circuit-pack and the load information applicable to those components.  If a load is not up to date and will upgrade when a cold restart occurs, the version that will be applied should also be listed.  If there is no misalignment, this does not need to be reported.";
        leaf name {
          type string;
          description
            "Name of a component on the circuit-pack that can have a load applied to it.";
        }
        leaf boot {
          type boolean;
          description
            "Flag to indicate boot loader or unprotected firmware update required";
        }
        leaf current-version {
          type string;
          description
            "Name of the load version currently running on the component.";
        }
        leaf version-to-apply {
          type string;
          description
            "Name of the load version for the component that will be applied when cold restart occurs on the circuit-pack.";
        }
      }
    }
  }

  grouping circuit-pack {
    leaf circuit-pack-name {
      type string;
      description
        "Unique identifier for this circuit-pack within a device";
    }
    leaf lifecycle-state {
      type org-openroadm-common-state-types:lifecycle-state;
      description
        "Lifecycle State of circuit-pack. Whether it is planned, deployed, in maintenance, etc.";
    }
    leaf administrative-state {
      type org-openroadm-equipment-states-types:admin-states;
      mandatory true;
      description
        "Administrative state of circuit-pack";
    }
    uses org-openroadm-physical-types:common-info;
    container circuit-pack-category {
      config false;
      description
        "General type of circuit-pack";
      uses org-openroadm-common-equipment-types:equipment-type;
    }
    leaf equipment-state {
      type org-openroadm-equipment-states-types:states;
      description
        "Equipment state, which complements operational state.";
    }
    leaf circuit-pack-mode {
      type string;
      default "NORMAL";
      description
        "Circuit-pack mode allowed. e.g. NORMAL or REGEN";
    }
    leaf shelf {
      type leafref {
        path "/org-openroadm-device/shelves/shelf-name";
      }
      mandatory true;
    }
    leaf slot {
      type string;
      mandatory true;
    }
    leaf subSlot {
      type string;
      mandatory false;
    }
    leaf is-pluggable-optics {
      type boolean;
      config false;
      mandatory true;
      description
        "True if circuitpack is pluggable optics";
    }
    leaf is-physical {
      type boolean;
      config false;
      mandatory true;
      description
        "is the entity physical or logical";
    }
    leaf is-passive {
      type boolean;
      config false;
      mandatory true;
      description
        "is the entity passive and not actively managed by the device;
         e.g., no physical inventory or plug-in notification supported";
    }
    leaf faceplate-label {
      type string;
      config false;
      mandatory true;
      description
        "label on the faceplace silk screening";
    }
    uses user-description-grp;
    leaf due-date {
      type ietf-yang-types:date-and-time;
      description
        "due date for this circuit-pack.";
    }
    container parent-circuit-pack {
      description
        "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.";
      uses circuit-pack-name-g;
      leaf cp-slot-name {
        type string;
        description
          "Slot name on parent-circuit-pack.";
      }
    }
    list cp-slots {
      key "slot-name";
      config false;
      description
        "List of circuit-pack slots on this circuit-pack. To be populated by NE during retrieval.";
      uses slot-info;
      leaf slot-type {
        type enumeration {
          enum pluggable-optics-holder {
            value 1;
            description
              "slot accepts dedicated pluggable port circuit-pack";
          }
          enum other {
            value 2;
            description
              "slot accepts parent circuit-pack";
          }
        }
      }
    }
    uses circuit-pack-features;
    list ports {
      key "port-name";
      description
        "List of ports on this circuit-pack. Note that pluggables are considered independent circuit-packs.  All ports that are physically present on a pluggable, need to be modeled as a port against that pluggable circuit-pack, and not against the parent circuit-pack.";
      uses port;
      container roadm-port {
        when "../port-qual='roadm-external'";
        uses org-openroadm-port-types:roadm-port;
      }
      container transponder-port {
        when "../port-qual='xpdr-network' or ../port-qual='xpdr-client' or ../port-qual='switch-network' or ../port-qual='switch-client'";
        uses org-openroadm-port-types:common-port;
      }
      container otdr-port {
        when "../port-qual='otdr'";
        description
          "Settings for otdr port.";
        leaf launch-cable-length {
          type uint32;
          units "m";
          default "30";
        }
        leaf port-direction {
          type org-openroadm-common-alarm-pm-types:direction;
        }
      }
      container ila-port {
        when "../port-qual='ila-external'";
        uses org-openroadm-port-types:common-port;
      }
    }
  }

  grouping odu-connection {
    description
      "Grouping used to define odu-connections.";
    leaf connection-name {
      type string;
      description
        "roadm-connection and odu-connection share the same resource-type and resource definition (e.g. connection)";
    }
    leaf direction {
      type enumeration {
        enum unidirectional {
          value 1;
        }
        enum bidirectional {
          value 2;
        }
      }
      default "bidirectional";
      description
        "Directionality of connection. If bidirectional, both directions are created.";
    }
    container source {
      leaf src-if {
        type leafref {
          path "/org-openroadm-device/interface/name";
        }
        mandatory true;
      }
    }
    container destination {
      leaf dst-if {
        type leafref {
          path "/org-openroadm-device/interface/name";
        }
        mandatory true;
      }
    }
  }

  grouping connection {
    description
      "Grouping used to define connections.";
    leaf connection-name {
      type string;
    }
    leaf opticalControlMode {
      type org-openroadm-common-link-types:optical-control-mode;
      default "off";
      description
        "Whether connection is currently in power or gain/loss mode";
      reference "openroadm.org: Open ROADM MSA Specification.";
    }
    leaf target-output-power {
      type org-openroadm-common-link-types:power-dBm;
      description
        "The output target power for this connection. When set, the ROADM will work to ensure that current-output-power reaches this level.";
    }
    container source {
      leaf src-if {
        type leafref {
          path "/org-openroadm-device/interface/name";
        }
        mandatory true;
      }
    }
    container destination {
      leaf dst-if {
        type leafref {
          path "/org-openroadm-device/interface/name";
        }
        mandatory true;
      }
    }
  }

  grouping mc-capabilities-grp {
    description
      "Media channel capabilities grouping";
    leaf-list mc-capabilities {
      type leafref {
        path "/org-openroadm-device/mc-capability-profile/profile-name";
      }
      config false;
      description
        "Media channel capabilities";
    }
  }

  grouping degree {
    leaf degree-number {
      type uint16;
      must 'not( current() > /org-openroadm-device/info/max-degrees) and current() > 0' {
        error-message "Degree not supported by device ";
        description
          "Validating if the degree is supported by device";
      }
    }
    leaf lifecycle-state {
      type org-openroadm-common-state-types:lifecycle-state;
      description
        "Lifecycle State of degree. Whether it is planned, deployed, in maintenance, etc.";
    }
    leaf max-wavelengths {
      type uint16;
      config false;
      mandatory true;
      description
        "maximum number of wavelengths";
    }
    list circuit-packs {
      key "index";
      description
        "list for Cards associated with a degree";
      leaf index {
        type uint32;
      }
      uses circuit-pack-name-g {
        refine "circuit-pack-name" {
          mandatory true;
        }
      }
    }
    list connection-ports {
      key "index";
      description
        "Port associated with degree: One if bi-directional; two if uni-directional";
      leaf index {
        type uint32;
      }
      uses port-name {
        refine "circuit-pack-name" {
          mandatory true;
        }
        refine "port-name" {
          mandatory true;
        }
      }
    }
    container otdr-port {
      description
        "otdr port associated with degree.";
      uses port-name;
    }
    uses mc-capabilities-grp;
  }

  grouping amplifier {
    leaf amp-number {
      type uint8 {
        range "1..128";
      }
      description
        "Unique identifier/number for the amplifier entry which corresponds to a logical amplifier";
    }
    leaf amp-type {
      type org-openroadm-common-amplifier-types:amplifier-types;
      config false;
      mandatory true;
      description
        "Amplifier type";
    }
    leaf control-mode {
      type org-openroadm-common-amplifier-types:line-amplifier-control-mode;
      default "off";
      description
        "Whether the line amplifier is currently in off or gainLoss mode. control-mode can only be set to gainLoss when target-gain, target-tilt and egress-average-channel-power are set and the OMS interfaces are provisioned. The amplifier will be turned off when the control-mode is set to off";
    }
    leaf amp-gain-range {
      type org-openroadm-common-amplifier-types:amplifier-gain-range;
      default "gain-range-1";
      config false;
      description
        "Amplifier gain-range (gain-range 1 to 4 for switched gain amplifiers)
         gain-range-1 (default value) for standard amplifiers";
    }
    leaf target-gain {
      type org-openroadm-common-link-types:ratio-dB;
      config true;
      description
        "Target overall Amplifier Signal gain, excluding ASE, including VOA attenuation.
         Defined as optional for ODL support, but shall be considered as mandatory and provided
         by the controller when the control-mode is set to gainLoss for amplifier setting";
    }
    leaf target-tilt {
      type org-openroadm-common-link-types:ratio-dB;
      config true;
      description
        "Target tilt configured in case of smart EDFA.
         Tilt value provided as specified in Open-ROADM-MSA-specifications spreadsheet
         Defined as optional for ODL support, but shall be considered as mandatory and provided
         by the controller when the control-mode is set to gainLoss for amplifier setting";
    }
    leaf egress-average-channel-power {
      type org-openroadm-common-link-types:power-dBm;
      config true;
      description
        "Based upon the total max power across the 4.8 THz passband.
         Defined as optional for ODL support, but shall be considered as mandatory and provided
         by the controller when the control-mode is set to gainLoss for amplifier setting";
    }
    leaf out-voa-att {
      type org-openroadm-common-link-types:ratio-dB;
      config false;
      description
        "Used to provide the value output VOA attenuation, optional";
    }
    leaf partner-amp {
      type leafref {
        path "/org-openroadm-device/line-amplifier/amp-number";
      }
      config false;
      description
        "amp-number of amp module that is functionally associated to the amplifier
         in the opposite direction";
    }
    leaf ila-direction-label {
      type string;
      description
        "Amplifier direction. Each operators may have its own naming convention.
         Shall be consistent with tx-instance-port-direction-label and rx-instance-port-direction-label.";
    }
    leaf lifecycle-state {
      type org-openroadm-common-state-types:lifecycle-state;
      description
        "Lifecycle State of the amplifier. Whether it is planned, deployed, in maintenance, etc.";
    }
  }

  grouping external-links {
    description
      "YANG definitions for external links..
       - physical links between ROADMs and between the ROADMs and XPonders, which can be added and removed manually.";
    list external-link {
      key "external-link-name";
      uses external-link;
    }
  }

  grouping external-link {
    leaf external-link-name {
      type string;
    }
    container source {
      uses org-openroadm-resource-types:device-id {
        refine "node-id" {
          mandatory true;
        }
      }
      uses org-openroadm-resource-types:port-name {
        refine "circuit-pack-name" {
          mandatory true;
        }
        refine "port-name" {
          mandatory true;
        }
      }
    }
    container destination {
      uses org-openroadm-resource-types:device-id {
        refine "node-id" {
          mandatory true;
        }
      }
      uses org-openroadm-resource-types:port-name {
        refine "circuit-pack-name" {
          mandatory true;
        }
        refine "port-name" {
          mandatory true;
        }
      }
    }
  }

  grouping internal-links {
    list internal-link {
      key "internal-link-name";
      config false;
      uses internal-link;
    }
  }

  grouping internal-link {
    leaf internal-link-name {
      type string;
    }
    container source {
      uses port-name {
        refine "circuit-pack-name" {
          mandatory true;
        }
        refine "port-name" {
          mandatory true;
        }
      }
    }
    container destination {
      uses port-name {
        refine "circuit-pack-name" {
          mandatory true;
        }
        refine "port-name" {
          mandatory true;
        }
      }
    }
  }

  grouping physical-links {
    description
      "YANG definitions for physical links.
       - physical links (fiber, cables,etc.) between ports within a node. ";
    list physical-link {
      key "physical-link-name";
      uses physical-link;
    }
  }

  grouping physical-link {
    leaf physical-link-name {
      type string;
    }
    leaf is-physical {
      type boolean;
      description
        "is the entity physical or logical";
    }
    uses user-description-grp;
    container source {
      uses port-name {
        refine "circuit-pack-name" {
          mandatory true;
        }
        refine "port-name" {
          mandatory true;
        }
      }
    }
    container destination {
      uses port-name {
        refine "circuit-pack-name" {
          mandatory true;
        }
        refine "port-name" {
          mandatory true;
        }
      }
    }
    leaf lifecycle-state {
      type org-openroadm-common-state-types:lifecycle-state;
      description
        "Lifecycle State of the physical link. Whether it is planned, deployed, in maintenance, etc.";
    }
  }

  grouping srg {
    leaf max-add-drop-ports {
      type uint16;
      config false;
      mandatory true;
      description
        "The max number of ports available for a given srg";
    }
    leaf current-provisioned-add-drop-ports {
      type uint16;
      config false;
      mandatory true;
      description
        "The number of ports currently provisioned for a given srg.";
    }
    leaf srg-number {
      type uint16;
      must 'not(current()>/org-openroadm-device/info/max-srgs) and current()>0' {
        error-message "invalid SRG";
        description
          "Validating if the srg is supported by add/drop group";
      }
    }
    leaf lifecycle-state {
      type org-openroadm-common-state-types:lifecycle-state;
      description
        "Lifecycle State of shared-risk-group. Whether it is planned, deployed, in maintenance, etc.";
    }
    leaf wavelength-duplication {
      type org-openroadm-common-optical-channel-types:wavelength-duplication-type;
      config false;
      mandatory true;
      description
        "Whether the SRG can handle duplicate wavelengths and if so to what extent.";
    }
    list circuit-packs {
      key "index";
      description
        "list for Cards associated with an add/drop group and srg";
      leaf index {
        type uint32;
      }
      uses circuit-pack-name-g {
        refine "circuit-pack-name" {
          mandatory true;
        }
      }
    }
    uses mc-capabilities-grp;
  }

  grouping xponder {
    leaf xpdr-number {
      type uint16;
      must 'current() > 0' {
        error-message "Xponder not supported by device ";
        description
          "Validating if the Xponder is supported by device";
      }
    }
    leaf xpdr-type {
      type org-openroadm-device-types:xpdr-node-types;
      mandatory true;
      description
        "Identifier for xponder-type e.g Transponder, Muxponder";
    }
    leaf lifecycle-state {
      type org-openroadm-common-state-types:lifecycle-state;
      description
        "Lifecycle State of xponder. Whether it is planned, deployed, in maintenance, etc.";
    }
    leaf recolor {
      type boolean;
      config false;
      description
        "Indication if recolor is supported";
    }
    list xpdr-port {
      key "index";
      description
        "Network Ports with in a Xponder";
      leaf index {
        type uint32;
      }
      uses port-name {
        refine "circuit-pack-name" {
          mandatory true;
        }
        refine "port-name" {
          mandatory true;
        }
      }
      leaf eqpt-srg-id {
        type uint32;
        description
          "Shared Risk Group identifier. All ports in a circuit-pack will have same srg-id";
      }
    }
  }

  grouping degree-number {
    leaf degree-number {
      type leafref {
        path "/org-openroadm-device/degree/degree-number";
      }
      description
        "Degree identifier. Unique within the context of a device.";
    }
  }

  grouping circuit-pack-name-g {
    leaf circuit-pack-name {
      type leafref {
        path "/org-openroadm-device/circuit-packs/circuit-pack-name";
      }
      description
        "Circuit-Pack identifier. Unique within the context of a device.";
    }
  }

  grouping port-name {
    uses circuit-pack-name-g;
    leaf port-name {
      type leafref {
        path "/org-openroadm-device/circuit-packs[circuit-pack-name=current()/../circuit-pack-name]/ports/port-name";
      }
      description
        "Port identifier. Unique within the context of a circuit-pack.";
    }
  }

  grouping srg-number {
    leaf srg-number {
      type leafref {
        path "/org-openroadm-device/shared-risk-group/srg-number";
      }
      description
        "Shared Risk Group identifier. Unique within the context of a device.";
    }
  }

  grouping supporting-port-name {
    leaf supporting-circuit-pack-name {
      type leafref {
        path "/org-openroadm-device/circuit-packs/circuit-pack-name";
      }
      description
        "Identifier of the supporting circuit-pack.";
    }
    leaf supporting-port {
      type leafref {
        path "/org-openroadm-device/circuit-packs[circuit-pack-name=current()/../supporting-circuit-pack-name]/ports/port-name";
      }
      description
        "Identifier of the supporting port.";
    }
  }

  grouping supporting-circuit-pack-list-grp {
    description
      "supporting circuit pack list grouping";
    list supporting-port-list {
      key "index";
      description
        "supporting port list";
      leaf index {
        type uint8;
        description
          "supporting circuit pack index";
      }
      leaf circuit-pack-name {
        type leafref {
          path "/org-openroadm-device/circuit-packs/circuit-pack-name";
        }
        mandatory true;
        description
          "The supported circuit-pack. It will be empty if holder status is empty-not-prov, or installed-not-prov";
      }
      leaf-list port-list {
        type leafref {
          path "/org-openroadm-device/circuit-packs[circuit-pack-name=current()/../circuit-pack-name]/ports/port-name";
        }
        description
          "port list";
      }
    }
  }

  grouping interface-name {
    description
      "interface name grouping";
    leaf interface-name {
      type leafref {
        path "/org-openroadm-device/interface/name";
      }
      config false;
      description
        "Name of an interface. Unique within the context of a device.";
    }
  }

  grouping interfaces-grp {
    description
      "OpenROADM Interface configuration parameters.";
    list interface {
      key "name";
      description
        "The list of configured interfaces on the device.";
      leaf name {
        type string;
        description
          "The name of the interface.";
      }
      leaf description {
        type string;
        description
          "A textual description of the interface.";
      }
      leaf type {
        type identityref {
          base org-openroadm-interfaces:interface-type;
        }
        mandatory true;
        description
          "The type of the interface.";
      }
      leaf lifecycle-state {
        type org-openroadm-common-state-types:lifecycle-state;
        description
          "Lifecycle State of interface. Whether it is planned, deployed, in maintenance, etc.";
      }
      leaf administrative-state {
        type org-openroadm-equipment-states-types:admin-states;
        mandatory true;
      }
      leaf operational-state {
        type org-openroadm-common-state-types:state;
        config false;
        mandatory true;
      }
      leaf circuit-id {
        type string {
          length "0..45";
        }
        description
          "circuit identifier/user label,
           can be used in alarm correlation and/or connection management ";
      }
      leaf supporting-interface {
        type leafref {
          path "/org-openroadm-device/interface/name";
        }
        description
          "supporting interface";
      }
      uses supporting-port-name;
      leaf-list supporting-interface-list {
        type leafref {
          path "/org-openroadm-device/interface/name";
        }
        description
          "supporting interface list";
      }
      uses supporting-circuit-pack-list-grp;
    }
  }

  grouping protection-groups {
    description
      "OpenROADM facility protection configuration parameters.";
    container protection-grps {
      description
        "The list of configured protection groups on the device.";
    }
  }

  grouping port {
    description
      "Grouping of attributes related to a port object.";
    leaf port-name {
      type string;
      mandatory true;
      description
        "Identifier for a port, unique within a circuit pack";
    }
    uses supporting-circuit-pack-list-grp;
    leaf port-type {
      type string;
      description
        "Type of the pluggable or fixed port.";
    }
    leaf port-qual {
      type org-openroadm-device-types:port-qual;
    }
    leaf port-wavelength-type {
      type org-openroadm-port-types:port-wavelength-types;
      config false;
      description
        "Type of port - single, multiple-wavelength, etc.";
    }
    leaf port-direction {
      type org-openroadm-common-alarm-pm-types:direction;
      config false;
      mandatory true;
      description
        "Whether port is uni (tx/rx) or bi-directional and";
    }
    leaf label {
      type string;
      config false;
      status deprecated;
      description
        "Faceplate label";
    }
    leaf is-physical {
      type boolean;
      config false;
      mandatory true;
      description
        "is the entity physical or logical";
    }
    leaf faceplate-label {
      type string;
      config false;
      mandatory true;
      description
        "label on the faceplace silk screening";
    }
    uses user-description-grp;
    leaf circuit-id {
      type string {
        length "0..45";
      }
      description
        "circuit identifier/user label,
         can be used in alarm correlation and/or connection management ";
    }
    leaf lifecycle-state {
      type org-openroadm-common-state-types:lifecycle-state;
      description
        "Lifecycle State of port. Whether it is planned, deployed, in maintenance, etc.";
    }
    leaf administrative-state {
      type org-openroadm-equipment-states-types:admin-states;
      default "outOfService";
      description
        "Administrative state of port. The value of this field independent 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 administratively disabling this port will impact the operational state of those items unless they are using some form of port-protection schema.";
    }
    leaf operational-state {
      type org-openroadm-common-state-types:state;
      config false;
      mandatory true;
      description
        "Operational state of a port";
    }
    leaf-list supported-interface-capability {
      type identityref {
        base org-openroadm-port-types:supported-if-capability;
      }
      config false;
      description
        "Interface types supported on this port";
    }
    leaf logical-connection-point {
      type string;
      description
        "delete or replace with list logical-ports or connections?";
    }
    container partner-port {
      config false;
      description
        "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.";
      uses port-name;
    }
    container parent-port {
      config false;
      description
        "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.";
      uses port-name;
    }
    list interfaces {
      key "interface-name";
      config false;
      description
        "List of the interfaces this port supports.  This is a list of names of instances in the flat instance list.  Implementations must provide the list of interfaces for port that has interfaces provisioned on that port.";
      uses interface-name;
    }
    uses mc-capabilities-grp;
  }

  // grouping org-openroadm-device-container-g {
    container org-openroadm-device {
      container info {
        uses device-common;
        leaf max-degrees {
          type uint16;
          config false;
          description
            "Max. number of degrees supported by device";
        }
        leaf max-srgs {
          type uint16;
          config false;
          description
            "Max. number of SRGs in an add/drop group";
        }
        leaf max-num-bin-15min-historical-pm {
          type uint16;
          config false;
          description
            "Max. number of bin the NE support for 15min historical PM";
        }
        leaf max-num-bin-24hour-historical-pm {
          type uint16;
          config false;
          description
            "Max. number of bin the NE support for 24hour historical PM";
        }
      }
      container users {
        description
          "Stores a list of users";
        uses org-openroadm-user-mgmt:user-profile;
      }
      container pending-sw {
        config false;
        description
          "pending software information";
        uses org-openroadm-swdl:sw-bank;
      }
      container database-info {
        config false;
        description
          "database restore information";
        uses org-openroadm-swdl:database-info-group;
      }
      uses shelves;
      uses circuit-packs;
      uses interfaces-grp;
      uses protection-groups;
      container protocols {
        description
          "Contains the supported protocols";
        leaf lifecycle-state {
          type org-openroadm-common-state-types:lifecycle-state;
          description
            "Lifecycle State of the protocols. Whether it is planned or deployed, etc.";
        }
      }
      uses internal-links;
      uses physical-links;
      uses external-links;
      list degree {
        when "/org-openroadm-device/info/node-type='rdm'";
        key "degree-number";
        uses degree;
      }
      list shared-risk-group {
        when "/org-openroadm-device/info/node-type='rdm'";
        key "srg-number";
        uses srg;
      }
      list line-amplifier {
        when "/org-openroadm-device/info/node-type='ila'";
        key "amp-number";
        description
          "lists amplifiers in different directions";
        uses amplifier;
        list circuit-pack {
          key "index";
          description
            "list for Cards associated with an amplifier";
          leaf index {
            type uint32;
          }
          uses circuit-pack-name-g {
            refine "circuit-pack-name" {
              mandatory true;
            }
          }
        }
        list line-port {
          key "port-direction";
          description
            "Port associated with an amplifier which face the line (ila-external): traffic port.";
          leaf port-direction {
            type org-openroadm-common-alarm-pm-types:direction;
            config true;
            mandatory true;
            description
              "partly allows identifying ports associated with logical amp :TX for egress, RX for ingress
               TXRX in case of bidirectional port";
          }
          leaf tx-instance-port-direction-label {
            type string;
            config true;
            description
              "Complements ports identification. Used notably in case of bidirectional ports,
               and/or in multi-degree amplifier nodes. Allows associating one of the directions
               specified in ila-direction-label. Shall be consistent with ila-direction-label";
          }
          leaf rx-instance-port-direction-label {
            type string;
            config true;
            description
              "Complements ports identification. Used notably in case of bidirectional ports,
               and/or in multi-degree amplifier nodes. Allows associating one of the directions
               specified in ila-direction-label. Shall be consistent with ila-direction-label";
          }
          uses port-name {
            refine "circuit-pack-name" {
              mandatory true;
            }
            refine "port-name" {
              mandatory true;
            }
          }
        }
        list osc-port {
          key "port-direction";
          description
            "Ports associated with OSC";
          leaf port-direction {
            type org-openroadm-common-alarm-pm-types:direction;
            config true;
            mandatory true;
            description
              "allows identifying ports associated with logical amp :
               TX for OSC circuit-pack IN RX for OSC circuit-pack OUT";
          }
          uses port-name {
            refine "circuit-pack-name" {
              mandatory true;
            }
            refine "port-name" {
              mandatory true;
            }
          }
        }
        list otdr-port {
          key "otdr-direction";
          description
            "otdr ports associated with an ILA";
          leaf otdr-direction {
            type string;
            config true;
            description
              "allows identifying associated logical amp port in which OTDR is launched:
               corresponds to rx-instance-port-direction-label of corresponding amplifier line-port";
          }
          uses port-name {
            refine "circuit-pack-name" {
              mandatory true;
            }
            refine "port-name" {
              mandatory true;
            }
          }
        }
      }
      list xponder {
        when "/org-openroadm-device/info/node-type='xpdr'";
        key "xpdr-number";
        uses xponder;
      }
      list roadm-connections {
        when "/org-openroadm-device/info/node-type='rdm'";
        key "connection-name";
        uses connection;
      }
      list odu-connection {
        when "/org-openroadm-device/info/node-type='xpdr'";
        key "connection-name";
        uses odu-connection;
      }
      list connection-map {
        key "connection-map-number";
        config false;
        leaf connection-map-number {
          type uint32;
          description
            "Unique identifier for this connection-map entry";
        }
        container source {
          leaf circuit-pack-name {
            type leafref {
              path "/org-openroadm-device/circuit-packs/circuit-pack-name";
            }
            mandatory true;
          }
          leaf port-name {
            type leafref {
              path "/org-openroadm-device/circuit-packs[circuit-pack-name=current()/../circuit-pack-name]/ports/port-name";
            }
            mandatory true;
            description
              "Port identifier. Unique within the context of a circuit-pack.";
          }
        }
        list destination {
          key "circuit-pack-name port-name";
          min-elements 1;
          leaf circuit-pack-name {
            type leafref {
              path "/org-openroadm-device/circuit-packs/circuit-pack-name";
            }
            mandatory true;
          }
          leaf port-name {
            type leafref {
              path "/org-openroadm-device/circuit-packs[circuit-pack-name=current()/../circuit-pack-name]/ports/port-name";
            }
            mandatory true;
            description
              "Port identifier. Unique within the context of a circuit-pack.";
          }
        }
      }
      list odu-switching-pools {
        when "/org-openroadm-device/info/node-type='xpdr'";
        key "switching-pool-number";
        config false;
        leaf switching-pool-number {
          type uint16;
          description
            "Unique identifier for this odu-switching-pool";
        }
        leaf switching-pool-type {
          type org-openroadm-switching-pool-types:switching-pool-types;
          description
            "Blocking/Non-Blocking";
        }
        leaf odu-connection-direction-capabilities {
          type identityref {
            base connection-direction-identity;
          }
          description
            "Bidrectional capable, or Bi and Unidirectional capable";
        }
        list non-blocking-list {
          key "nbl-number";
          config false;
          description
            "List of ports in a non-blocking switch element";
          leaf nbl-number {
            type uint16;
            description
              "Identifier for this non-blocking-list. Unique within odu-switching-pool";
          }
          leaf interconnect-bandwidth-unit {
            type uint32;
            config false;
            description
              "Switch fabric interconnect bandwidth unit rate in bits per second.
               Represents granularity of switch fabric";
          }
          leaf interconnect-bandwidth {
            type uint32;
            config false;
            description
              "Total interconnect bandwidth for a non-blocking element expressed as
               number of inter-connect-bandwidth units";
          }
          list port-list {
            key "circuit-pack-name port-name";
            leaf circuit-pack-name {
              type leafref {
                path "/org-openroadm-device/circuit-packs/circuit-pack-name";
              }
              config false;
            }
            leaf port-name {
              type leafref {
                path "/org-openroadm-device/circuit-packs/ports/port-name";
              }
              config false;
              description
                "Port name. Unique within device";
            }
          }
          list pluggable-optics-holder-list {
            key "circuit-pack-name slot-name";
            leaf circuit-pack-name {
              type leafref {
                path "/org-openroadm-device/circuit-packs/circuit-pack-name";
              }
              config false;
              description
                "Name of parent circuit-pack";
            }
            leaf slot-name {
              type leafref {
                path "/org-openroadm-device/circuit-packs/cp-slots/slot-name";
              }
              config false;
              description
                "Name of pluggable-optics-holder";
            }
          }
        }
      }
      list mc-capability-profile {
        key "profile-name";
        config false;
        description
          "Media channel capability profile list";
        leaf profile-name {
          type string;
          description
            "Media channel profile name";
        }
        leaf center-freq-granularity {
          type org-openroadm-common-optical-channel-types:frequency-GHz;
          default "50";
          config false;
          description
            "Granularity of allowed center frequencies.  The base frequency for this computation is 193.1 THz (G.694.1)";
        }
        leaf min-edge-freq {
          type org-openroadm-common-optical-channel-types:frequency-THz;
          config false;
          description
            "Minimum edge frequency";
        }
        leaf max-edge-freq {
          type org-openroadm-common-optical-channel-types:frequency-THz;
          config false;
          description
            "Maximum edge frequency";
        }
        leaf slot-width-granularity {
          type org-openroadm-common-optical-channel-types:frequency-GHz;
          default "50";
          config false;
          description
            "Width of a slot measured in GHz.";
        }
        leaf min-slots {
          type uint32;
          default "1";
          config false;
          description
            "Minimum number of slots permitted to be joined together to form a media channel.  Must be less than or equal to the max-slots";
        }
        leaf max-slots {
          type uint32;
          default "1";
          config false;
          description
            "Maximum number of slots permitted to be joined together to form a media channel.  Must be greater than or equal to the min-slots";
        }
      }
    }
  // }

  grouping common-session-parms {
    description
      "Common session parameters to identify a
       management session.";
    leaf username {
      type org-openroadm-user-mgmt:username-type;
      mandatory true;
      description
        "Name of the user for the session.";
    }
    leaf session-id {
      type ietf-nc:session-id-or-zero-type;
      mandatory true;
      description
        "Identifier of the session.
         A NETCONF session MUST be identified by a non-zero value.
         A non-NETCONF session MAY be identified by the value zero.";
    }
    leaf source-host {
      type ietf-inet-types:ip-address;
      description
        "Address of the remote host for the session.";
    }
  }

  grouping changed-by-parms {
    description
      "Common parameters to identify the source
       of a change event, such as a configuration
       or capability change.";
    container changed-by {
      description
        "Indicates the source of the change.
         If caused by internal action, then the
         empty leaf 'server' will be present.
         If caused by a management session, then
         the name, remote host address, and session ID
         of the session that made the change will be reported.";
      choice server-or-user {
        leaf server {
          type empty;
          description
            "If present, the change was caused
             by the server.";
        }
        case by-user {
          uses common-session-parms;
        }
      }
    }
  }

  rpc led-control {
    description
      "This command is used to allow user to find an entity on the NE,
       The specified entity will have LED blinking.
       The equipmentLedOn alarm will be raised and cleared for the indication";
    input {
      choice equipment-entity {
        mandatory true;
        case shelf {
          leaf shelf-name {
            type leafref {
              path "/org-openroadm-device/shelves/shelf-name";
            }
            mandatory true;
            description
              "shelf-name for the operation";
          }
        }
        case circuit-pack {
          leaf circuit-pack-name {
            type leafref {
              path "/org-openroadm-device/circuit-packs/circuit-pack-name";
            }
            mandatory true;
            description
              "circuit-pack-name for the operation";
          }
        }
      }
      leaf enabled {
        type boolean;
        mandatory true;
        description
          "led-control enabled flag.
           when enabled=true,  equipmentLedOn alarm will be raised
           when enabled=false, equipmentLedOn alarm will be cleared";
      }
    }
    output {
      uses org-openroadm-common-types:rpc-response-status;
    }
  }
  rpc create-tech-info {
    description
      "Collects all log data for debugging and place it in a location accessible via ftp/sftp.
       This model assumes ASYNC operation, i.e. the command will return after the device accepts the command,
       A create-tech-info-notification will be send out later for the result of the operation.
       The log-file is cleared at the start of every create-tech-info operation in order to ensure
       the up-to-date logs are collected. If a vendor does not support concurrent log collection, the second
       create-tech-info command will be rejected.";
    input {
      leaf shelf-id {
        type leafref {
          path "/org-openroadm-device/shelves/shelf-name";
        }
        description
          "This optional field is used to specify the shelf for log collection.
           When this filed is not provided, it is expected to collect logs for the whole node.
           Vendor should reject the command if the whole node log collection is not supported.";
      }
      leaf log-option {
        type string;
        description
          "The log type a vendor can specify. Maybe used in future";
      }
    }
    output {
      uses create-tech-info-group;
      uses org-openroadm-common-types:rpc-response-status;
    }
  }
  rpc get-connection-port-trail {
    input {
      leaf connection-name {
        type string;
        mandatory true;
      }
    }
    output {
      uses org-openroadm-common-types:rpc-response-status;
      list ports {
        uses org-openroadm-device-types:physical-location;
        uses port-name {
          refine "circuit-pack-name" {
            mandatory true;
          }
          refine "port-name" {
            mandatory true;
          }
        }
      }
    }
  }
  rpc disable-automatic-shutoff {
    input {
      choice degree-or-amp {
        mandatory true;
        description
          "The choice describes the option to specify the entity for the disable-automatic-shutoff RPC. It can be degree-number for rdm and amp-number for ila";
        case degree {
          leaf degree-number {
            type leafref {
              path "/org-openroadm-device/degree/degree-number";
            }
            mandatory true;
            description
              "The degree-number defined in degree";
          }
        }
        case amp {
          leaf amp-number {
            type leafref {
              path "/org-openroadm-device/line-amplifier/amp-number";
            }
            mandatory true;
            description
              "The amp-number defined in line-amplifier";
          }
        }
      }
      leaf support-timer {
        type uint16 {
          range "1..600";
        }
        default "20";
      }
    }
    output {
      uses org-openroadm-common-types:rpc-response-status;
    }
  }
  rpc start-scan {
    input {
      choice degree-or-amp {
        mandatory true;
        description
          "The choice describes the option to specify the entity for the start-scan RPC. It can be degree-number for rdm and amp-number for ila";
        case degree {
          leaf degree-number {
            type leafref {
              path "/org-openroadm-device/degree/degree-number";
            }
            mandatory true;
            description
              "The degree-number defined in degree";
          }
        }
        case amp {
          leaf amp-number {
            type leafref {
              path "/org-openroadm-device/line-amplifier/amp-number";
            }
            mandatory true;
            description
              "The amp-number defined in line-amplifier";
          }
        }
      }
      leaf port-direction {
        type org-openroadm-common-alarm-pm-types:direction;
      }
      leaf distance {
        type uint32;
      }
      leaf resolution {
        type uint32;
      }
    }
    output {
      uses org-openroadm-common-types:rpc-response-status;
    }
  }
  rpc set-current-datetime {
    description
      "Set the info/current-datetime leaf to the specified value.";
    input {
      leaf current-datetime {
        type ietf-yang-types:date-and-time;
        mandatory true;
        description
          "The current system date and time in UTC. Format: YYYY-MM-DDTHH:MM:SS";
      }
    }
    output {
      uses org-openroadm-common-types:rpc-response-status;
    }
  }
  notification create-tech-info-notification {
    description
      "This Notification is sent when the create-tech-info is complete or failed.";
    uses create-tech-info-group;
    uses org-openroadm-common-types:rpc-response-status;
  }
  notification otdr-scan-result {
    description
      "This Notification is sent when the otdr-scan-result is complete or failed.";
    uses org-openroadm-common-types:rpc-response-status;
    leaf result-file {
      type string;
    }
  }
  notification change-notification {
    description
      "The Notification that a resource has been added, modified or removed.
       This notification can be triggered by changes in configuration and operational data.
       It shall contain the changed field pointed by the xpath.
       Typically it is not intended for frequently changing volatile data e.g. PM, power levels";
    leaf change-time {
      type ietf-yang-types:date-and-time;
      description
        "The time the change occurs.";
    }
    uses changed-by-parms;
    leaf datastore {
      type enumeration {
        enum running {
          description
            "The <running> datastore has changed.";
        }
        enum startup {
          description
            "The <startup> datastore has changed";
        }
      }
      default "running";
      description
        "Indicates which configuration datastore has changed.";
    }
    list edit {
      description
        "An edit (change) record SHOULD be present for each distinct
         edit operation that the server has detected on
         the target datastore.  This list MAY be omitted
         if the detailed edit operations are not known.
         The server MAY report entries in this list for
         changes not made by a NETCONF session.";
      leaf target {
        type instance-identifier;
        description
          "Top most node associated with the configuration or operational change.
           A server SHOULD set this object to the node within
           the datastore that is being altered.  A server MAY
           set this object to one of the ancestors of the actual
           node that was changed, or omit this object, if the
           exact node is not known.";
      }
      leaf operation {
        type ietf-nc:edit-operation-type;
        description
          "Type of edit operation performed.
           A server MUST set this object to the NETCONF edit
           operation performed on the target datastore.";
      }
    }
  }
 // uses org-openroadm-device-container-g;
}