blob: 34b2c4cbc389ee6cb57ecb41f6601118127fc001 [file] [log] [blame]
Laszlo Pappbd0779f2018-03-28 18:08:51 +01001module polatis-switch {
2 namespace "http://www.polatis.com/yang/polatis-switch";
3 prefix plts;
4
5 import optical-switch {
6 prefix opsw;
7 }
8
9 import ietf-yang-types {
10 prefix yang;
11 }
12
13 import ietf-inet-types {
14 prefix inet;
15 }
16
17 organization "Polatis Limited";
18 contact
19 "Adam Hughes
20
21 Polatis Limited
22 332/2 Cambridge Science Park
23 Cambridge CB4 0WN
24 United Kingdom
25
26 Phone: +44 (0) 1223 424200
27 Email: yang-support@polatis.com";
28
29 description "This module describes features that are specific to Polatis optical switches";
30
31 revision "2018-01-19" {
32 description "1. Added support for session management and control. Removed the redundant leaf 'logged-in-users'.
33 2. Removed the deprecated NOTIF_PORT from when conditions. Removed the deprecated
34 'notif-port-status' leaf from 'notification-log'. ";
35 }
36 revision "2017-09-11" {
37 description "1. Changed 'enable-notifications' to 'mask-notification' and made all notification enabled by default.
38 'mask-notification' can be used to disable notifications.
39 2. Removed RPC 'get_alarm_state' and provided an equivalent operational data 'system-alarms'.
40 3. Removed RPC 'shutter-status' and provided an equivalent operational data 'shutter-status'. ";
41 }
42 revision "2017-05-30" {
43 description "1. Added support for activity-log configuration and notifications.
44 2. Added an RPC to get current system alarm
45 3. Added the default value for enable-notifications. ";
46 }
47 revision "2016-04-22" {
48 description "1. Added support for the smart fibre Id identification and reporting.
49 2. Added support for configuring and operation programmable shutters. ";
50 }
51 revision "2016-02-17" {
52 description "1. Added Polatis specific Variable Optical Attenuation (VOA) modes
53 2. Changed the data type for power alarm hysteresis and defined the range.";
54 }
55 revision "2015-09-14" {
56 description "Initial revision.";
57 }
58
59 augment /opsw:ports/opsw:port {
60 leaf fibre-id {
61 type string;
62
63 config false;
64
65 description "Id of the smart fibre that is connected to this port. Polatis switches report
66 'NA' if smart fibre is not connected on this port. Management interface can find matching Id
67 from a different switch to establish the network topology.";
68 }
69 }
70 augment /opsw:ports/opsw:port/opsw:opm {
71 leaf offset {
72 type opsw:floatFormat2d;
73
74 default 0;
75
76 description "Offset for the power measurement; the value is added to power
77 monitor measurements when reporting /opsw:ports/opsw:port[]/opsw:opm/opsw:power.
78 Thus, specifying an offset can be used as a means of referencing the power
79 monitors against external meters.
80 It should be noted that the offset feature does NOT impact the behaviour
81 of the alarm or attenuation features:
82 alarm and attenuation settings always operate relative to the actual
83 power monitor readings, i.e. without any user-specified offsets.
84 Specified in dBm.";
85 }
86 leaf averaging-time-select {
87 type uint8 {
88 range "1..8";
89 }
90
91 default 4;
92
93 description "Selects the averaging period; each increment
94 in this value doubles the length of the time for which the OPM power
95 readings are averaged.
96 Setting the value to 1 results in the shortest averaging period, around 10ms.
97 Setting the value to 8 results in the longest averaging period, 128 times greater.";
98 }
99 leaf power-alarm-hysteresis {
100 type decimal64 {
101 fraction-digits 2;
102 range "1..5";
103 }
104
105 default 1;
106
107 description "Added to 'power-low-alarm' and subtracted from 'power-high-alarm'
108 to generate alarm clear notifications. Specified in dBm.";
109 }
110 leaf power-alarm-clear-holdoff {
111 type uint32;
112 default 10;
113
114 description "Minimum time (in seconds) for which the optical power level needs
115 to be restored within the power alarm thresholds for the switch to generate
116 an alarm clear notification.";
117 }
118 }
119 augment /opsw:ports/opsw:port/opsw:opm/opsw:voa {
120 leaf polatis-atten-modes {
121 type enumeration {
122 enum VOA_ATTEN_MODE_CONVERGED { value 1; }
123 enum VOA_ATTEN_MODE_MAXIMUM { value 2; }
124 enum VOA_ATTEN_MODE_FIXED { value 3; }
125 }
126 description " VOA_ATTEN_MODE_CONVERGED: This is similar in behaviour to ABSOLUTE mode, but once
127 the attenuation converges to the desired level the switch freezes the VOA control loop.
128 This reduces noise caused by the control loop continually striving to improve the attenuation.
129 VOA_ATTEN_MODE_MAXIMUM: Port will achieve the maximum attenuation level. In this case configured
130 attenuation level is not used.
131 VOA_ATTEN_MODE_FIXED: Disables closed loop updating of the attenuation feature for the specified port.
132 Following issuance of this command, the port will continue to hold their current attenuation level
133 without any optical feedback. Thus, any changes in input power levels will no longer be tracked";
134 }
135 }
136 augment "/opsw:system-config" {
137 leaf startup-mode {
138 type enumeration {
139 enum MODE_VOLATILE;
140 enum MODE_PRESERVE;
141 }
142 default MODE_PRESERVE;
143
144 description "Specifies that the configuration needs to be stored
145 across a system-reset. When the mode is set to MODE_PRESERVE all new configurations will
146 be saved and switch will boot to last saved configuration. When the startup mode is MODE_VOLATILE
147 the switch will not retain the given configuration through system reset.";
148 }
149 }
150 augment "/opsw:system-config/opsw:user" {
151 leaf group {
152 type enumeration {
153 enum "admin";
154 enum "user";
155 enum "view";
156 }
157 default "user";
158 description "The permissions group to which user belongs.
159 Users in 'admin' group can read and write every data defined for the switch. They can
160 create, delete or edit users, change system-config data.
161 Users in 'user' group cannot change anything in the 'opsw:system-config', otherwise
162 they can change port configuration, cross-connect, only view notification log;
163 Users in 'view' group can only read data";
164 }
165 }
166
167 typedef polatis-switch-status {
168 type enumeration {
169 enum OPERATIONAL;
170 enum REQUEST_SERVICE;
171 }
172
173 description "Polatis switches are designed to recover from most system errors and will report
174 OPERATIONAL after most system errors. Some system errors require service by Polatis engineers. Users are advised to
175 Contact Polatis when REQUEST_SERVICE is reported.";
176 }
177
178 typedef notification-types {
179 type bits {
180 bit NOTIF_PORT_POWER {
181 position 0;
182 description "Issued when power readings are below
183 '/opsw:opm-alarm-config/opsw:signal-low-thresholds' and
184 '/opsw:opm-alarm-config/opsw:mode' is 'POWER_ALARM_ENABLED'.";
185 }
186 bit NOTIF_PORT_POWER_WARN {
187 position 1;
188 description "Issued when power readings are below
189 '/opsw:opm-alarm-config/opsw:signal-degrade-thresholds' and
190 '/opsw:opm-alarm-config/opsw:mode' is 'POWER_ALARM_ENABLED'.";
191 }
192 bit NOTIF_SYSTEM {
193 position 2;
194 description "Issued for system warnings and errors.";
195 }
196 bit NOTIF_APS {
197 position 3;
198 description "Issued for APS events.";
199 }
200 bit NOTIF_ACTIVITY {
201 position 4;
202 description "Issued for switch configuration changes performed
203 by users if '/opsw:system-config/opsw:activity-log/opsw:logging-enabled'
204 is true. The scope of the configuration setting reported can be
205 controlled by the '/opsw:system-config/opsw:activity-log/opsw:log-filter'.";
206 }
207 }
208 }
209 leaf mask-notification {
210 type notification-types;
211
212 description "Polatis switch sends the notifications on the notification stream 'Polatis'.
213 The leaf can be set to mask individual notifications appearing on that stream. ";
214 }
215
216 notification port-power-alarm {
217 description "Issued when power readings are below
218 '/opsw:opm-alarm-config/opsw:signal-low-thresholds' and
219 '/opsw:opm-alarm-config/opsw:mode' is 'POWER_ALARM_ENABLED'.";
220
221 leaf port-id {
222 type uint32;
223 mandatory true;
224 }
225 leaf port-label {
226 type opsw:namesFormatNullable;
227 description "Label of the notification port";
228 }
229 }
230 notification port-power-clear {
231 description "Issued when power readings are restored above
232 '/opsw:opm-alarm-config/opsw:signal-low-thresholds' and
233 '/opsw:opm-alarm-config/opsw:mode' is 'POWER_ALARM_ENABLED'.";
234
235 leaf port-id {
236 type uint32;
237 mandatory true;
238 }
239 leaf port-label {
240 type opsw:namesFormatNullable;
241 description "Label of the notification port";
242 }
243 }
244 notification port-power-warn-alarm {
245 description "Issued when power readings are below
246 '/opsw:opm-alarm-config/opsw:signal-degrade-thresholds' and
247 '/opsw:opm-alarm-config/opsw:mode' is 'POWER_ALARM_ENABLED'.";
248
249 leaf port-id {
250 type uint32;
251 mandatory true;
252 description "ID for the port causing this notification.";
253 }
254 leaf port-label {
255 type opsw:namesFormatNullable;
256 description "Label of the notification port.";
257 }
258 }
259 notification port-power-warn-clear {
260 description "Sent when power reading returns within offsets to the thresholds set,
261 including hysteresis.";
262
263 leaf port-id {
264 type uint32;
265 mandatory true;
266 description "ID for the port causing this notification.";
267 }
268 leaf port-label {
269 type opsw:namesFormatNullable;
270 description "Label of the notification port";
271 }
272 }
273 notification system-error {
274 description "These notifications are generated under many circumstances as described by the 'error-code' and 'message'.";
275 leaf error-code {
276 type uint32;
277 mandatory true;
278 description "ID for the cause of the notification.";
279 }
280 leaf switch-status {
281 type polatis-switch-status;
282 mandatory true;
283 description "Status of the switch after this notification";
284 }
285 leaf message {
286 type string;
287 description "Use readable description of the cause of this notification.";
288 }
289 }
290 notification activity-log-notification {
291 description "This notification reports a configuration change in the switch.";
292
293 leaf notification-username {
294 type string;
295 description "User who has changed the configuration.";
296 }
297 leaf notification-ip-address {
298 type inet:ip-address;
299 description "IPv4 address from which the client made the configuration changes";
300 }
301 leaf notification-protocol {
302 type string;
303 description "The protocol used to change the configuration.";
304 }
305 leaf notification-activity {
306 type string;
307 description "This message describes the configuration change that was made";
308 }
309 }
310
311 container notification-log {
312 config false;
313 description "The log contains all notifications ignoring the restrictions in 'mask-notification'.";
314 list log {
315 key notif-id;
316 leaf notif-id {
317 type uint32;
318 description "Unique Id for the notification.";
319 }
320 leaf notif-type {
321 type notification-types;
322 mandatory true;
323 }
324 leaf notif-count {
325 type uint32;
326 description "The number of notifications of the same 'notif-id'.";
327 }
328 leaf notif-time-first {
329 type yang:date-and-time;
330 mandatory true;
331 description "Time at which the first notification was generated";
332 }
333 leaf notif-time-last {
334 type yang:date-and-time;
335 mandatory true;
336 description "Time at which the last notification was generated";
337 }
338 leaf notif-message {
339 type string;
340 mandatory true;
341 description "Useful textual representation of the notification cause.";
342 }
343 leaf notif-port {
344 when "../notif-type = 'NOTIF_PORT_POWER' or " +
345 "../notif-type = 'NOTIF_PORT_POWER_WARN' ";
346
347 type uint32;
348 description "The port that is affected by power alarm or power warning alarm.";
349 }
350 container notif-system {
351 leaf error-code {
352 type uint32;
353 }
354 leaf switch-status {
355 type polatis-switch-status;
356 }
357 when "../notif-type = 'NOTIF_SYSTEM'";
358 }
359 }
360 }
361 rpc clear-notification-ids {
362 description "This clears named or all notifications from the log, don't provide any input, or empty list to remove all.";
363 input {
364 list notif-ids {
365 leaf notif-id {
366 type uint32;
367 description "Unique Id for the notification.";
368 }
369 }
370 }
371 }
372 container system-alarms {
373 config false;
374 description "This returns the current active system alarms.";
375
376 list alarm {
377 key alarm-time;
378 leaf alarm-time {
379 type yang:date-and-time;
380 description "Time at which the alarm occured.";
381 }
382 leaf alarm-type {
383 type notification-types;
384 description "Type of the alarm.";
385 }
386 leaf alarm-message {
387 type string;
388 mandatory true;
389 description "Message that explains the reason for the alarm.";
390 }
391 }
392 }
393 grouping shutter {
394 description "If the shutter feature is available, a port can be
395 configured to block the signal periodically - once, a fixed number of
396 times or indefinitely.";
397 leaf signal-block-time {
398 type uint32 {
399 range "10..10000";
400 }
401 description "Time in (ms) for which shutter will block the signal when activated.";
402 }
403 leaf signal-restore-time {
404 type uint32 {
405 range "500..30000";
406 }
407 description "Time in (ms) for which shutter will restore the signal when activated. If this parameter is not configured, the shutter blocks once.";
408 }
409 leaf cycles {
410 type uint32;
411 description "The specific number of cycles the repeating shutter operates.
412 When the cycles is 0, the shutter is in activated state until it is
413 deactivated. This parameter may only be configured if 'signal-restore-time' is configured.";
414 }
415 }
416 rpc shutter-config {
417 description "Configures the shutter parameters for a list of ports.";
418 input {
419 list port {
420 key port-id;
421 leaf port-id {
422 type opsw:portFormat;
423 description "ID for port to configure";
424 }
425 uses shutter {
426 refine signal-block-time {
427 mandatory true;
428 }
429 }
430 min-elements 1;
431 }
432 }
433 }
434 container shutter-status {
435 description "Reports the shutter status for all ports that can be configured.";
436 config false;
437 list port {
438 key port-id;
439 leaf port-id {
440 type opsw:portFormat;
441 description "port Id to which the configuration belongs";
442 }
443 uses shutter;
444 leaf status {
445 type enumeration {
446 enum SHUTTER_IDLE { value 1; }
447 enum SHUTTER_SET { value 2; }
448 enum SHUTTER_ACTIVE { value 3; }
449 enum SHUTTER_PENDING { value 4; }
450 }
451 description "Current shutter status for this port";
452 }
453 }
454 }
455 rpc shutter-operation {
456 description "Activates or deactivates the pre-configured list of ports.";
457 input {
458 leaf activate {
459 type boolean;
460 mandatory true;
461 }
462 leaf-list port {
463 type opsw:portFormat;
464 min-elements 1;
465
466 description "List of IDs for ports to be activated or deactivated.";
467 }
468 }
469 }
470 rpc add-group-cross-connect {
471 description "Cross connects one 'group' to another 'group', if possible.";
472 input {
473 leaf group-name-from {
474 type opsw:groupNamesFormat;
475 mandatory true;
476 }
477 leaf group-name-to {
478 type opsw:groupNamesFormat;
479 mandatory true;
480 }
481 }
482 }
483 rpc delete-group-cross-connect {
484 description "Disconnects all ports of a 'group'.";
485 input {
486 leaf group-name {
487 type opsw:groupNamesFormat;
488 mandatory true;
489 }
490 }
491 }
492 container sessions {
493 description "Shows the active user sessions.";
494 list session {
495 config false;
496 key session-id;
497 leaf session-id {
498 type uint32;
499 description "ID of the session";
500 }
501 leaf protocol-name {
502 type string;
503 description "The protocol interface used for this session.";
504 }
505 leaf protocol-port {
506 type uint32;
507 description "The port number to which the client connected; not used for RS232.";
508 }
509 leaf client-address {
510 type inet:ip-address;
511 description "IP address from which the client connected; not used for RS232.";
512 }
513 leaf user-name {
514 type opsw:userNamesFormat;
515 description "The name of the user logged in on the session.";
516 }
517 }
518 }
519 rpc disconnect-session {
520 description "Allows an admin to end a user's session.";
521 input {
522 leaf session-id {
523 type uint32;
524 mandatory true;
525 }
526 }
527 }
528}