blob: 035c9260e5aa8bff6a1cfbb58c50fcf51d0f0564 [file] [log] [blame]
Laszlo Papp8b3a5f62017-10-05 13:32:00 +01001module optical-switch {
2 namespace "http://www.polatis.com/yang/optical-switch";
3 prefix opsw;
4
5 import ietf-yang-types {
6 prefix yang;
7 }
8
9 import ietf-inet-types {
10 prefix inet;
11 }
12
13 organization "Polatis Limited";
14 contact
15 "Adam Hughes
16
17 Polatis Limited
18 332/2 Cambridge Science Park
19 Cambridge CB4 0WN
20 United Kingdom
21
22 Phone: +44 (0) 1223 424200
23 Email: yang-support@polatis.com";
24
25 description "Implements the data model for an Optical Circuit Switch";
26
27 revision "2017-08-04" {
28 description " 1. Removed the state and config data dependencies.
29 2. Added new port configuration containers for better performance.
30 3. Deprecated old ports/port container ";
31 }
32
33 revision "2017-06-13" {
34 description "Moved the common typedef into separate yang module";
35 }
36
37 revision "2017-02-09" {
38 description "Added APS container and notifications";
39 }
40
41 revision "2016-04-22" {
42 description "Added support for peer port configuration";
43 }
44
45 revision "2016-02-17" {
46 description "1. Added support for Variable Optical Attenuation
47 2. Defined new portFormat datatype to represent non-zero port Id.
48 3. Changed the default values of power-high-alarm from +100 to +25 and
49 and for power-low-alarm from -100 to -60.";
50 }
51
52 revision "2015-09-14" {
53 description "Initial revision.";
54 }
55
56 typedef namesFormat {
57 type string {
58 pattern "[ -~]{1,128}"; // Trying to be 0x20 to 0x7e (7f is DEL).
59 }
60 description "Characters between 1-128, of printable ascii values, 0x20 07e";
61 }
62
63 typedef namesFormatNullable {
64 type string {
65 pattern "[ -~]{0,128}"; // Trying to be 0x20 to 0x7e (7f is DEL).
66 }
67 description "Characters between 0-128, of printable ascii values, 0x20 07e, so can be nullable";
68 }
69
70 typedef floatFormat2d {
71 type decimal64 {
72 fraction-digits 2;
73 }
74 description "Floating point number, displayed with 2 decimal places.";
75 }
76
77 typedef portFormat {
78 type uint32 {
79 range "1 .. 65535";
80 }
81 }
82
83 typedef PortStatus {
84 type enumeration {
85 enum PO_ENABLED { value 1; }
86 enum PO_DISABLED { value 2; }
87 enum PO_FAILED { value 3; }
88 }
89 description "ENABLED means that light can pass through the port, shutters are open.
90 DISABLED indicates the opposite. FAILED is reported when the port cannot be used.";
91 }
92
93 typedef apsOperationalState {
94 type enumeration {
95 enum ON_WORKING { value 0; }
96 enum WORKING_FAIL { value 1; }
97 enum SWITCH_PROT { value 2; }
98 enum ON_PROTECT { value 3; }
99 enum PROTECT_FAIL { value 4; }
100 enum SWITCH_WORK { value 5; }
101 enum NOT_APPLICABLE { value 6; }
102 }
103 description "Describes the currently operational state of a port in an aps-protection group,
104 be it on the worker, be it on the protected, or be it that both have failed in effect, which is
105 protect failed. Most of the states are for Worker ports, protect ports are marked NOT_APPLICABLE.";
106 }
107
108 typedef apsPortType {
109 type enumeration {
110 enum WORKER { value 1; }
111 enum PROTECT { value 2; }
112 }
113 description "The type of the aps port. They are either a worker, or a port which is protecting one or many
114 working ports.";
115 }
116
117 typedef apsFlags {
118 type bits {
119 bit GLP {position 0;}
120 bit FTP {position 1;}
121 bit FTW {position 2;}
122 bit MTP {position 3;}
123 bit MTW {position 4;}
124 bit DNR {position 5;}
125 }
126 description "Commands which can be sent to an aps-port, they are:
127 GLP - Global Lock Protect
128 FTP - Force switch to Protector
129 FTW - Force switch to Worker
130 MTP - Manual switch To Protector
131 MTW - Manual switch To Worker
132 DNR - Do Not Revert
133 Lack of any of these bits are clear of that status, so a total clear is 000000";
134 }
135
136 typedef hostFormat {
137 type string {
138 pattern "[ -~]{1,64}"; // 0x20 to 07e
139 }
140 description "Characters between 1-64 length, of printable ascii values, 0x20 07e";
141 }
142
143 typedef secretFormat {
144 type string {
145 pattern "[a-zA-Z0-9]{1,128}"; // Alphanumeric
146 }
147 description "Characters between 1-128 length, alphanumeric";
148 }
149
150 container product-information {
151 config false;
152 leaf manufacturer {
153 type string;
154 description "Name of the manufacturer";
155 }
156 leaf serial-number {
157 type string;
158 description "Unique number given to the product during manufacturing.";
159 }
160 leaf model-name {
161 type string;
162 description "Describes the product and the features that the product supports.";
163 }
164 leaf software-version {
165 type string;
166 description "Version of the software that is currently running on the optical switch";
167 }
168 }
169
170 container port-config {
171 list port {
172 key port-id;
173 leaf port-id {
174 type portFormat;
175 description "Unique Id for port";
176 }
177 leaf status {
178 config false;
179 type enumeration {
180 enum UNSUPPORTED { value 0; }
181 enum ENABLED { value 1; }
182 enum DISABLED { value 2; }
183 enum FAILED { value 3; }
184 }
185 description "Status of port. When status is ENABLED optical path is clear and signal
186 passes through. When the status is DISABLED optical signal is blocked. When status
187 is UPSUPPORTED port doesn't have the enable/disable feature on that port. And, when
188 the port has failed to report its status correctly status is FAILED. ";
189 }
190 leaf label {
191 type namesFormatNullable;
192 default "";
193
194 description "When set, notifications sent by the server will include the label.";
195 }
196 leaf peer-port {
197 type namesFormatNullable;
198 default "";
199
200 description "This leaf describes the remote port on another switch to which this
201 port is connected physically through the optical fibres. Management interface can
202 set this parameter to configure the network topology.";
203 }
204 }
205 }
206 rpc port-set-state {
207 input {
208 leaf-list port-enab {
209 type portFormat;
210 description "List of port-ids that will be enabled after the RPC finishes successfully.";
211 }
212 leaf-list port-disab {
213 type portFormat;
214 description "List of port-ids that will be enabled after the RPC finishes successfully.";
215 }
216 }
217 description "This RPC is used to enable or disable an port. When the port is disabled
218 optical signal is blocked. When the port is enabled optical path is clear and signal passes through.";
219 }
220
221 container opm-power {
222 config false;
223 list port {
224 key port-id;
225 leaf port-id {
226 type opsw:portFormat;
227 description "Id of the Switch port with OPM sensors.";
228 }
229 leaf power {
230 type opsw:floatFormat2d;
231 description "Optical signal strength that is read at the OPM sensor. Specified in dbm.";
232 }
233 description "List of OPM sensors that return the optical signal strength in the fibre.";
234 }
235 }
236 container opm-config {
237 list port {
238 key port-id;
239 leaf port-id {
240 type opsw:portFormat;
241 description "Switch port with OPM";
242 }
243 leaf wavelength {
244 type opsw:floatFormat2d {
245 range 1260.0..1640.0;
246 }
247 default 1550.0;
248
249 description "Wavelength against which the power measurements are calibrated.
250 specified in nm.";
251 }
252 leaf offset {
253 type opsw:floatFormat2d {
254 range -100.0..100.0;
255 }
256 default 0;
257
258 description "Offset for the power measurement; the value is added to power
259 monitor measurements when reporting /opsw:ports/opsw:port[]/opsw:opm/opsw:power.
260 Thus, specifying an offset can be used as a means of referencing the power
261 monitors against external meters.
262 It should be noted that the offset feature does NOT impact the behaviour
263 of the alarm or attenuation features:
264 alarm and attenuation settings always operate relative to the actual
265 power monitor readings, i.e. without any user-specified offsets.
266 Specified in dBm.";
267 }
268 leaf averaging-time {
269 type uint32 {
270 range "1..8";
271 }
272 default 4;
273
274 description "Selects the period for which the power average is calculated. Each increment
275 in this value doubles the length of the time for which the OPM power readings are averaged.
276 Setting the value to 1 results in the shortest averaging period, around 10ms.
277 Setting the value to 8 results in the longest averaging period, 128 times greater.";
278 }
279 }
280 }
281 container opm-alarm-config {
282 list port {
283 key port-id;
284 leaf port-id {
285 type opsw:portFormat;
286 description "Switch port with OPM";
287 }
288 leaf mode {
289 type enumeration {
290 enum POWER_ALARM_DISABLED;
291 enum POWER_ALARM_ENABLED;
292 }
293 default POWER_ALARM_DISABLED;
294
295 description "Power alarms or notifications from ports can be individually enabled or disabled.
296 When enabled, Loss of Signal (LOS) or Signal Degrade notifications are generated when power
297 levels cross the set thresholds";
298 }
299 leaf signal-loss-threshold {
300 type opsw:floatFormat2d;
301 default -60.0;
302
303 description "The switch will generate loss of service notifications should the power
304 level go below this threshold. Specified in dBm.";
305 }
306 leaf signal-degrade-threshold {
307 type opsw:floatFormat2d;
308 default -60.0;
309
310 description "The switch can generate warning (signal degrade) notifications should the
311 power level go below the configured warning threshold. Specified in dBm.";
312 }
313 leaf signal-high-threshold {
314 type opsw:floatFormat2d;
315 default 25.0;
316
317 description "The switch will generate notifications should the power level go beyond this
318 level. Specified in dBm.";
319 }
320 leaf alarm-clear-holdoff {
321 type uint32;
322 default 10;
323
324 description "Minimum time (in seconds) for which the optical power level needs
325 to be restored within the power alarm thresholds for the switch to generate
326 an alarm clear notification.";
327 }
328 }
329 }
330
331 container voa {
332 list port {
333 key port-id;
334 leaf port-id {
335 type opsw:portFormat;
336 description "Switch port with VOA";
337 }
338 leaf atten-mode {
339 type enumeration {
340 enum VOA_MODE_NONE { value 0; }
341 enum VOA_MODE_RELATIVE { value 1; }
342 enum VOA_MODE_ABSOLUTE { value 2; }
343 enum VOA_MODE_CONVERGED { value 3; }
344 enum VOA_MODE_MAXIMUM { value 4; }
345 enum VOA_MODE_FIXED { value 5; }
346 }
347 default VOA_MODE_NONE;
348
349 description " VOA_MODE_NONE: Attenuation on the port is disabled. The light on the port will
350 have the actual power level. VOA_MODE_ABSOLUTE: Port will achieve the configured attentuation
351 level and power of the light on the port will have the absolute level configured.
352 VOA_MODE_RELATIVE: Port will achieve the attentuation with respect to the power of the light
353 of the reference port. The actual attenuation achieved depends on the configured level and
354 power of the light of the reference port. VOA_MODE_CONVERGED: This is similar in behaviour to
355 ABSOLUTE mode, but once the attenuation converges to the desired level the switch freezes the
356 VOA control loop. This reduces noise caused by the control loop continually striving to improve
357 the attenuation. VOA_MODE_MAXIMUM: Port will achieve the maximum attenuation level. In this
358 case configured attenuation level is not used. VOA_MODE_FIXED: Disables closed loop updating
359 of the attenuation feature for the specified port. Following issuance of this command, the port
360 will continue to hold their current attenuation level without any optical feedback. Thus, any
361 changes in input power levels will no longer be tracked";
362 }
363 leaf atten-level {
364 when "../atten-mode = 'VOA_MODE_ABSOLUTE' or ../atten-mode = 'VOA_MODE_RELATIVE'" +
365 "or ../atten-mode = 'VOA_MODE_CONVERGED'";
366 type opsw:floatFormat2d;
367 default 0;
368
369 description "The attenuated output level configured for this port. Specified in dBm
370 (or dB for RELATIVE as it is an offset value with respect to reference port).";
371 }
372 leaf reference-port {
373 when "../atten-mode = 'VOA_MODE_RELATIVE'";
374 type uint32;
375 default 0;
376
377 description "Reference port for attenuation (for use with relative attenuation only). If this port
378 is specified as zero then the default reference port will be used. The default port is the ingress
379 to which the egress port being attenuated is connected. For attenuation states other than RELATIVE
380 this data is ignored. When reading this object, a value of zero is returned for all modes other
381 than RELATIVE. For relative attenuation, the value returned is the current reference port in use.";
382 }
383 }
384 }
385
386 container ports {
387 status "deprecated";
388 list port {
389 key port-id;
390 leaf port-id {
391 type portFormat;
392 description "Unique Id for port";
393 }
394 leaf port-label {
395 type namesFormatNullable;
396 description "When set, notifications will include the label.";
397 }
398 leaf port-state {
399 type enumeration {
400 enum PC_ENABLED { value 1; }
401 enum PC_DISABLED { value 2; }
402 }
403 default PC_ENABLED;
404
405 description "State of a port shutter. When port is enabled, shutter is open and
406 when port is disabled, shutter is closed.";
407 }
408 leaf port-status {
409 config false;
410 type PortStatus;
411
412 description "Switch port status. The switch can report FAILED port status when the port fails to
413 correctly report its state";
414 }
415 leaf peer-port {
416 type namesFormatNullable;
417
418 description "This leaf describes the remote port on another switch to which this
419 port is connected physically through the optical fibres. Management interface can
420 set this parameter to configure the network topology.";
421 }
422 container opm {
423 description "Optical Power Monitor (OPM) measures the optical signal strength in the fibre.";
424
425 leaf lambda {
426 type floatFormat2d;
427 default 1550.0;
428
429 description "Wavelength against which the power measurements are calibrated.
430 Specified in nm.";
431 }
432 leaf power-high-alarm {
433 type floatFormat2d;
434 default 25.0;
435
436 description "The switch will generate notifications should the power level go beyond this
437 level. Specified in dBm.";
438 }
439 leaf power-low-alarm {
440 type floatFormat2d;
441 default -60.0;
442
443 description "The switch will generate notifications should the power level go below this
444 level. Specified in dBm.";
445 }
446 leaf power-high-warning-offset {
447 type floatFormat2d;
448 default 0;
449
450 description "The switch will generate (warning) notifications should the power go beyond
451 the set level. This warning offset is subtracted from power-high-alarm to get the warning threshold.
452 A zero value means that warnings are disabled. Specified in dBm.";
453 }
454 leaf power-low-warning-offset {
455 type floatFormat2d;
456 default 0;
457
458 description "The switch can generate (warning) notifications should the power go below
459 the set level. This warning offset is added into power-low-alarm to get the warning threshold.
460 A zero value means that warnings are disabled. Specified in dBm.";
461 }
462 leaf power-alarm-control {
463 type enumeration {
464 enum POWER_ALARM_DISABLED;
465 enum POWER_ALARM_SINGLE;
466 enum POWER_ALARM_CONTINUOUS;
467 }
468 default POWER_ALARM_DISABLED;
469
470 description "Power alarms or notifications from ports can be individually enabled or disabled.
471 When power-alarm-control is POWER_ALARM_SINGLE then only one alarm is generated, following
472 which power-alarm-control reverts to POWER_ALARM_DISABLED.
473 When power-alarm-control is POWER_ALARM_CONTINUOUS then power alarms are always generated
474 when power levels exceed the defined power alarm thresholds.";
475 }
476 leaf power-alarm-status {
477 config false;
478 type enumeration {
479 enum POWER_ALARM_STATUS_OFF;
480 enum POWER_ALARM_STATUS_ARMED;
481 enum POWER_ALARM_STATUS_TRIGGERED;
482 }
483
484 description "POWER_ALARM_STATUS_OFF - Power alarms are not enabled.
485 POWER_ALARM_STATUS_ARMED - Alarms can be generated.
486 POWER_ALARM_STATUS_TRIGGERED - Port has an active alarm. When the alarm
487 clears, power-alarm-status will change to
488 one of POWER_ALARM_STATUS_OFF or
489 POWER_ALARM_STATUS_ARMED depending on the
490 power-alarm-control mode.";
491 }
492 leaf power {
493 config false;
494 type floatFormat2d;
495
496 description "Power readings for this port. Specified in dBm.";
497 }
498 container voa {
499
500 description "Variable Optical Attenuation (VOA) functionality controls the the optical
501 power level of light on the port. It allows to set the desired attenuation level
502 that the port should achieve.";
503
504 leaf attenuation-level {
505 type floatFormat2d;
506 default 0;
507
508 description "The attenuated output level configured for this port. Specified in dBm
509 (or dB for RELATIVE as it is an offset value with respect to reference port).";
510 }
511 leaf attenuation-mode {
512 type enumeration {
513 enum VOA_ATTEN_MODE_NONE { value 1; }
514 enum VOA_ATTEN_MODE_ABSOLUTE { value 2; }
515 enum VOA_ATTEN_MODE_RELATIVE { value 3; }
516 enum VOA_ATTEN_MODE_VENDOR { value 128; }
517 }
518 default VOA_ATTEN_MODE_NONE;
519
520 description " VOA_ATTEN_MODE_NONE: Attenuation on the port is disabled. The light on the
521 port will have the actual power level. VOA_ATTEN_MODE_ABSOLUTE: Port will achieve the configured
522 attentuation level and power of the light on the port will have the absolute level configured.
523 VOA_ATTEN_MODE_RELATIVE: Port will achieve the attentuation with respect to the power of the light
524 of the reference port. The actual attenuation achieved depends on the configured level and power
525 of the light of the reference port. VOA_ATTEN_MODE_VENDOR: This is vendor specific mode.";
526 }
527 leaf attenuation-reference-port {
528 type uint32;
529 default 0;
530
531 description "Reference port for attenuation (for use with relative attenuation only). If this port
532 is specified as zero then the default reference port will be used. The default port is the ingress
533 to which the egress port being attenuated is connected. For attenuation states other than RELATIVE
534 this data is ignored. When reading this object, a value of zero is returned for all modes other
535 than RELATIVE. For relative attenuation, the value returned is the current reference port in use.";
536 }
537 }
538 }
539 }
540 }
541
542 container cross-connects {
543 list pair {
544 key ingress;
545 leaf ingress {
546 type portFormat;
547 description "Input port that makes the connection pair.";
548 }
549 leaf egress {
550 type portFormat;
551 description "Output port that makes the connection pair.";
552 }
553 }
554 description "List of all cross connections in the system.";
555 }
556
557 grouping network-interface-group {
558 leaf ip-address {
559 type inet:ip-address;
560 description "IP address of the switch control plane.";
561 }
562 leaf gateway {
563 type inet:ip-address;
564 description "Gateway address for the switch control plane.";
565 }
566 leaf subnet {
567 type inet:ip-address;
568 description "Subnet to which the switch control plane belongs.";
569 }
570 leaf broadcast {
571 type inet:ip-address;
572 description "Broadcast IP address for the switch control plane.";
573 }
574 }
575
576 container system-config {
577 list interface-status {
578 config false;
579 key name;
580
581 leaf name {
582 type string;
583 description "Unique name of the network interface";
584 }
585 uses network-interface-group;
586 leaf hw-addr {
587 type yang:mac-address;
588 }
589 description "List of Switch network interface and their current running configuration.";
590 }
591 list interface {
592 key name;
593 unique ip-address;
594
595 leaf name {
596 type string;
597 description "Unique name of the network interface";
598 }
599 uses network-interface-group;
600
601 description "List of Switch network interfaces and their user configuration.
602 On system restart, switch will start to use this configuration as their running
603 configuration.";
604 }
605 list user {
606 key name;
607 leaf name {
608 type namesFormat;
609 description "The user name string identifying this entry.";
610 }
611 leaf type {
612 type enumeration {
613 enum RADIUS_USER { value 1; }
614 enum LOCAL_USER { value 2; }
615 }
616 mandatory true;
617 description "Type of user. When set to RADIUS_USER, the user will be authenticated against the radius-servers.
618 When set to LOCAL_USER, user will be authenticated locally.";
619 }
620 leaf password {
621 when "../type != 'RADIUS_USER'";
622
623 type namesFormatNullable;
624 description "The password for this entry. May not be set to empty, but will report empty.
625 If set to 'RADIUS' it will report 'RADIUS', and the user will authenticate against radius-servers.";
626 }
627 list authorized-key {
628 when "../type != 'RADIUS_USER'";
629
630 key name;
631 description "A list of public SSH keys for this user. These keys are allowed for SSH
632 authentication, as described in RFC 4253.";
633 reference "RFC 4253: The Secure Shell (SSH) Transport Layer Protocol";
634 leaf name {
635 type string;
636 description "An arbitrary name for the SSH key.";
637 }
638 leaf algorithm {
639 type string;
640 mandatory true;
641 description "The public key algorithm name for this SSH key. Valid values are the
642 values in the IANA 'Secure Shell (SSH) Protocol Parameters' registry, Public Key
643 Algorithm Names.";
644 reference "IANA 'Secure Shell (SSH) Protocol Parameters' registry, Public Key
645 Algorithm Names";
646 }
647 leaf key-data {
648 type binary;
649 mandatory true;
650 description "The binary public key data for this SSH key, as specified by RFC 4253,
651 Section 6.6, i.e.: string certificate or public key format identifier byte[n]
652 key/certificate data.";
653 reference "RFC 4253: The Secure Shell (SSH) Transport Layer Protocol";
654 }
655 }
656 description "The list of local users configured on this device. This model is adopted from
657 System Management yang model. (https://tools.ietf.org/html/rfc7317)";
658 }
659 container activity-log
660 {
661 leaf log-filter {
662 type bits {
663 bit SYSTEM {position 0;}
664 bit USER {position 1;}
665 bit OXC {position 2;}
666 bit OPM {position 3;}
667 }
668 }
669 leaf log-access {
670 type enumeration {
671 enum NONE { value 0; }
672 enum SELF { value 1; }
673 enum ALL { value 2; }
674 }
675 default NONE;
676 }
677 leaf logging-enabled {
678 type boolean;
679 default false;
680 }
681 }
682 container radius-servers
683 {
684 list radius-server {
685 key "ip-address port";
686
687 leaf ip-address {
688 type inet:ip-address;
689 description "Ip address of the radius server.";
690 }
691 leaf port {
692 type uint32;
693 description "Port of the radius server.";
694 }
695 leaf secret {
696 type secretFormat;
697 mandatory true;
698 description "The secret used to authenticate with the radius server.";
699 }
700 leaf timeout {
701 type uint32 {
702 range "1..30";
703 }
704 default 3;
705 description "Length of time in seconds before timing out on connection to server.";
706 }
707 }
708 description "The list of radius servers for the nic, the order of the list determines the priority of usage.";
709 }
710 container ntp-servers
711 {
712 list ntp-server {
713 key ip-address;
714
715 leaf ip-address {
716 type inet:ip-address;
717 description "The ip address of a ntp server to use";
718 }
719 leaf minpoll {
720 type uint32 {
721 range "4..6";
722 }
723 default 6;
724 description "The minimum polling in seconds";
725 }
726 leaf maxpoll {
727 type uint32 {
728 range "10..17";
729 }
730 default 10;
731 description "The maximum polling in seconds";
732 }
733 leaf version {
734 type uint32 {
735 range "1..4";
736 }
737 default 4;
738 description "The version that the ntp server runs.";
739 }
740 }
741 description "The list of ntp servers in order of usage to get the ntp time";
742 }
743 container remote-syslog
744 {
745 leaf rname {
746 type inet:ipv4-address;
747 description "IPv4 address of remote collector. Use 0.0.0.0 to disable sending. This field will change to inet:host type.";
748 }
749 leaf rport {
750 type inet:port-number;
751 description "UDP port receiving syslog on 'rname'. Set to zero to use the default (514).";
752 }
753 leaf facility {
754 type enumeration {
755 enum USER { value 8; }
756 enum LOCAL0 { value 128; }
757 enum LOCAL1 { value 136; }
758 enum LOCAL2 { value 144; }
759 enum LOCAL3 { value 152; }
760 enum LOCAL4 { value 160; }
761 enum LOCAL5 { value 168; }
762 enum LOCAL6 { value 176; }
763 enum LOCAL7 { value 184; }
764 }
765 default USER;
766 description "The facility to send messages under. See RFC 3164. All values are 8 times the value listed in the RFC, to pack the severity value in the low bits.";
767 }
768 must "(boolean(rname) = true() and string(rname) != '0.0.0.0') or (boolean(rport) = false() or rport = 0)" { error-message "Cannot have port without name"; }
769 description "The destination for syslog messages. ";
770 }
771 container protocols
772 {
773 list protocol {
774 key protocol-id;
775
776 leaf protocol-id {
777 type uint32;
778 }
779 leaf protocol-name {
780 config false;
781 type string;
782 }
783 leaf protocol-type {
784 config false;
785 type string;
786 }
787 leaf protocol-port {
788 config false;
789 type uint32;
790 }
791 leaf enabled {
792 type boolean;
793 default true;
794 }
795 }
796 }
797
798 leaf current-datetime {
799 config false;
800 type yang:date-and-time;
801
802 description "The current system date and time.";
803 }
804 leaf boot-datetime {
805 config false;
806 type yang:date-and-time;
807
808 description "The system date and time when the system last restarted.";
809 }
810
811 leaf alarm-clear-hysteresis {
812 type decimal64 {
813 fraction-digits 2;
814 range "1..5";
815 }
816
817 default 1;
818
819 description "Added to 'power-low-alarm' and subtracted from 'power-high-alarm'
820 to generate alarm clear notifications. Specified in dBm.";
821 }
822
823 }
824
825 // APS config and status
826 container aps
827 {
828 description "Automatic Protection Switching (APS) feature provides optical redundancy on the Polatis switch.
829 When the switch detects signal failure on the primary optical path, it automatically switches to an alternative
830 optical path. The switch also provides manual operation through which the optical paths can be changed.
831 APS feature consists of list of protection service, where each service is list of working and protection ports. ";
832 list protection-service
833 {
834 description "This the list of APS protection services on the system";
835 key sname;
836 leaf sname {
837 type namesFormat;
838 description "Protection Service name. Should be unique on the switch.";
839 }
840 leaf active
841 {
842 config false;
843 type boolean;
844 description "Whether the Protection Service is Active, or in Config mode.";
845 }
846 list working-port
847 {
848 key port-id;
849
850 description "This the list of APS port configurations on the system. This defines the APS service, and
851 generates port-status and protection-services to represent them";
852
853 leaf port-id
854 {
855 type portFormat;
856 }
857 leaf client
858 {
859 type uint32;
860 mandatory true;
861 description "Client port to which the working will connect when the service is activated.";
862 }
863 leaf priority
864 {
865 type uint32;
866 default 0;
867 description "A number to be used when deciding the priority of protection switched when there is contention.";
868 }
869 leaf wtr-timeout
870 {
871 type uint32;
872 default 0;
873 description "Wait To Restore timeout value. The amount, in seconds, before a restore is possible on this port.";
874 }
875 leaf ovs
876 {
877 type boolean;
878 default false;
879 description "Override Valid Signal. Allows us to override the need for a valid signal in manual/automatic switch.";
880 }
881 leaf protected-port
882 {
883 config false;
884
885 type uint32;
886 description "If a worker port, and is currently being protected, it is the port id of the protecting port.
887 If not being protected, it is 0. Vice versa if it is a protecting port.";
888 }
889 leaf operational-state
890 {
891 config false;
892
893 type apsOperationalState;
894 description "The current operational state of the port, being working, protected, protection failed. This does not apply for PROTECTED ports.";
895 }
896 leaf user_command
897 {
898 config false;
899 type apsFlags;
900 }
901 }
902 leaf-list protection-port
903 {
904 type uint32;
905 description "";
906 }
907 }
908 }
909
910 rpc set-current-datetime {
911 description "Set the /product-information/clock/current-datetime leaf to the specified value.
912 Also changes /product-information/clock/boot-datetime, relative to current-datetime";
913 input {
914 leaf current-datetime {
915 type yang:date-and-time;
916 mandatory true;
917 description "The current system date and time.";
918 }
919 }
920 }
921
922 rpc system-restart {
923 description "Request to restart the Network Interface Card (NIC).";
924 input {
925 leaf seconds {
926 type uint32;
927 default 0;
928
929 description "Restart the system in the specified time. Given in seconds.
930 Value of 0 will restart the system immediately, and in that case there
931 won't be any response";
932 }
933 }
934 }
935
936 rpc system-restart-cancel {
937 description "Request to cancel the restart. This has no effect when
938 system-restart was not requested. Cancel is done immediately";
939 }
940
941 // APS rpcs and notification
942 rpc aps-command {
943 description "This is a command to apply flags to a number of ports at the same time.
944 You can provide either the sname of the service, to do all ports for that service, or
945 specify ports, which do not have to be on the same protection service.
946 The command is applied via combination of a bitwise mask and bitwise command values, to set/unset
947 different attributes at the same time. Some combinations are mutually exclusive:
948 GLP/FTP/FTW/MTP/MTW are exclusive to each other.
949
950 Some commands are per port, and some per service (GLP). This is why the choice of a service name, or ports are provided.";
951
952 input {
953 leaf mask {
954 type apsFlags;
955 mandatory true;
956 }
957 leaf flags {
958 type apsFlags;
959 mandatory true;
960 }
961 choice parameter
962 {
963 mandatory true;
964 leaf sname
965 {
966 type namesFormat;
967 }
968 list port
969 {
970 key port-id;
971 leaf port-id { type portFormat; }
972 leaf target-port-id
973 {
974 type uint32;
975 default 0;
976 description "This is an optional parameter, used when a target is also needed, ie: FTP/MTP on
977 M:N protection, where you wish to switch to a specific protection port. It is ignored on other cases.";
978 }
979 description "The port-id is in effect mandatory to specify a source port.";
980 }
981 }
982 }
983 }
984
985 rpc aps-activate {
986 description "Used to activate or deactive a protection service.";
987 input {
988 leaf sname {
989 type namesFormat;
990 }
991 leaf active {
992 type boolean;
993 mandatory true;
994 }
995 }
996 }
997
998 rpc radius-server-set-position {
999 description "Used to change the order of radius-servers.";
1000 input {
1001 leaf ip-address {
1002 type inet:ip-address;
1003 mandatory true;
1004
1005 description "Ip address of the radius server.";
1006 }
1007 leaf port {
1008 type portFormat;
1009 mandatory true;
1010
1011 description "Port of the radius server.";
1012 }
1013 leaf position {
1014 type int32;
1015 mandatory true;
1016
1017 description "Position, either explicit, from 0, or -1 to move to end";
1018 }
1019 }
1020 }
1021 notification aps-notification {
1022 description "This is the notification which is sent whenever an operational state changes.";
1023 leaf notification-type {
1024 type apsOperationalState;
1025 }
1026 leaf notification-details { type string; }
1027 }
1028 container subswitches {
1029 list subswitch {
1030 key "sname";
1031 leaf sname {
1032 type string;
1033 description "The sub-switch name";
1034 }
1035 leaf-list username {
1036 type string;
1037 description "The user associated with the sub-switch";
1038 }
1039 leaf-list port-id {
1040 type uint32;
1041 description "The port number of the sub-switch";
1042 }
1043 }
1044 }
1045}
1046