Laszlo Papp | 8b3a5f6 | 2017-10-05 13:32:00 +0100 | [diff] [blame] | 1 | module 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 "2017-05-30" { |
| 32 | description "1. Added support for activity-log configuration and notifications. |
| 33 | 2. Added an RPC to get current system alarm |
| 34 | 3. Added the default value for enable-notifications. "; |
| 35 | } |
| 36 | revision "2016-04-22" { |
| 37 | description "1. Added support for the smart fibre Id identification and reporting. |
| 38 | 2. Added support for configuring and operation programmable shutters. "; |
| 39 | } |
| 40 | revision "2016-02-17" { |
| 41 | description "1. Added Polatis specific Variable Optical Attenuation (VOA) modes |
| 42 | 2. Changed the data type for power alarm hysteresis and defined the range."; |
| 43 | } |
| 44 | revision "2015-09-14" { |
| 45 | description "Initial revision."; |
| 46 | } |
| 47 | |
| 48 | augment /opsw:ports/opsw:port { |
| 49 | leaf fibre-id { |
| 50 | type string; |
| 51 | |
| 52 | config false; |
| 53 | |
| 54 | description "Id of the smart fibre that is connected to this port. Polatis switches report |
| 55 | 'NA' if smart fibre is not connected on this port. Management interface can find matching Id |
| 56 | from a different switch to establish the network topology."; |
| 57 | } |
| 58 | } |
| 59 | augment /opsw:ports/opsw:port/opsw:opm { |
| 60 | leaf offset { |
| 61 | type opsw:floatFormat2d; |
| 62 | |
| 63 | default 0; |
| 64 | |
| 65 | description "Offset for the power measurement; the value is added to power |
| 66 | monitor measurements when reporting /opsw:ports/opsw:port[]/opsw:opm/opsw:power. |
| 67 | Thus, specifying an offset can be used as a means of referencing the power |
| 68 | monitors against external meters. |
| 69 | It should be noted that the offset feature does NOT impact the behaviour |
| 70 | of the alarm or attenuation features: |
| 71 | alarm and attenuation settings always operate relative to the actual |
| 72 | power monitor readings, i.e. without any user-specified offsets. |
| 73 | Specified in dBm."; |
| 74 | } |
| 75 | leaf averaging-time-select { |
| 76 | type uint8 { |
| 77 | range "1..8"; |
| 78 | } |
| 79 | |
| 80 | default 4; |
| 81 | |
| 82 | description "Selects the averaging period; each increment |
| 83 | in this value doubles the length of the time for which the OPM power |
| 84 | readings are averaged. |
| 85 | Setting the value to 1 results in the shortest averaging period, around 10ms. |
| 86 | Setting the value to 8 results in the longest averaging period, 128 times greater."; |
| 87 | } |
| 88 | leaf power-alarm-hysteresis { |
| 89 | type decimal64 { |
| 90 | fraction-digits 2; |
| 91 | range "1..5"; |
| 92 | } |
| 93 | |
| 94 | default 1; |
| 95 | |
| 96 | description "Added to 'power-low-alarm' and subtracted from 'power-high-alarm' |
| 97 | to generate alarm clear notifications. Specified in dBm."; |
| 98 | } |
| 99 | leaf power-alarm-clear-holdoff { |
| 100 | type uint32; |
| 101 | default 10; |
| 102 | |
| 103 | description "Minimum time (in seconds) for which the optical power level needs |
| 104 | to be restored within the power alarm thresholds for the switch to generate |
| 105 | an alarm clear notification."; |
| 106 | } |
| 107 | } |
| 108 | augment /opsw:ports/opsw:port/opsw:opm/opsw:voa { |
| 109 | leaf polatis-atten-modes { |
| 110 | type enumeration { |
| 111 | enum VOA_ATTEN_MODE_CONVERGED { value 1; } |
| 112 | enum VOA_ATTEN_MODE_MAXIMUM { value 2; } |
| 113 | enum VOA_ATTEN_MODE_FIXED { value 3; } |
| 114 | } |
| 115 | description " VOA_ATTEN_MODE_CONVERGED: This is similar in behaviour to ABSOLUTE mode, but once |
| 116 | the attenuation converges to the desired level the switch freezes the VOA control loop. |
| 117 | This reduces noise caused by the control loop continually striving to improve the attenuation. |
| 118 | VOA_ATTEN_MODE_MAXIMUM: Port will achieve the maximum attenuation level. In this case configured |
| 119 | attenuation level is not used. |
| 120 | VOA_ATTEN_MODE_FIXED: Disables closed loop updating of the attenuation feature for the specified port. |
| 121 | Following issuance of this command, the port will continue to hold their current attenuation level |
| 122 | without any optical feedback. Thus, any changes in input power levels will no longer be tracked"; |
| 123 | } |
| 124 | } |
| 125 | augment "/opsw:system-config" { |
| 126 | leaf startup-mode { |
| 127 | type enumeration { |
| 128 | enum MODE_VOLATILE; |
| 129 | enum MODE_PRESERVE; |
| 130 | } |
| 131 | default MODE_PRESERVE; |
| 132 | |
| 133 | description "Specifies that the configuration needs to be stored |
| 134 | across a system-reset. When the mode is set to MODE_PRESERVE all new configurations will |
| 135 | be saved and switch will boot to last saved configuration. When the startup mode is MODE_VOLATILE |
| 136 | the switch will not retain the given configuration through system reset."; |
| 137 | } |
| 138 | list logged-in-users { |
| 139 | config false; |
| 140 | key username; |
| 141 | |
| 142 | leaf username { |
| 143 | type opsw:namesFormat; |
| 144 | } |
| 145 | |
| 146 | description "Users that are currently logged into the system."; |
| 147 | } |
| 148 | } |
| 149 | augment "/opsw:system-config/opsw:user" { |
| 150 | leaf group { |
| 151 | type enumeration { |
| 152 | enum "admin"; |
| 153 | enum "user"; |
| 154 | enum "view"; |
| 155 | } |
| 156 | description "The permissions group to which user belongs. |
| 157 | Users in 'admin' group can read and write every data defined for the switch. They can |
| 158 | create, delete or edit users, change system-config data. |
| 159 | Users in 'user' group cannot change anything in the 'opsw:system-config', otherwise |
| 160 | they can change port configuration, cross-connect, only view notification log; |
| 161 | Users in 'view' group can only read data"; |
| 162 | } |
| 163 | } |
| 164 | |
| 165 | typedef polatis-switch-status { |
| 166 | type enumeration { |
| 167 | enum OPERATIONAL; |
| 168 | enum REQUEST_SERVICE; |
| 169 | } |
| 170 | |
| 171 | description "Polatis switches are designed to recover from most system errors and will report |
| 172 | OPERATIONAL after most system errors. Some system errors require service by Polatis engineers. Users are advised to |
| 173 | Contact Polatis when REQUEST_SERVICE is reported."; |
| 174 | } |
| 175 | |
| 176 | typedef notification-types { |
| 177 | type bits { |
| 178 | bit NOTIF_NONE { |
| 179 | position 0; |
| 180 | description "No notification"; |
| 181 | } |
| 182 | bit NOTIF_PORT_POWER { |
| 183 | position 1; |
| 184 | description "Issued when power readings are outside power-alarm thresholds."; |
| 185 | } |
| 186 | bit NOTIF_PORT_POWER_WARN { |
| 187 | position 2; |
| 188 | description "Issued when power readings are outside power-warning thresholds."; |
| 189 | } |
| 190 | bit NOTIF_SYSTEM { |
| 191 | position 5; |
| 192 | description "Issued for an internal error"; |
| 193 | } |
| 194 | bit NOTIF_APS { |
| 195 | position 7; |
| 196 | description "Issued for aps events."; |
| 197 | } |
| 198 | bit NOTIF_ACTIVITY { |
| 199 | position 8; |
| 200 | description "Issued for any configuration changes performed by users."; |
| 201 | } |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | leaf enable-notifications { |
| 206 | type notification-types; |
| 207 | |
| 208 | default NOTIF_NONE; |
| 209 | |
| 210 | description "Decide which class of netconf notification to send. |
| 211 | All notifications are disabled by default"; |
| 212 | } |
| 213 | |
| 214 | notification port-power-alarm { |
| 215 | description "Sent when power reading moves outside the thresholds set."; |
| 216 | |
| 217 | leaf port-id { |
| 218 | type leafref { |
| 219 | path "/opsw:ports/opsw:port/opsw:port-id"; |
| 220 | } |
| 221 | mandatory true; |
| 222 | } |
| 223 | leaf port-label { |
| 224 | type leafref { |
| 225 | path "/opsw:ports/opsw:port/opsw:port-label"; |
| 226 | } |
| 227 | description "Label of the notification port"; |
| 228 | } |
| 229 | } |
| 230 | notification port-power-clear { |
| 231 | description "Sent when power reading returns within the thresholds set, including hysteresis."; |
| 232 | |
| 233 | leaf port-id { |
| 234 | type leafref { |
| 235 | path "/opsw:ports/opsw:port/opsw:port-id"; |
| 236 | } |
| 237 | mandatory true; |
| 238 | } |
| 239 | leaf port-label { |
| 240 | type leafref { |
| 241 | path "/opsw:ports/opsw:port/opsw:port-label"; |
| 242 | } |
| 243 | description "Label of the notification port"; |
| 244 | } |
| 245 | } |
| 246 | notification port-power-warn-alarm { |
| 247 | description "Sent when power reading moves outside the warning offsets to the thresholds set."; |
| 248 | |
| 249 | leaf port-id { |
| 250 | type leafref { |
| 251 | path "/opsw:ports/opsw:port/opsw:port-id"; |
| 252 | } |
| 253 | mandatory true; |
| 254 | } |
| 255 | leaf port-label { |
| 256 | type leafref { |
| 257 | path "/opsw:ports/opsw:port/opsw:port-label"; |
| 258 | } |
| 259 | description "Label of the notification port"; |
| 260 | } |
| 261 | } |
| 262 | notification port-power-warn-clear { |
| 263 | description "Sent when power reading returns within offsets to the thresholds set, |
| 264 | including hysteresis."; |
| 265 | |
| 266 | leaf port-id { |
| 267 | type leafref { |
| 268 | path "/opsw:ports/opsw:port/opsw:port-id"; |
| 269 | } |
| 270 | mandatory true; |
| 271 | } |
| 272 | leaf port-label { |
| 273 | type leafref { |
| 274 | path "/opsw:ports/opsw:port/opsw:port-label"; |
| 275 | } |
| 276 | description "Label of the notification port"; |
| 277 | } |
| 278 | } |
| 279 | notification system-error { |
| 280 | description "This notification is generated when switch encounters an unexpected error."; |
| 281 | |
| 282 | leaf error-code { |
| 283 | type uint32; |
| 284 | mandatory true; |
| 285 | description "Description of the system error."; |
| 286 | } |
| 287 | leaf switch-status { |
| 288 | type polatis-switch-status; |
| 289 | mandatory true; |
| 290 | description "Status of the switch after the system error which |
| 291 | resulted in this notification"; |
| 292 | } |
| 293 | leaf message { |
| 294 | type string; |
| 295 | description "Message related to system error."; |
| 296 | } |
| 297 | } |
| 298 | notification activity-log-notification { |
| 299 | description "Sent when a new entry appears in the activity log."; |
| 300 | leaf notification-username { type string; } |
| 301 | leaf notification-ip-address { type inet:ip-address; } |
| 302 | leaf notification-protocol { type string; } |
| 303 | leaf notification-activity { type string; } |
| 304 | } |
| 305 | |
| 306 | |
| 307 | container notification-log { |
| 308 | config false; |
| 309 | |
| 310 | list log { |
| 311 | key notif-id; |
| 312 | leaf notif-id { |
| 313 | type uint32; |
| 314 | description "Unique Id for the notification."; |
| 315 | } |
| 316 | leaf notif-type { |
| 317 | type notification-types; |
| 318 | mandatory true; |
| 319 | } |
| 320 | leaf notif-count { |
| 321 | type uint32; |
| 322 | description "The number of notifications of the same notif-id."; |
| 323 | } |
| 324 | leaf notif-time-first { |
| 325 | type yang:date-and-time; |
| 326 | mandatory true; |
| 327 | description "Time at which the first notification was generated"; |
| 328 | } |
| 329 | leaf notif-time-last { |
| 330 | type yang:date-and-time; |
| 331 | mandatory true; |
| 332 | description "Time at which the last notification was generated"; |
| 333 | } |
| 334 | leaf notif-message { |
| 335 | type string; |
| 336 | mandatory true; |
| 337 | description "Useful textual representation of the notification cause."; |
| 338 | } |
| 339 | leaf notif-port { |
| 340 | type leafref { |
| 341 | path "/opsw:ports/opsw:port/opsw:port-id"; |
| 342 | } |
| 343 | when "../notif-type = 'NOTIF_PORT_POWER' or " + |
| 344 | "../notif-type = 'NOTIF_PORT_POWER_WARN' or " + |
| 345 | "../notif-type = 'NOTIF_PORT'"; |
| 346 | } |
| 347 | leaf notif-port-status { |
| 348 | type opsw:PortStatus; |
| 349 | when "../notif-type = 'NOTIF_PORT'"; |
| 350 | } |
| 351 | container notif-system { |
| 352 | leaf error-code { |
| 353 | type uint32; |
| 354 | } |
| 355 | leaf switch-status { |
| 356 | type polatis-switch-status; |
| 357 | } |
| 358 | when "../notif-type = 'NOTIF_SYSTEM'"; |
| 359 | } |
| 360 | description "Contains the log of all the notifications generated by the switch."; |
| 361 | } |
| 362 | } |
| 363 | |
| 364 | rpc shutter-config { |
| 365 | input { |
| 366 | leaf duration-on { |
| 367 | type uint32; |
| 368 | mandatory true; |
| 369 | |
| 370 | description "Set how long the shutter will switched on in ms"; |
| 371 | } |
| 372 | leaf duration-off { |
| 373 | type uint32; |
| 374 | mandatory true; |
| 375 | |
| 376 | description "Set how long the shutter will be switched off in ms"; |
| 377 | } |
| 378 | leaf cycles { |
| 379 | type int32; |
| 380 | |
| 381 | description "Set the specific number of cycles the repeating |
| 382 | shutter operates for"; |
| 383 | } |
| 384 | |
| 385 | list port-interval { |
| 386 | key port-id; |
| 387 | leaf port-id { type opsw:portFormat; } |
| 388 | min-elements 1; |
| 389 | } |
| 390 | } |
| 391 | } |
| 392 | |
| 393 | rpc shutter-status { |
| 394 | output { |
| 395 | list port-interval { |
| 396 | key port-id; |
| 397 | leaf port-id { type opsw:portFormat; } |
| 398 | |
| 399 | leaf duration-on { |
| 400 | type uint32; |
| 401 | mandatory true; |
| 402 | |
| 403 | description "Get how long the shutter will be switched on in ms"; |
| 404 | } |
| 405 | leaf duration-off { |
| 406 | type uint32; |
| 407 | mandatory true; |
| 408 | |
| 409 | description "Get how long the shutter will be switched off in ms"; |
| 410 | } |
| 411 | |
| 412 | leaf cycles { |
| 413 | type uint32; |
| 414 | |
| 415 | description "Get the specific number of cycles the repeating |
| 416 | shutter operates for"; |
| 417 | } |
| 418 | } |
| 419 | } |
| 420 | |
| 421 | } |
| 422 | |
| 423 | rpc shutter-operation { |
| 424 | input { |
| 425 | leaf operation-on { |
| 426 | type boolean; |
| 427 | mandatory true; |
| 428 | |
| 429 | description "The leaf starts or stops the given mode for programmable shutters. It will |
| 430 | continue until it is stopped. Double stops and double starts have no effect."; |
| 431 | } |
| 432 | } |
| 433 | } |
| 434 | |
| 435 | rpc clear-notification-ids { |
| 436 | description "This clears named or all notifications from the log, don't provide any input, or empty list to remove all."; |
| 437 | input { |
| 438 | list notif-ids { |
| 439 | leaf notif-id { |
| 440 | type uint32; |
| 441 | description "Unique Id for the notification."; |
| 442 | } |
| 443 | } |
| 444 | } |
| 445 | } |
| 446 | |
| 447 | rpc get-alarm-state { |
| 448 | description "This returns the alarm states currently active."; |
| 449 | output { |
| 450 | list alarm-state { |
| 451 | key alarm-index; |
| 452 | leaf alarm-index { |
| 453 | type uint32; |
| 454 | description "This is simply a count to have a unique key in the list"; |
| 455 | } |
| 456 | |
| 457 | leaf alarm-type { |
| 458 | type notification-types; |
| 459 | mandatory true; |
| 460 | } |
| 461 | leaf alarm-time { |
| 462 | type yang:date-and-time; |
| 463 | mandatory true; |
| 464 | description "Time at which the first notification was generated."; |
| 465 | } |
| 466 | leaf alarm-message { |
| 467 | type string; |
| 468 | mandatory true; |
| 469 | description "Useful textual representation of the alarm cause."; |
| 470 | } |
| 471 | leaf port-id { |
| 472 | type uint32; |
| 473 | description "Port id parsed out the alarm message, set to 0 if not simple."; |
| 474 | } |
| 475 | } |
| 476 | } |
| 477 | } |
| 478 | |
| 479 | } |