sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 1 | module yrt-ietf-yang-push { |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 2 | |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 3 | yang-version 1.1; |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 4 | namespace "urn:ietf:params:xml:ns:yang:yrt-ietf-yang-push"; |
| 5 | prefix yp; |
| 6 | |
| 7 | import yrt-ietf-inet-types { |
| 8 | prefix inet; |
| 9 | } |
| 10 | import yrt-ietf-yang-types { |
| 11 | prefix yang; |
| 12 | } |
| 13 | import yrt-ietf-event-notifications { |
| 14 | prefix notif-bis; |
| 15 | } |
| 16 | |
| 17 | organization "IETF"; |
| 18 | contact |
| 19 | "WG Web: <http://tools.ietf.org/wg/netconf/> |
| 20 | WG List: <mailto:netconf@ietf.org> |
| 21 | WG Chair: Mahesh Jethanandani |
| 22 | <mailto:mjethanandani@gmail.com> |
| 23 | WG Chair: Mehmet Ersue |
| 24 | <mailto:mehmet.ersue@nokia.com> |
| 25 | Editor: Alexander Clemm |
| 26 | <mailto:alex@sympotech.com> |
| 27 | Editor: Eric Voit |
| 28 | <mailto:evoit@cisco.com> |
| 29 | Editor: Alberto Gonzalez Prieto |
| 30 | <mailto:albertgo@cisco.com> |
| 31 | Editor: Ambika Prasad Tripathy |
| 32 | <mailto:ambtripa@cisco.com> |
| 33 | Editor: Einar Nilsen-Nygaard |
| 34 | <mailto:einarnn@cisco.com> |
| 35 | Editor: Andy Bierman |
| 36 | <mailto:andy@yumaworks.com> |
| 37 | Editor: Balazs Lengyel |
| 38 | <mailto:balazs.lengyel@ericsson.com>"; |
| 39 | |
| 40 | description |
| 41 | "This module contains conceptual YANG specifications |
| 42 | for YANG push."; |
| 43 | |
| 44 | revision 2016-10-28 { |
| 45 | description |
| 46 | "Updates to simplify modify-subscription, add anchor-time"; |
| 47 | reference "YANG Datastore Push, draft-ietf-netconf-yang-push-04"; |
| 48 | } |
| 49 | |
| 50 | feature on-change { |
| 51 | description |
| 52 | "This feature indicates that on-change updates are |
| 53 | supported."; |
| 54 | } |
| 55 | |
| 56 | /* |
| 57 | * IDENTITIES |
| 58 | */ |
| 59 | |
| 60 | /* Additional errors for subscription operations */ |
| 61 | identity error-data-not-authorized { |
| 62 | base notif-bis:error; |
| 63 | description |
| 64 | "No read authorization for a requested data node."; |
| 65 | } |
| 66 | |
| 67 | /* Additional types of streams */ |
| 68 | |
| 69 | identity yang-push { |
| 70 | base notif-bis:stream; |
| 71 | description |
| 72 | "A conceptual datastream consisting of all datastore |
| 73 | updates, including operational and configuration data."; |
| 74 | } |
| 75 | |
| 76 | identity custom-stream { |
| 77 | base notif-bis:stream; |
| 78 | description |
| 79 | "A conceptual datastream for datastore |
| 80 | updates with custom updates as defined by a user."; |
| 81 | } |
| 82 | |
| 83 | /* Additional transport option */ |
| 84 | identity http2 { |
| 85 | base notif-bis:transport; |
| 86 | description |
| 87 | "HTTP2 notifications as a transport"; |
| 88 | } |
| 89 | |
| 90 | /* |
| 91 | * TYPE DEFINITIONS |
| 92 | */ |
| 93 | |
| 94 | typedef filter-id { |
| 95 | type uint32; |
| 96 | description |
| 97 | "A type to identify filters which can be associated with a |
| 98 | subscription."; |
| 99 | } |
| 100 | |
| 101 | typedef change-type { |
| 102 | type enumeration { |
| 103 | enum "create" { |
| 104 | description |
| 105 | "A new data node was created"; |
| 106 | } |
| 107 | enum "delete" { |
| 108 | description |
| 109 | "A data node was deleted"; |
| 110 | } |
| 111 | enum "modify" { |
| 112 | description |
| 113 | "The value of a data node has changed"; |
| 114 | } |
| 115 | } |
| 116 | description |
| 117 | "Specifies different types of changes that may occur |
| 118 | to a datastore."; |
| 119 | } |
| 120 | |
| 121 | |
| 122 | grouping update-filter { |
| 123 | description |
| 124 | "This groupings defines filters for push updates for a |
| 125 | datastore tree. The filters define which updates are of |
| 126 | interest in a push update subscription. Mixing and matching |
| 127 | of multiple filters does not occur at the level of this |
| 128 | grouping. When a push-update subscription is created, the |
| 129 | filter can be a regular subscription filter, or one of the |
| 130 | additional filters that are defined in this grouping."; |
| 131 | choice update-filter { |
| 132 | description |
| 133 | "Define filters regarding which data nodes to include |
| 134 | in push updates"; |
| 135 | case subtree { |
| 136 | description |
| 137 | "Subtree filter."; |
| 138 | anyxml subtree-filter { |
| 139 | description |
| 140 | "Subtree-filter used to specify the data nodes targeted |
| 141 | for subscription within a subtree, or subtrees, of a |
| 142 | conceptual YANG datastore. Objects matching the filter |
| 143 | criteria will traverse the filter. The syntax follows |
| 144 | the subtree filter syntax specified in RFC 6241, |
| 145 | section 6."; |
| 146 | reference "RFC 6241 section 6"; |
| 147 | } |
| 148 | } |
| 149 | case xpath { |
| 150 | description |
| 151 | "XPath filter"; |
| 152 | leaf xpath-filter { |
| 153 | type yang:xpath1.0; |
| 154 | description |
| 155 | "Xpath defining the data items of interest."; |
| 156 | } |
| 157 | } |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | grouping update-policy { |
| 162 | description |
| 163 | "This grouping describes the conditions under which an |
| 164 | update will be sent as part of an update stream."; |
| 165 | choice update-trigger { |
| 166 | description |
| 167 | "Defines necessary conditions for sending an event to |
| 168 | the subscriber."; |
| 169 | case periodic { |
| 170 | description |
| 171 | "The agent is requested to notify periodically the |
| 172 | current values of the datastore or the subset |
| 173 | defined by the filter."; |
| 174 | leaf period { |
| 175 | type yang:timeticks; |
| 176 | mandatory true; |
| 177 | description |
| 178 | "Duration of time which should occur between periodic |
| 179 | push updates. Where the anchor of a start-time is |
| 180 | available, the push will include the objects and their |
| 181 | values which exist at an exact multiple of timeticks |
| 182 | aligning to this start-time anchor."; |
| 183 | } |
| 184 | leaf anchor-time { |
| 185 | type yang:date-and-time; |
| 186 | description |
| 187 | "Designates a timestamp from which the series of |
| 188 | periodic push updates are computed. The next update |
| 189 | will take place at the next period interval from the |
| 190 | anchor time. For example, for an anchor time at the |
| 191 | top of a minute and a period interval of a minute, |
| 192 | the next update will be sent at the top of the next |
| 193 | minute."; |
| 194 | } |
| 195 | } |
| 196 | case on-change { |
| 197 | if-feature "on-change"; |
| 198 | description |
| 199 | "The agent is requested to notify changes in |
| 200 | values in the datastore or a subset of it defined |
| 201 | by a filter."; |
| 202 | leaf no-synch-on-start { |
| 203 | type empty; |
| 204 | description |
| 205 | "This leaf acts as a flag that determines behavior at the |
| 206 | start of the subscription. When present, |
| 207 | synchronization of state at the beginning of the |
| 208 | subscription is outside the scope of the subscription. |
| 209 | Only updates about changes that are observed from the |
| 210 | start time, i.e. only push-change-update notifications |
| 211 | are sent. |
| 212 | When absent (default behavior), in order to facilitate |
| 213 | a receiver's synchronization, a full update is sent |
| 214 | when the subscription starts using a push-update |
| 215 | notification, just like in the case of a periodic |
| 216 | subscription. After that, push-change-update |
| 217 | notifications only are sent unless the Publisher chooses |
| 218 | to resynch the subscription again."; |
| 219 | } |
| 220 | leaf dampening-period { |
| 221 | type yang:timeticks; |
| 222 | mandatory true; |
| 223 | description |
| 224 | "Minimum amount of time that needs to have |
| 225 | passed since the last time an update was |
| 226 | provided."; |
| 227 | } |
| 228 | leaf-list excluded-change { |
| 229 | type change-type; |
| 230 | description |
| 231 | "Use to restrict which changes trigger an update. |
| 232 | For example, if modify is excluded, only creation and |
| 233 | deletion of objects is reported."; |
| 234 | } |
| 235 | } |
| 236 | } |
| 237 | } |
| 238 | |
| 239 | grouping subscription-qos { |
| 240 | description |
| 241 | "This grouping describes Quality of Service information |
| 242 | concerning a subscription. This information is passed to lower |
| 243 | layers for transport priortization and treatment"; |
| 244 | leaf dscp { |
| 245 | if-feature "notif-bis:configured-subscriptions"; |
| 246 | type inet:dscp; |
| 247 | default "0"; |
| 248 | description |
| 249 | "The push update's IP packet transport priority. |
| 250 | This is made visible across network hops to receiver. |
| 251 | The transport priority is shared for all receivers of |
| 252 | a given subscription."; |
| 253 | } |
| 254 | leaf subscription-priority { |
| 255 | type uint8; |
| 256 | description |
| 257 | "Relative priority for a subscription. Allows an |
| 258 | underlying transport layer perform informed load |
| 259 | balance allocations between various subscriptions"; |
| 260 | } |
| 261 | leaf subscription-dependency { |
| 262 | type string; |
| 263 | description |
| 264 | "Provides the Subscription ID of a parent subscription |
| 265 | without which this subscription should not exist. In |
| 266 | other words, there is no reason to stream these objects |
| 267 | if another subscription is missing."; |
| 268 | } |
| 269 | } |
| 270 | |
| 271 | augment "/notif-bis:establish-subscription/notif-bis:input" { |
| 272 | description |
| 273 | "Define additional subscription parameters that apply |
| 274 | specifically to push updates"; |
| 275 | uses update-policy; |
| 276 | uses subscription-qos; |
| 277 | } |
| 278 | augment "/notif-bis:establish-subscription/notif-bis:input/"+ |
| 279 | "notif-bis:filter-type" { |
| 280 | description |
| 281 | "Add push filters to selection of filter types."; |
| 282 | case update-filter { |
| 283 | description |
| 284 | "Additional filter options for push subscription."; |
| 285 | uses update-filter; |
| 286 | } |
| 287 | } |
| 288 | augment "/notif-bis:establish-subscription/notif-bis:output" { |
| 289 | description |
| 290 | "Allow to return additional subscription parameters that apply |
| 291 | specifically to push updates."; |
| 292 | uses update-policy; |
| 293 | uses subscription-qos; |
| 294 | } |
| 295 | augment "/notif-bis:establish-subscription/notif-bis:output/"+ |
| 296 | "notif-bis:result/notif-bis:no-success/notif-bis:filter-type" { |
| 297 | description |
| 298 | "Add push filters to selection of filter types."; |
| 299 | case update-filter { |
| 300 | description |
| 301 | "Additional filter options for push subscription."; |
| 302 | uses update-filter; |
| 303 | } |
| 304 | } |
| 305 | augment "/notif-bis:modify-subscription/notif-bis:input" { |
| 306 | description |
| 307 | "Define additional subscription parameters that apply |
| 308 | specifically to push updates."; |
| 309 | uses update-policy; |
| 310 | } |
| 311 | augment "/notif-bis:modify-subscription/notif-bis:input/"+ |
| 312 | "notif-bis:filter-type" { |
| 313 | description |
| 314 | "Add push filters to selection of filter types."; |
| 315 | case update-filter { |
| 316 | description |
| 317 | "Additional filter options for push subscription."; |
| 318 | uses update-filter; |
| 319 | } |
| 320 | } |
| 321 | augment "/notif-bis:modify-subscription/notif-bis:output" { |
| 322 | description |
| 323 | "Allow to retun additional subscription parameters that apply |
| 324 | specifically to push updates."; |
| 325 | uses update-policy; |
| 326 | uses subscription-qos; |
| 327 | } |
| 328 | augment "/notif-bis:modify-subscription/notif-bis:output/"+ |
| 329 | "notif-bis:result/notif-bis:no-success/notif-bis:filter-type" { |
| 330 | description |
| 331 | "Add push filters to selection of filter types."; |
| 332 | case update-filter { |
| 333 | description |
| 334 | "Additional filter options for push subscription."; |
| 335 | uses update-filter; |
| 336 | } |
| 337 | } |
| 338 | notification push-update { |
| 339 | description |
| 340 | "This notification contains a push update, containing |
| 341 | data subscribed to via a subscription. |
| 342 | This notification is sent for periodic updates, for a |
| 343 | periodic subscription. It can also be used for |
| 344 | synchronization updates of an on-change subscription. |
| 345 | This notification shall only be sent to receivers |
| 346 | of a subscription; it does not constitute a general-purpose |
| 347 | notification."; |
| 348 | leaf subscription-id { |
| 349 | type notif-bis:subscription-id; |
| 350 | mandatory true; |
| 351 | description |
| 352 | "This references the subscription because of which the |
| 353 | notification is sent."; |
| 354 | } |
| 355 | leaf time-of-update { |
| 356 | type yang:date-and-time; |
| 357 | description |
| 358 | "This leaf contains the time of the update."; |
| 359 | } |
| 360 | leaf updates-not-sent { |
| 361 | type empty; |
| 362 | description |
| 363 | "This is a flag which indicates that not all data nodes |
| 364 | subscribed to are included included with this |
| 365 | update. In other words, the publisher has failed to |
| 366 | fulfill its full subscription obligations. |
| 367 | This may lead to intermittent loss of synchronization |
| 368 | of data at the client. Synchronization at the client |
| 369 | can occur when the next push-update is received."; |
| 370 | } |
| 371 | /* |
| 372 | * -------------------------------------------------------------------- |
| 373 | * datastore-contents not currently supported. |
| 374 | * Will replace datastore-contents-string in a future release. |
| 375 | anydata datastore-contents { |
| 376 | description |
| 377 | "This contains the updated data. It constitutes a snapshot |
| 378 | at the time-of-update of the set of data that has been |
| 379 | subscribed to. The format and syntax of the data |
| 380 | corresponds to the format and syntax of data that would be |
| 381 | returned in a corresponding get operation with the same |
| 382 | filter parameters applied."; |
| 383 | } |
| 384 | * -------------------------------------------------------------------- |
| 385 | */ |
| 386 | leaf datastore-contents-string { |
| 387 | type string; |
| 388 | description |
| 389 | "This contains the updated data. It constitutes a snapshot |
| 390 | at the time-of-update of the set of data that has been |
| 391 | subscribed to. The format and syntax of the data |
| 392 | corresponds to the format and syntax of data that would be |
| 393 | returned in a corresponding get operation with the same |
| 394 | filter parameters applied."; |
| 395 | } |
| 396 | /* |
| 397 | * -------------------------------------------------------------------- |
| 398 | */ |
| 399 | |
| 400 | } |
| 401 | notification push-change-update { |
| 402 | if-feature "on-change"; |
| 403 | description |
| 404 | "This notification contains an on-change push update. |
| 405 | This notification shall only be sent to the receivers |
| 406 | of a subscription; it does not constitute a general-purpose |
| 407 | notification."; |
| 408 | leaf subscription-id { |
| 409 | type notif-bis:subscription-id; |
| 410 | mandatory true; |
| 411 | description |
| 412 | "This references the subscription because of which the |
| 413 | notification is sent."; |
| 414 | } |
| 415 | leaf time-of-update { |
| 416 | type yang:date-and-time; |
| 417 | description |
| 418 | "This leaf contains the time of the update, i.e. the |
| 419 | time at which the change was observed."; |
| 420 | } |
| 421 | leaf updates-not-sent { |
| 422 | type empty; |
| 423 | description |
| 424 | "This is a flag which indicates that not all changes which |
| 425 | have occured since the last update are included with this |
| 426 | update. In other words, the publisher has failed to |
| 427 | fulfill its full subscription obligations, for example in |
| 428 | cases where it was not able to keep up with a change burst. |
| 429 | To facilitate synchronization, a publisher MAY subsequently |
| 430 | send a push-update containing a full snapshot of subscribed |
| 431 | data. Such a push-update might also be triggered by a |
| 432 | subscriber requesting an on-demand synchronization."; |
| 433 | } |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 434 | |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 435 | anydata datastore-changes { |
| 436 | description |
| 437 | "This contains datastore contents that has changed |
| 438 | since the previous update, per the terms of the |
| 439 | subscription. Changes are encoded analogous to |
| 440 | the syntax of a corresponding yang-patch operation, |
| 441 | i.e. a yang-patch operation applied to the YANG datastore |
| 442 | implied by the previous update to result in the current |
| 443 | state (and assuming yang-patch could also be applied to |
| 444 | operational data)."; |
| 445 | } |
sonugupta-huawei | 99c0a01 | 2017-12-23 00:44:15 +0530 | [diff] [blame] | 446 | |
sonugupta-huawei | b5189f1 | 2017-12-11 17:28:58 +0530 | [diff] [blame] | 447 | leaf datastore-changes-string { |
| 448 | type string; |
| 449 | description |
| 450 | "This contains datastore contents that has changed |
| 451 | since the previous update, per the terms of the |
| 452 | subscription. Changes are encoded analogous to |
| 453 | the syntax of a corresponding yang-patch operation, |
| 454 | i.e. a yang-patch operation applied to the YANG datastore |
| 455 | implied by the previous update to result in the current |
| 456 | state (and assuming yang-patch could also be applied to |
| 457 | operational data)."; |
| 458 | } |
| 459 | /* |
| 460 | * -------------------------------------------------------------------- |
| 461 | */ |
| 462 | |
| 463 | } |
| 464 | augment "/notif-bis:subscription-started" { |
| 465 | description |
| 466 | "This augmentation adds push subscription parameters |
| 467 | to the notification that a subscription has |
| 468 | started and data updates are beginning to be sent. |
| 469 | This notification shall only be sent to receivers |
| 470 | of a subscription; it does not constitute a general-purpose |
| 471 | notification."; |
| 472 | uses update-policy; |
| 473 | uses subscription-qos; |
| 474 | } |
| 475 | augment "/notif-bis:subscription-started/notif-bis:filter-type" { |
| 476 | description |
| 477 | "This augmentation allows to include additional update filters |
| 478 | options to be included as part of the notification that a |
| 479 | subscription has started."; |
| 480 | case update-filter { |
| 481 | description |
| 482 | "Additional filter options for push subscription."; |
| 483 | uses update-filter; |
| 484 | } |
| 485 | } |
| 486 | augment "/notif-bis:subscription-modified" { |
| 487 | description |
| 488 | "This augmentation adds push subscription parameters |
| 489 | to the notification that a subscription has |
| 490 | been modified. |
| 491 | This notification shall only be sent to receivers |
| 492 | of a subscription; it does not constitute a general-purpose |
| 493 | notification."; |
| 494 | uses update-policy; |
| 495 | uses subscription-qos; |
| 496 | } |
| 497 | augment "/notif-bis:subscription-modified/notif-bis:filter-type" { |
| 498 | description |
| 499 | "This augmentation allows to include additional update |
| 500 | filters options to be included as part of the notification |
| 501 | that a subscription has been modified."; |
| 502 | case update-filter { |
| 503 | description |
| 504 | "Additional filter options for push subscription."; |
| 505 | uses update-filter; |
| 506 | } |
| 507 | } |
| 508 | augment "/notif-bis:filters/notif-bis:filter/"+ |
| 509 | "notif-bis:filter-type" { |
| 510 | description |
| 511 | "This container adds additional update filter options |
| 512 | to the list of configurable filters |
| 513 | that can be applied to subscriptions. This facilitates |
| 514 | the reuse of complex filters once defined."; |
| 515 | case update-filter { |
| 516 | uses update-filter; |
| 517 | } |
| 518 | } |
| 519 | augment "/notif-bis:subscription-config/notif-bis:subscription" { |
| 520 | description |
| 521 | "Contains the list of subscriptions that are configured, |
| 522 | as opposed to established via RPC or other means."; |
| 523 | uses update-policy; |
| 524 | uses subscription-qos; |
| 525 | } |
| 526 | augment "/notif-bis:subscription-config/notif-bis:subscription/"+ |
| 527 | "notif-bis:filter-type" { |
| 528 | description |
| 529 | "Add push filters to selection of filter types."; |
| 530 | case update-filter { |
| 531 | uses update-filter; |
| 532 | } |
| 533 | } |
| 534 | augment "/notif-bis:subscriptions/notif-bis:subscription" { |
| 535 | description |
| 536 | "Contains the list of currently active subscriptions, |
| 537 | i.e. subscriptions that are currently in effect, |
| 538 | used for subscription management and monitoring purposes. |
| 539 | This includes subscriptions that have been setup via RPC |
| 540 | primitives, e.g. establish-subscription, delete-subscription, |
| 541 | and modify-subscription, as well as subscriptions that |
| 542 | have been established via configuration."; |
| 543 | uses update-policy; |
| 544 | uses subscription-qos; |
| 545 | } |
| 546 | augment "/notif-bis:subscriptions/notif-bis:subscription/"+ |
| 547 | "notif-bis:filter-type" { |
| 548 | description |
| 549 | "Add push filters to selection of filter types."; |
| 550 | case update-filter { |
| 551 | description |
| 552 | "Additional filter options for push subscription."; |
| 553 | uses update-filter; |
| 554 | } |
| 555 | } |
| 556 | } |