| < draft-ietf-netconf-restconf-notif-08.txt | draft-ietf-netconf-restconf-notif-09.txt > | |||
|---|---|---|---|---|
| NETCONF E. Voit | NETCONF E. Voit | |||
| Internet-Draft R. Rahman | Internet-Draft R. Rahman | |||
| Intended status: Standards Track E. Nilsen-Nygaard | Intended status: Standards Track E. Nilsen-Nygaard | |||
| Expires: April 7, 2019 Cisco Systems | Expires: April 22, 2019 Cisco Systems | |||
| A. Clemm | A. Clemm | |||
| Huawei | Huawei | |||
| A. Bierman | A. Bierman | |||
| YumaWorks | YumaWorks | |||
| October 4, 2018 | October 19, 2018 | |||
| RESTCONF Transport for Event Notifications | Dynamic subscription to YANG Events and Datastores over RESTCONF | |||
| draft-ietf-netconf-restconf-notif-08 | draft-ietf-netconf-restconf-notif-09 | |||
| Abstract | Abstract | |||
| This document defines a RESTCONF binding to the dynamic subscription | This document provides a RESTCONF binding to the dynamic subscription | |||
| capability of both subscribed notifications and YANG-Push. | capability of both subscribed notifications and YANG-Push. | |||
| Subscriptions to publisher defined event streams or nodes/subtrees of | ||||
| YANG Datastores is supported. | ||||
| Status of This Memo | Status of This Memo | |||
| This Internet-Draft is submitted in full conformance with the | This Internet-Draft is submitted in full conformance with the | |||
| provisions of BCP 78 and BCP 79. | provisions of BCP 78 and BCP 79. | |||
| Internet-Drafts are working documents of the Internet Engineering | Internet-Drafts are working documents of the Internet Engineering | |||
| Task Force (IETF). Note that other groups may also distribute | Task Force (IETF). Note that other groups may also distribute | |||
| working documents as Internet-Drafts. The list of current Internet- | working documents as Internet-Drafts. The list of current Internet- | |||
| Drafts is at https://datatracker.ietf.org/drafts/current/. | Drafts is at https://datatracker.ietf.org/drafts/current/. | |||
| Internet-Drafts are draft documents valid for a maximum of six months | Internet-Drafts are draft documents valid for a maximum of six months | |||
| and may be updated, replaced, or obsoleted by other documents at any | and may be updated, replaced, or obsoleted by other documents at any | |||
| time. It is inappropriate to use Internet-Drafts as reference | time. It is inappropriate to use Internet-Drafts as reference | |||
| material or to cite them other than as "work in progress." | material or to cite them other than as "work in progress." | |||
| This Internet-Draft will expire on April 7, 2019. | This Internet-Draft will expire on April 22, 2019. | |||
| Copyright Notice | Copyright Notice | |||
| Copyright (c) 2018 IETF Trust and the persons identified as the | Copyright (c) 2018 IETF Trust and the persons identified as the | |||
| document authors. All rights reserved. | document authors. All rights reserved. | |||
| This document is subject to BCP 78 and the IETF Trust's Legal | This document is subject to BCP 78 and the IETF Trust's Legal | |||
| Provisions Relating to IETF Documents | Provisions Relating to IETF Documents | |||
| (https://trustee.ietf.org/license-info) in effect on the date of | (https://trustee.ietf.org/license-info) in effect on the date of | |||
| publication of this document. Please review these documents | publication of this document. Please review these documents | |||
| skipping to change at page 2, line 19 ¶ | skipping to change at page 2, line 17 ¶ | |||
| Table of Contents | Table of Contents | |||
| 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 | 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 | |||
| 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 | 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 | |||
| 3. Dynamic Subscriptions . . . . . . . . . . . . . . . . . . . . 3 | 3. Dynamic Subscriptions . . . . . . . . . . . . . . . . . . . . 3 | |||
| 3.1. Transport Connectivity . . . . . . . . . . . . . . . . . 4 | 3.1. Transport Connectivity . . . . . . . . . . . . . . . . . 4 | |||
| 3.2. Discovery . . . . . . . . . . . . . . . . . . . . . . . . 4 | 3.2. Discovery . . . . . . . . . . . . . . . . . . . . . . . . 4 | |||
| 3.3. RESTCONF RPCs and HTTP Status Codes . . . . . . . . . . . 4 | 3.3. RESTCONF RPCs and HTTP Status Codes . . . . . . . . . . . 4 | |||
| 3.4. Call Flow for Server-Sent Events (SSE) . . . . . . . . . 6 | 3.4. Call Flow for Server-Sent Events (SSE) . . . . . . . . . 6 | |||
| 4. QoS Treatment . . . . . . . . . . . . . . . . . . . . . . . . 8 | 4. QoS Treatment . . . . . . . . . . . . . . . . . . . . . . . . 8 | |||
| 5. Mandatory JSON and datastore support . . . . . . . . . . . . 8 | 5. Notification Messages . . . . . . . . . . . . . . . . . . . . 8 | |||
| 6. Notification Messages . . . . . . . . . . . . . . . . . . . . 8 | 6. YANG Tree . . . . . . . . . . . . . . . . . . . . . . . . . . 8 | |||
| 7. YANG Tree . . . . . . . . . . . . . . . . . . . . . . . . . . 8 | 7. YANG module . . . . . . . . . . . . . . . . . . . . . . . . . 8 | |||
| 8. YANG module . . . . . . . . . . . . . . . . . . . . . . . . . 9 | 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 10 | |||
| 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 11 | 9. Security Considerations . . . . . . . . . . . . . . . . . . . 11 | |||
| 10. Security Considerations . . . . . . . . . . . . . . . . . . . 11 | 10. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 11 | |||
| 11. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 12 | 11. References . . . . . . . . . . . . . . . . . . . . . . . . . 11 | |||
| 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 12 | 11.1. Normative References . . . . . . . . . . . . . . . . . . 11 | |||
| 12.1. Normative References . . . . . . . . . . . . . . . . . . 12 | 11.2. Informative References . . . . . . . . . . . . . . . . . 13 | |||
| 12.2. Informative References . . . . . . . . . . . . . . . . . 13 | ||||
| Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 14 | Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 14 | |||
| A.1. Dynamic Subscriptions . . . . . . . . . . . . . . . . . . 14 | A.1. Dynamic Subscriptions . . . . . . . . . . . . . . . . . . 14 | |||
| A.1.1. Establishing Dynamic Subscriptions . . . . . . . . . 14 | A.1.1. Establishing Dynamic Subscriptions . . . . . . . . . 14 | |||
| A.1.2. Modifying Dynamic Subscriptions . . . . . . . . . . . 17 | A.1.2. Modifying Dynamic Subscriptions . . . . . . . . . . . 17 | |||
| A.1.3. Deleting Dynamic Subscriptions . . . . . . . . . . . 18 | A.1.3. Deleting Dynamic Subscriptions . . . . . . . . . . . 18 | |||
| A.2. Subscription State Notifications . . . . . . . . . . . . 19 | A.2. Subscription State Notifications . . . . . . . . . . . . 19 | |||
| A.2.1. subscription-modified . . . . . . . . . . . . . . . . 19 | A.2.1. subscription-modified . . . . . . . . . . . . . . . . 19 | |||
| A.2.2. subscription-completed, subscription-resumed, and | A.2.2. subscription-completed, subscription-resumed, and | |||
| replay-complete . . . . . . . . . . . . . . . . . . . 20 | replay-complete . . . . . . . . . . . . . . . . . . . 20 | |||
| A.2.3. subscription-terminated and subscription-suspended . 20 | A.2.3. subscription-terminated and subscription-suspended . 20 | |||
| skipping to change at page 3, line 31 ¶ | skipping to change at page 3, line 31 ¶ | |||
| and HTTP2 stream which maps to the definition of "stream" within | and HTTP2 stream which maps to the definition of "stream" within | |||
| [RFC7540], Section 2. | [RFC7540], Section 2. | |||
| [ note to the RFC Editor - please replace XXXX within this document | [ note to the RFC Editor - please replace XXXX within this document | |||
| with the number of this document ] | with the number of this document ] | |||
| 3. Dynamic Subscriptions | 3. Dynamic Subscriptions | |||
| This section provides specifics on how to establish and maintain | This section provides specifics on how to establish and maintain | |||
| dynamic subscriptions over RESTCONF [RFC8040]. Subscribing to event | dynamic subscriptions over RESTCONF [RFC8040]. Subscribing to event | |||
| streams is accomplished in this way via a RESTCONF POST into RPCs | streams is accomplished in this way via RPCs defined within | |||
| defined within [I-D.draft-ietf-netconf-subscribed-notifications] | [I-D.draft-ietf-netconf-subscribed-notifications] Section 2.4, the | |||
| Section 2.4. YANG datastore subscription is accomplished via | RPCs are done via RESTCONF POSTs. YANG datastore subscription is | |||
| augmentations to [I-D.draft-ietf-netconf-subscribed-notifications] as | accomplished via augmentations to | |||
| described within [I-D.ietf-netconf-yang-push] Section 4.4. | [I-D.draft-ietf-netconf-subscribed-notifications] as described within | |||
| [I-D.ietf-netconf-yang-push] Section 4.4. | ||||
| As described in [RFC8040] Section 6.3, a GET needs to be made against | As described in [RFC8040] Section 6.3, a GET needs to be made against | |||
| a specific URI on the publisher. Subscribers cannot pre-determine | a specific URI on the publisher. Subscribers cannot pre-determine | |||
| the URI against which a subscription might exist on a publisher, as | the URI against which a subscription might exist on a publisher, as | |||
| the URI will only exist after the "establish-subscription" RPC has | the URI will only exist after the "establish-subscription" RPC has | |||
| been accepted. The subscription URI will be determined and sent as | been accepted. Therefore, the POST for the "establish-subscription" | |||
| part of the response to the "establish-subscription" RPC, and a | RPC replaces the GET request for the "location" leaf which is used in | |||
| subsequent GET to this URI will be done in order to start the flow of | [RFC8040] to obtain the URI. The subscription URI will be determined | |||
| notification messages back to the subscriber. A subscription does | and sent as part of the response to the "establish-subscription" RPC, | |||
| not move to the active state as per Section 2.4.1. of | and a subsequent GET to this URI will be done in order to start the | |||
| flow of notification messages back to the subscriber. A subscription | ||||
| does not move to the active state as per Section 2.4.1. of | ||||
| [I-D.draft-ietf-netconf-subscribed-notifications] until the GET is | [I-D.draft-ietf-netconf-subscribed-notifications] until the GET is | |||
| received. The POST for the "establish-subscription" RPC replaces the | received. | |||
| GET request for the "location" leaf which is used in [RFC8040] to | ||||
| obtain the URI. | ||||
| 3.1. Transport Connectivity | 3.1. Transport Connectivity | |||
| For a dynamic subscription, where an HTTP client session doesn't | For a dynamic subscription, where a RESTCONF session doesn't already | |||
| already exist, a new client session is initiated from the subscriber. | exist, a new RESTCONF session is initiated from the subscriber. | |||
| As stated in Section 2.1 of [RFC8040], a subscriber MUST establish | As stated in Section 2.1 of [RFC8040], a subscriber MUST establish | |||
| the HTTP session over TLS [RFC5246] in order to secure the content in | the HTTP session over TLS [RFC5246] in order to secure the content in | |||
| transit. | transit. | |||
| Without the involvement of additional protocols, HTTP sessions by | Without the involvement of additional protocols, HTTP sessions by | |||
| themselves do not allow for a quick recognition of when the | themselves do not allow for a quick recognition of when the | |||
| communication path has been lost with the publisher. Where quick | communication path has been lost with the publisher. Where quick | |||
| recognition of the loss of a publisher is required, a subscriber | recognition of the loss of a publisher is required, a subscriber | |||
| SHOULD use a TLS heartbeat [RFC6520], just from receiver to | SHOULD use a TLS heartbeat [RFC6520], just from receiver to | |||
| publisher, to track HTTP session continuity. Loss of the heartbeat | publisher, to track HTTP session continuity. | |||
| MUST result in any subscription related TCP sessions between those | ||||
| endpoints being torn down. A subscriber can then attempt to re- | Loss of the heartbeat MUST result in any subscription related TCP | |||
| establish. | sessions between those endpoints being torn down. A subscriber can | |||
| then attempt to re-establish the dynamic subscription by using the | ||||
| procedure described in Section 3. | ||||
| 3.2. Discovery | 3.2. Discovery | |||
| Subscribers can learn what event streams a RESTCONF server supports | Subscribers can learn what event streams a RESTCONF server supports | |||
| by querying the "streams" container of ietf-subscribed- | by querying the "streams" container of ietf-subscribed- | |||
| notification.yang in | notification.yang in | |||
| [I-D.draft-ietf-netconf-subscribed-notifications]. Support for the | [I-D.draft-ietf-netconf-subscribed-notifications]. Support for the | |||
| "streams" container of ietf-restconf-monitoring.yang in [RFC6520] is | "streams" container of ietf-restconf-monitoring.yang in [RFC8040] is | |||
| not required. | not required. | |||
| Subscribers can learn what datastores a RESTCONF server supports by | Subscribers can learn what datastores a RESTCONF server supports by | |||
| following [I-D.draft-ietf-netconf-nmda-restconf]. | following [I-D.draft-ietf-netconf-nmda-restconf]. | |||
| 3.3. RESTCONF RPCs and HTTP Status Codes | 3.3. RESTCONF RPCs and HTTP Status Codes | |||
| Specific HTTP responses codes as defined in [RFC7231] section 6 will | Specific HTTP responses codes as defined in [RFC7231] section 6 will | |||
| indicate the result of RESTCONF RPC requests with publisher. An HTTP | indicate the result of RESTCONF RPC requests with publisher. An HTTP | |||
| status code of 200 is the proper response to any successful RPC | status code of 200 is the proper response to any successful RPC | |||
| skipping to change at page 5, line 30 ¶ | skipping to change at page 5, line 34 ¶ | |||
| modify-subscription modify-subscription-error | modify-subscription modify-subscription-error | |||
| delete-subscription delete-subscription-error | delete-subscription delete-subscription-error | |||
| kill-subscription kill-subscription-error | kill-subscription kill-subscription-error | |||
| resynch-subscription resynch-subscription-error | resynch-subscription resynch-subscription-error | |||
| Each error identity will be inserted as the "error-app-tag" using | Each error identity will be inserted as the "error-app-tag" using | |||
| JSON encoding following the form <modulename>:<identityname>. An | JSON encoding following the form <modulename>:<identityname>. An | |||
| example of such as valid encoding would be "ietf-subscribed- | example of such as valid encoding would be "ietf-subscribed- | |||
| notifications:no-such-subscription". | notifications:no-such-subscription". | |||
| o In case of error responses to an "establish-subscription" or | In case of error responses to an "establish-subscription" or "modify- | |||
| "modify-subscription" request there is the option of including an | subscription" request there is the option of including an "error- | |||
| "error-info" node. This node may contain hints for parameter | info" node. This node may contain hints for parameter settings that | |||
| settings that might lead to successful RPC requests in the future. | might lead to successful RPC requests in the future. Following are | |||
| Following are the yang-data structures which may be returned: | the yang-data structures which may be returned: | |||
| establish-subscription returns hints in yang-data structure | establish-subscription returns hints in yang-data structure | |||
| ---------------------- ------------------------------------ | ---------------------- ------------------------------------ | |||
| target: event stream establish-subscription-stream-error-info | target: event stream establish-subscription-stream-error-info | |||
| target: datastore establish-subscription-datastore-error-info | target: datastore establish-subscription-datastore-error-info | |||
| modify-subscription returns hints in yang-data structure | modify-subscription returns hints in yang-data structure | |||
| ---------------------- ------------------------------------ | ---------------------- ------------------------------------ | |||
| target: event stream modify-subscription-stream-error-info | target: event stream modify-subscription-stream-error-info | |||
| target: datastore modify-subscription-datastore-error-info | target: datastore modify-subscription-datastore-error-info | |||
| skipping to change at page 6, line 26 ¶ | skipping to change at page 6, line 26 ¶ | |||
| optional leaf "error-reason", as such a leaf would be redundant | optional leaf "error-reason", as such a leaf would be redundant | |||
| with information that is already placed within the | with information that is already placed within the | |||
| "error-app-tag". | "error-app-tag". | |||
| In case of an rpc error as a result of a "delete-subscription", a | In case of an rpc error as a result of a "delete-subscription", a | |||
| "kill-subscription", or a "resynch-subscription" request, no | "kill-subscription", or a "resynch-subscription" request, no | |||
| "error-info" needs to be included, as the "subscription-id" is | "error-info" needs to be included, as the "subscription-id" is | |||
| the only RPC input parameter and no hints regarding this RPC input | the only RPC input parameter and no hints regarding this RPC input | |||
| parameters need to be provided. | parameters need to be provided. | |||
| Note that "error-path" does not need to be included with the "rpc- | Note that "error-path" [RFC8040] does not need to be included with | |||
| error" element, as subscription errors are generally not associated | the "rpc-error" element, as subscription errors are generally | |||
| with nodes in the datastore but with the choice of RPC input | associated with the choice of RPC input parameters. | |||
| parameters. | ||||
| 3.4. Call Flow for Server-Sent Events (SSE) | 3.4. Call Flow for Server-Sent Events (SSE) | |||
| The call flow is defined in Figure 1. The logical connections | The call flow is defined in Figure 1. The logical connections | |||
| denoted by (a) and (b) can be a TCP connection or an HTTP2 stream. | denoted by (a) and (b) can be a TCP connection or an HTTP2 stream | |||
| (multiple HTTP2 streams can be carried in one TCP connection). | ||||
| Requests to [I-D.draft-ietf-netconf-subscribed-notifications] or | Requests to [I-D.draft-ietf-netconf-subscribed-notifications] or | |||
| [I-D.ietf-netconf-yang-push] augmented RPCs are sent on a connection | [I-D.ietf-netconf-yang-push] augmented RPCs are sent on a connection | |||
| indicated by (a). A successful "establish-subscription" will result | indicated by (a). A successful "establish-subscription" will result | |||
| in an RPC response returned with both a subscription identifier which | in an RPC response returned with both a subscription identifier which | |||
| uniquely identifies a subscription, as well as a URI which uniquely | uniquely identifies a subscription, as well as a URI which uniquely | |||
| identifies the location of subscription on the publisher (b). This | identifies the location of subscription on the publisher (b). This | |||
| URI is defined via the "uri" leaf the Data Model in Section 8. | URI is defined via the "uri" leaf the Data Model in Section 7. | |||
| An HTTP GET is then sent on a separate logical connection (b) to the | An HTTP GET is then sent on a separate logical connection (b) to the | |||
| URI on the publisher. This initiates the publisher to initiate the | URI on the publisher. This initiates the publisher to initiate the | |||
| flow of notification messages which are sent in SSE [W3C-20150203] as | flow of notification messages which are sent in SSE [W3C-20150203] as | |||
| a response to the GET. | a response to the GET. | |||
| +--------------+ +--------------+ | +--------------+ +--------------+ | |||
| | Subscriber | | Publisher | | | Subscriber | | Publisher | | |||
| | | | | | | | | | | |||
| | Logical | | Logical | | | Logical | | Logical | | |||
| skipping to change at page 8, line 24 ¶ | skipping to change at page 8, line 24 ¶ | |||
| 4. QoS Treatment | 4. QoS Treatment | |||
| To meet subscription quality of service promises, the publisher MUST | To meet subscription quality of service promises, the publisher MUST | |||
| take any existing subscription "dscp" and apply it to the DSCP | take any existing subscription "dscp" and apply it to the DSCP | |||
| marking in the IP header. | marking in the IP header. | |||
| In addition, where HTTP2 transport is available to a notification | In addition, where HTTP2 transport is available to a notification | |||
| message queued for transport to a receiver, the publisher MUST: | message queued for transport to a receiver, the publisher MUST: | |||
| o take any existing subscription "priority" and copy it into the | o take any existing subscription "priority", as specified by the | |||
| HTTP2 stream priority, and | "dscp" leaf node in | |||
| [I-D.draft-ietf-netconf-subscribed-notifications], and copy it | ||||
| o take any existing subscription "dependency" and map the HTTP2 | into the HTTP2 stream priority, [RFC7540] section 5.3, and | |||
| stream for the parent subscription into the HTTP2 stream | ||||
| dependency. | ||||
| 5. Mandatory JSON and datastore support | ||||
| A publisher supporting [I-D.ietf-netconf-yang-push] MUST support the | ||||
| "operational" datastore as defined by [RFC8342]. | ||||
| The "encode-json" feature of | o take any existing subscription "dependency", as specified by the | |||
| [I-D.draft-ietf-netconf-subscribed-notifications] is mandatory to | "dependency" leaf node in | |||
| support. This indicates that JSON is a valid encoding for RPCs, | [I-D.draft-ietf-netconf-subscribed-notifications], and use the | |||
| state change notifications, and subscribed content. | HTTP2 stream for the parent subscription as the HTTP2 stream | |||
| dependency, [RFC7540] section 5.3.1, of the dependent | ||||
| subscription. | ||||
| 6. Notification Messages | 5. Notification Messages | |||
| Notification messages transported over HTTP will be encoded using | Notification messages transported over RESTCONF will be encoded | |||
| one-way operation schema defined within [RFC5277], section 4. | according to [RFC8040], section 6.4. | |||
| 7. YANG Tree | 6. YANG Tree | |||
| The YANG model defined in Section 8 has one leaf augmented into four | The YANG model defined in Section 7 has one leaf augmented into four | |||
| places of [I-D.draft-ietf-netconf-subscribed-notifications], plus two | places of [I-D.draft-ietf-netconf-subscribed-notifications], plus two | |||
| identities. As the resulting full tree is large, it will only be | identities. As the resulting full tree is large, it will only be | |||
| inserted at later stages of this document. | inserted at later stages of this document. | |||
| 8. YANG module | 7. YANG module | |||
| This module references | This module references | |||
| [I-D.draft-ietf-netconf-subscribed-notifications]. | [I-D.draft-ietf-netconf-subscribed-notifications]. | |||
| <CODE BEGINS> file "ietf-restconf-subscribed-notifications@2018-10-03.yang" | <CODE BEGINS> file "ietf-restconf-subscribed-notifications@2018-10-19.yang" | |||
| module ietf-restconf-subscribed-notifications { | module ietf-restconf-subscribed-notifications { | |||
| yang-version 1.1; | yang-version 1.1; | |||
| namespace | namespace | |||
| "urn:ietf:params:xml:ns:yang:ietf-restconf-subscribed-notifications"; | "urn:ietf:params:xml:ns:yang:ietf-restconf-subscribed-notifications"; | |||
| prefix rsn; | prefix rsn; | |||
| import ietf-subscribed-notifications { | import ietf-subscribed-notifications { | |||
| prefix sn; | prefix sn; | |||
| } | } | |||
| skipping to change at page 10, line 6 ¶ | skipping to change at page 9, line 50 ¶ | |||
| Redistribution and use in source and binary forms, with or without | Redistribution and use in source and binary forms, with or without | |||
| modification, is permitted pursuant to, and subject to the license | modification, is permitted pursuant to, and subject to the license | |||
| terms contained in, the Simplified BSD License set forth in Section | terms contained in, the Simplified BSD License set forth in Section | |||
| 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents | 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents | |||
| (https://trustee.ietf.org/license-info). | (https://trustee.ietf.org/license-info). | |||
| This version of this YANG module is part of RFC XXXX; see the RFC | This version of this YANG module is part of RFC XXXX; see the RFC | |||
| itself for full legal notices."; | itself for full legal notices."; | |||
| revision 2018-10-03 { | revision 2018-10-19 { | |||
| description | description | |||
| "Initial version"; | "Initial version"; | |||
| reference | reference | |||
| "RFC XXXX: RESTCONF Transport for Event Notifications"; | "RFC XXXX: RESTCONF Transport for Event Notifications"; | |||
| } | } | |||
| identity restconf { | ||||
| base sn:transport; | ||||
| description | ||||
| "RESTCONF is used as transport for notification messages and state | ||||
| change notifications."; | ||||
| } | ||||
| grouping uri { | grouping uri { | |||
| description | description | |||
| "Provides a reusable description of a URI."; | "Provides a reusable description of a URI."; | |||
| leaf uri { | leaf uri { | |||
| type inet:uri; | type inet:uri; | |||
| config false; | config false; | |||
| description | description | |||
| "Location of a subscription specific URI on the publisher."; | "Location of a subscription specific URI on the publisher."; | |||
| } | } | |||
| } | } | |||
| augment "/sn:establish-subscription/sn:output" { | augment "/sn:establish-subscription/sn:output" { | |||
| description | description | |||
| "This augmentation allows RESTCONF specific parameters for a | "This augmentation allows RESTCONF specific parameters for a | |||
| response to a publisher's subscription request."; | response to a publisher's subscription request."; | |||
| uses uri; | uses uri; | |||
| } | } | |||
| augment "/sn:subscriptions/sn:subscription" { | augment "/sn:subscriptions/sn:subscription" { | |||
| description | description | |||
| "This augmentation allows RESTCONF specific parameters to be | "This augmentation allows RESTCONF specific parameters to be | |||
| exposed for a subscription."; | exposed for a subscription."; | |||
| uses uri; | uses uri; | |||
| } | } | |||
| augment "/sn:subscription-modified" { | augment "/sn:subscription-modified" { | |||
| description | description | |||
| "This augmentation allows RESTCONF specific parameters to be included | "This augmentation allows RESTCONF specific parameters to be included | |||
| part of the notification that a subscription has been modified."; | part of the notification that a subscription has been modified."; | |||
| uses uri; | uses uri; | |||
| } | } | |||
| } | } | |||
| <CODE ENDS> | <CODE ENDS> | |||
| 9. IANA Considerations | 8. IANA Considerations | |||
| This document registers the following namespace URI in the "IETF XML | This document registers the following namespace URI in the "IETF XML | |||
| Registry" [RFC3688]: | Registry" [RFC3688]: | |||
| URI: urn:ietf:params:xml:ns:yang:ietf-restconf-subscribed- | URI: urn:ietf:params:xml:ns:yang:ietf-restconf-subscribed- | |||
| notifications | notifications | |||
| Registrant Contact: The IESG. | Registrant Contact: The IESG. | |||
| XML: N/A; the requested URI is an XML namespace. | XML: N/A; the requested URI is an XML namespace. | |||
| This document registers the following YANG module in the "YANG Module | This document registers the following YANG module in the "YANG Module | |||
| Names" registry [RFC6020]: | Names" registry [RFC6020]: | |||
| Name: ietf-restconf-subscribed-notifications | Name: ietf-restconf-subscribed-notifications | |||
| Namespace: urn:ietf:params:xml:ns:yang:ietf-restconf-subscribed- | Namespace: urn:ietf:params:xml:ns:yang:ietf-restconf-subscribed- | |||
| notifications | notifications | |||
| Prefix: rsn | Prefix: rsn | |||
| Reference: RFC XXXX: RESTCONF Transport for Event Notifications | Reference: RFC XXXX: RESTCONF Transport for Event Notifications | |||
| 10. Security Considerations | 9. Security Considerations | |||
| The YANG module specified in this document defines a schema for data | The YANG module specified in this document defines a schema for data | |||
| that is designed to be accessed via network management transports | that is designed to be accessed via network management transports | |||
| such as NETCONF [RFC6241] or RESTCONF [RFC8040]. The lowest NETCONF | such as NETCONF [RFC6241] or RESTCONF [RFC8040]. The lowest NETCONF | |||
| layer is the secure transport layer, and the mandatory-to-implement | layer is the secure transport layer, and the mandatory-to-implement | |||
| secure transport is Secure Shell (SSH) [RFC6242]. The lowest | secure transport is Secure Shell (SSH) [RFC6242]. The lowest | |||
| RESTCONF layer is HTTPS, and the mandatory-to-implement secure | RESTCONF layer is HTTPS, and the mandatory-to-implement secure | |||
| transport is TLS [RFC5246]. | transport is TLS [RFC5246]. | |||
| The one new data node introduced in this YANG module may be | The one new data node introduced in this YANG module may be | |||
| skipping to change at page 12, line 5 ¶ | skipping to change at page 11, line 37 ¶ | |||
| or notification) to this data nodes. These are the subtrees and data | or notification) to this data nodes. These are the subtrees and data | |||
| nodes and their sensitivity/vulnerability: | nodes and their sensitivity/vulnerability: | |||
| Container: "/subscriptions" | Container: "/subscriptions" | |||
| o "uri": leaf will show where subscribed resources might be located | o "uri": leaf will show where subscribed resources might be located | |||
| on a publisher. Access control must be set so that only someone | on a publisher. Access control must be set so that only someone | |||
| with proper access permissions, and perhaps even HTTP session has | with proper access permissions, and perhaps even HTTP session has | |||
| the ability to access this resource. | the ability to access this resource. | |||
| 11. Acknowledgments | 10. Acknowledgments | |||
| We wish to acknowledge the helpful contributions, comments, and | We wish to acknowledge the helpful contributions, comments, and | |||
| suggestions that were received from: Ambika Prasad Tripathy, Alberto | suggestions that were received from: Ambika Prasad Tripathy, Alberto | |||
| Gonzalez Prieto, Susan Hares, Tim Jenkins, Balazs Lengyel, Kent | Gonzalez Prieto, Susan Hares, Tim Jenkins, Balazs Lengyel, Kent | |||
| Watsen, Michael Scharf, Guangying Zheng and Martin Bjorklund. | Watsen, Michael Scharf, Guangying Zheng, Martin Bjorklund and Qin Wu. | |||
| 12. References | 11. References | |||
| 12.1. Normative References | 11.1. Normative References | |||
| [I-D.draft-ietf-netconf-subscribed-notifications] | [I-D.draft-ietf-netconf-subscribed-notifications] | |||
| Voit, E., Clemm, A., Gonzalez Prieto, A., Tripathy, A., | Voit, E., Clemm, A., Gonzalez Prieto, A., Tripathy, A., | |||
| and E. Nilsen-Nygaard, "Custom Subscription to Event | and E. Nilsen-Nygaard, "Custom Subscription to Event | |||
| Streams", draft-ietf-netconf-subscribed-notifications-13 | Streams", draft-ietf-netconf-subscribed-notifications-13 | |||
| (work in progress), April 2018. | (work in progress), April 2018. | |||
| [I-D.ietf-netconf-yang-push] | [I-D.ietf-netconf-yang-push] | |||
| Clemm, A., Voit, E., Gonzalez Prieto, A., Prasad Tripathy, | Clemm, A., Voit, E., Gonzalez Prieto, A., Prasad Tripathy, | |||
| A., Nilsen-Nygaard, E., Bierman, A., and B. Lengyel, | A., Nilsen-Nygaard, E., Bierman, A., and B. Lengyel, | |||
| skipping to change at page 13, line 44 ¶ | skipping to change at page 13, line 29 ¶ | |||
| [RFC8342] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K., | [RFC8342] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K., | |||
| and R. Wilton, "Network Management Datastore Architecture | and R. Wilton, "Network Management Datastore Architecture | |||
| (NMDA)", RFC 8342, DOI 10.17487/RFC8342, March 2018, | (NMDA)", RFC 8342, DOI 10.17487/RFC8342, March 2018, | |||
| <https://www.rfc-editor.org/info/rfc8342>. | <https://www.rfc-editor.org/info/rfc8342>. | |||
| [W3C-20150203] | [W3C-20150203] | |||
| "Server-Sent Events, World Wide Web Consortium CR CR- | "Server-Sent Events, World Wide Web Consortium CR CR- | |||
| eventsource-20121211", February 2015, | eventsource-20121211", February 2015, | |||
| <https://www.w3.org/TR/2015/REC-eventsource-20150203/>. | <https://www.w3.org/TR/2015/REC-eventsource-20150203/>. | |||
| 12.2. Informative References | 11.2. Informative References | |||
| [I-D.draft-ietf-netconf-netconf-event-notifications] | [I-D.draft-ietf-netconf-netconf-event-notifications] | |||
| Clemm, Alexander., Voit, Eric., Gonzalez Prieto, Alberto., | Clemm, Alexander., Voit, Eric., Gonzalez Prieto, Alberto., | |||
| Nilsen-Nygaard, E., and A. Tripathy, "NETCONF support for | Nilsen-Nygaard, E., and A. Tripathy, "NETCONF support for | |||
| event notifications", May 2018, | event notifications", May 2018, | |||
| <https://datatracker.ietf.org/doc/ | <https://datatracker.ietf.org/doc/ | |||
| draft-ietf-netconf-netconf-event-notifications/>. | draft-ietf-netconf-netconf-event-notifications/>. | |||
| [I-D.draft-ietf-netconf-nmda-restconf] | [I-D.draft-ietf-netconf-nmda-restconf] | |||
| Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K., | Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K., | |||
| skipping to change at page 15, line 38 ¶ | skipping to change at page 15, line 38 ¶ | |||
| |<------------------------------| | |<------------------------------| | |||
| | HTTP 200 OK,notif-mesg (id#23)| | | HTTP 200 OK,notif-mesg (id#23)| | |||
| |<------------------------------| | |<------------------------------| | |||
| | | | | | | |||
| Figure 2: Multiple subscriptions over RESTCONF/HTTP | Figure 2: Multiple subscriptions over RESTCONF/HTTP | |||
| To provide examples of the information being transported, example | To provide examples of the information being transported, example | |||
| messages for interactions in Figure 2 are detailed below: | messages for interactions in Figure 2 are detailed below: | |||
| POST /restconf/operations/subscriptions:establish-subscription | POST /restconf/operations/ietf-subscribed-notifications:establish-subscription | |||
| { | { | |||
| "ietf-subscribed-notifications:input": { | "ietf-subscribed-notifications:input": { | |||
| "stream": "NETCONF", | "stream": "NETCONF", | |||
| "stream-xpath-filter": "/ds:foo/", | "stream-xpath-filter": "/example-module:foo/", | |||
| "dscp": "10" | "dscp": "10" | |||
| } | ||||
| } | } | |||
| } | ||||
| Figure 3: establish-subscription request (a) | Figure 3: establish-subscription request (a) | |||
| As publisher was able to fully satisfy the request, the publisher | As publisher was able to fully satisfy the request, the publisher | |||
| sends the subscription identifier of the accepted subscription, and | sends the subscription identifier of the accepted subscription, and | |||
| the URI: | the URI: | |||
| HTTP status code - 200 | HTTP status code - 200 | |||
| { | { | |||
| "id": "22", | "id": "22", | |||
| "uri": "/subscriptions/22" | "uri": "https://example.com/restconf/subscriptions/22" | |||
| } | } | |||
| Figure 4: establish-subscription success (b) | Figure 4: establish-subscription success (b) | |||
| Upon receipt of the successful response, the subscriber does a GET | Upon receipt of the successful response, the subscriber does a GET | |||
| the provided URI to start the flow of notification messages. When | the provided URI to start the flow of notification messages. When | |||
| the publisher receives this, the subscription is moved to the active | the publisher receives this, the subscription is moved to the active | |||
| state (c). | state (c). | |||
| GET /restconf/operations/subscriptions/22 | GET /restconf/subscriptions/22 | |||
| Figure 5: establish-subscription subsequent POST | Figure 5: establish-subscription subsequent POST | |||
| While not shown in Figure 2, if the publisher had not been able to | While not shown in Figure 2, if the publisher had not been able to | |||
| fully satisfy the request, or subscriber has no authorization to | fully satisfy the request, or subscriber has no authorization to | |||
| establish the subscription, the publisher would have sent an RPC | establish the subscription, the publisher would have sent an RPC | |||
| error response. For instance, if the "dscp" value of 10 asserted by | error response. For instance, if the "dscp" value of 10 asserted by | |||
| the subscriber in Figure 3 proved unacceptable, the publisher may | the subscriber in Figure 3 proved unacceptable, the publisher may | |||
| have returned: | have returned: | |||
| skipping to change at page 18, line 5 ¶ | skipping to change at page 18, line 5 ¶ | |||
| | | | | | | |||
| Figure 7: Interaction model for successful subscription modification | Figure 7: Interaction model for successful subscription modification | |||
| If the subscription being modified in Figure 7 is a datastore | If the subscription being modified in Figure 7 is a datastore | |||
| subscription as per [I-D.ietf-netconf-yang-push], the modification | subscription as per [I-D.ietf-netconf-yang-push], the modification | |||
| request made in (d) may look like that shown in Figure 8. As can be | request made in (d) may look like that shown in Figure 8. As can be | |||
| seen, the modifications being attempted are the application of a new | seen, the modifications being attempted are the application of a new | |||
| xpath filter as well as the setting of a new periodic time interval. | xpath filter as well as the setting of a new periodic time interval. | |||
| POST /restconf/operations/subscriptions:modify-subscription | POST /restconf/operations/ietf-subscribed-notifications:modify-subscription | |||
| { | { | |||
| "ietf-subscribed-notifications:input": { | "ietf-subscribed-notifications:input": { | |||
| "id": "23", | "id": "23", | |||
| "ietf-yang-push:datastore-xpath-filter": "/ds:foo/ds:bar", | "ietf-yang-push:datastore-xpath-filter": "/example-module:foo/example-module:bar", | |||
| "ietf-yang-push:periodic": { | "ietf-yang-push:periodic": { | |||
| "ietf-yang-push:period": "500" | "ietf-yang-push:period": "500" | |||
| } | } | |||
| } | } | |||
| } | } | |||
| Figure 8: Subscription modification request (c) | Figure 8: Subscription modification request (c) | |||
| If the publisher can satisfy both changes, the publisher sends a | If the publisher can satisfy both changes, the publisher sends a | |||
| positive result for the RPC. If the publisher cannot satisfy either | positive result for the RPC. If the publisher cannot satisfy either | |||
| of the proposed changes, the publisher sends an RPC error response | of the proposed changes, the publisher sends an RPC error response | |||
| (e). The following is an example RPC error response for (e) which | (e). The following is an example RPC error response for (e) which | |||
| includes a hint. This hint is an alternative time period value which | includes a hint. This hint is an alternative time period value which | |||
| might have resulted in a successful modification: | might have resulted in a successful modification: | |||
| skipping to change at page 19, line 5 ¶ | skipping to change at page 19, line 5 ¶ | |||
| } | } | |||
| } | } | |||
| Figure 9: Modify subscription failure with Hint (e) | Figure 9: Modify subscription failure with Hint (e) | |||
| A.1.3. Deleting Dynamic Subscriptions | A.1.3. Deleting Dynamic Subscriptions | |||
| The following demonstrates deleting a subscription. This | The following demonstrates deleting a subscription. This | |||
| subscription may have been to either a stream or a datastore. | subscription may have been to either a stream or a datastore. | |||
| POST /restconf/operations/subscriptions:delete-subscription | POST /restconf/operations/ietf-subscribed-notifications:delete-subscription | |||
| { | { | |||
| "delete-subscription": { | "delete-subscription": { | |||
| "id": "22" | "id": "22" | |||
| } | } | |||
| } | } | |||
| Figure 10: Delete subscription | Figure 10: Delete subscription | |||
| If the publisher can satisfy the request, the publisher replies with | If the publisher can satisfy the request, the publisher replies with | |||
| success to the RPC request. | success to the RPC request. | |||
| If the publisher cannot satisfy the request, the publisher sends an | If the publisher cannot satisfy the request, the publisher sends an | |||
| error-rpc element indicating the modification didn't work. Figure 11 | error-rpc element indicating the modification didn't work. Figure 11 | |||
| shows a valid response for existing valid subscription identifier, | shows a valid response for existing valid subscription identifier, | |||
| but that subscription identifier was created on a different transport | but that subscription identifier was created on a different transport | |||
| skipping to change at page 20, line 10 ¶ | skipping to change at page 20, line 10 ¶ | |||
| A.2.1. subscription-modified | A.2.1. subscription-modified | |||
| A "subscription-modified" encoded in JSON would look like: | A "subscription-modified" encoded in JSON would look like: | |||
| { | { | |||
| "ietf-restconf:notification" : { | "ietf-restconf:notification" : { | |||
| "eventTime": "2007-09-01T10:00:00Z", | "eventTime": "2007-09-01T10:00:00Z", | |||
| "ietf-subscribed-notifications:subscription-modified": { | "ietf-subscribed-notifications:subscription-modified": { | |||
| "id": "39", | "id": "39", | |||
| "transport": "RESTCONF", | "uri": "https://example.com/restconf/subscriptions/22" | |||
| "stream-xpath-filter": "/ex:foo", | "stream-xpath-filter": "/example-module:foo", | |||
| "stream": { | "stream": { | |||
| "ietf-netconf-subscribed-notifications" : "NETCONF" | "ietf-netconf-subscribed-notifications" : "NETCONF" | |||
| } | } | |||
| } | } | |||
| } | } | |||
| } | } | |||
| Figure 12: subscription-modified subscription state notification | Figure 12: subscription-modified subscription state notification | |||
| A.2.2. subscription-completed, subscription-resumed, and replay- | A.2.2. subscription-completed, subscription-resumed, and replay- | |||
| skipping to change at page 22, line 5 ¶ | skipping to change at page 22, line 5 ¶ | |||
| Figure 15: RFC 8347 (VRRP) - Example Notification | Figure 15: RFC 8347 (VRRP) - Example Notification | |||
| Suppose a subscriber wanted to establish a subscription which only | Suppose a subscriber wanted to establish a subscription which only | |||
| passes instances of event records where there is a "checksum-error" | passes instances of event records where there is a "checksum-error" | |||
| as part of a VRRP protocol event. Also assume the publisher places | as part of a VRRP protocol event. Also assume the publisher places | |||
| such event records into the NETCONF stream. To get a continuous | such event records into the NETCONF stream. To get a continuous | |||
| series of matching event records, the subscriber might request the | series of matching event records, the subscriber might request the | |||
| application of an XPath filter against the NETCONF stream. An | application of an XPath filter against the NETCONF stream. An | |||
| "establish-subscription" RPC to meet this objective might be: | "establish-subscription" RPC to meet this objective might be: | |||
| POST /restconf/operations/subscriptions:establish-subscription | POST /restconf/operations/ietf-subscribed-notifications:establish-subscription | |||
| { | { | |||
| "ietf-subscribed-notifications:input": { | "ietf-subscribed-notifications:input": { | |||
| "stream": "NETCONF", | "stream": "NETCONF", | |||
| "stream-xpath-filter": "/ietf-vrrp:vrrp-protocol-error-event[protocol-error-reason='checksum-error']/", | "stream-xpath-filter": "/ietf-vrrp:vrrp-protocol-error-event[protocol-error-reason='checksum-error']/", | |||
| } | } | |||
| } | } | |||
| Figure 16: Establishing a subscription error reason via XPATH | Figure 16: Establishing a subscription error reason via XPath | |||
| For more examples of xpath filters, see [XPATH]. | For more examples of XPath filters, see [XPATH]. | |||
| Suppose the "establish-subscription" in Figure 16 was accepted. And | Suppose the "establish-subscription" in Figure 16 was accepted. And | |||
| suppose later a subscriber decided they wanted to broaden this | suppose later a subscriber decided they wanted to broaden this | |||
| subscription cover to all VRRP protocol events (i.e., not just those | subscription cover to all VRRP protocol events (i.e., not just those | |||
| with a "checksum error"). The subscriber might attempt to modify the | with a "checksum error"). The subscriber might attempt to modify the | |||
| subscription in a way which replaces the XPath filter with a subtree | subscription in a way which replaces the XPath filter with a subtree | |||
| filter which sends all VRRP protocol events to a subscriber. Such a | filter which sends all VRRP protocol events to a subscriber. Such a | |||
| "modify-subscription" RPC might look like: | "modify-subscription" RPC might look like: | |||
| POST /restconf/operations/subscriptions:modify-subscription | POST /restconf/operations/ietf-subscribed-notifications:modify-subscription | |||
| { | { | |||
| "ietf-subscribed-notifications:input": { | "ietf-subscribed-notifications:input": { | |||
| "stream": "NETCONF", | "stream": "NETCONF", | |||
| "stream-subtree-filter": "/ietf-vrrp:vrrp-protocol-error-event/", | "stream-subtree-filter": { | |||
| } | "/ietf-vrrp:vrrp-protocol-error-event" : {} | |||
| } | } | |||
| } | ||||
| } | ||||
| Figure 17 | Figure 17 | |||
| For more examples of subtree filters, see [RFC6241], section 6.4. | For more examples of subtree filters, see [RFC6241], section 6.4. | |||
| Appendix B. Changes between revisions | Appendix B. Changes between revisions | |||
| (To be removed by RFC editor prior to publication) | (To be removed by RFC editor prior to publication) | |||
| v08 - v09 | ||||
| o Addressed comments received during WGLC. | ||||
| v07 - v08 | v07 - v08 | |||
| o Aligned with RESTCONF mechanism. | o Aligned with RESTCONF mechanism. | |||
| o YANG model: removed augment of subscription-started, added | o YANG model: removed augment of subscription-started, added | |||
| restconf transport. | restconf transport. | |||
| o Tweaked Appendix A.1 to match draft-ietf-netconf-netconf-event- | o Tweaked Appendix A.1 to match draft-ietf-netconf-netconf-event- | |||
| notifications-13. | notifications-13. | |||
| End of changes. 53 change blocks. | ||||
| 126 lines changed or deleted | 120 lines changed or added | |||
This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ | ||||