draft-ietf-netconf-restconf-notif-06.txt   draft-ietf-netconf-restconf-notif-07.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: December 20, 2018 Cisco Systems Expires: March 16, 2019 Cisco Systems
A. Clemm A. Clemm
Huawei Huawei
A. Bierman A. Bierman
YumaWorks YumaWorks
June 18, 2018 September 12, 2018
RESTCONF and HTTP Transport for Event Notifications RESTCONF Transport for Event Notifications
draft-ietf-netconf-restconf-notif-06 draft-ietf-netconf-restconf-notif-07
Abstract Abstract
This document defines RESTCONF, HTTP2, and HTTP1.1 bindings for the This document defines a RESTCONF binding to the dynamic subscription
transport of subscription requests and corresponding push updates. capability of both subscribed notifications and YANG-Push.
Being subscribed may be either publisher defined event streams or Subscriptions to publisher defined event streams or nodes/subtrees of
nodes/subtrees of YANG Datastores. 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 December 20, 2018. This Internet-Draft will expire on March 16, 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
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3
3. Dynamic Subscription . . . . . . . . . . . . . . . . . . . . 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 HTTP2 . . . . . . . . . . . . . . . . . . . 6 3.4. Call Flow for HTTP2 . . . . . . . . . . . . . . . . . . . 6
3.5. Call flow for HTTP1.1 . . . . . . . . . . . . . . . . . . 8 3.5. Call flow for HTTP1.1 . . . . . . . . . . . . . . . . . . 8
4. Configured Subscription . . . . . . . . . . . . . . . . . . . 10 4. QoS Treatment . . . . . . . . . . . . . . . . . . . . . . . . 10
4.1. Transport Connectivity . . . . . . . . . . . . . . . . . 10 5. Mandatory JSON and datastore support . . . . . . . . . . . . 10
4.2. Call Flow . . . . . . . . . . . . . . . . . . . . . . . . 11 6. Notification Messages . . . . . . . . . . . . . . . . . . . . 10
5. QoS Treatment . . . . . . . . . . . . . . . . . . . . . . . . 12 7. YANG Tree . . . . . . . . . . . . . . . . . . . . . . . . . . 10
6. Mandatory JSON and datastore support . . . . . . . . . . . . 12 8. YANG module . . . . . . . . . . . . . . . . . . . . . . . . . 10
7. Notification Messages . . . . . . . . . . . . . . . . . . . . 12 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 13
8. YANG Tree . . . . . . . . . . . . . . . . . . . . . . . . . . 12 10. Security Considerations . . . . . . . . . . . . . . . . . . . 13
9. YANG module . . . . . . . . . . . . . . . . . . . . . . . . . 13 11. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 13
10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 15 12. References . . . . . . . . . . . . . . . . . . . . . . . . . 14
11. Security Considerations . . . . . . . . . . . . . . . . . . . 15 12.1. Normative References . . . . . . . . . . . . . . . . . . 14
12. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 16 12.2. Informative References . . . . . . . . . . . . . . . . . 15
13. References . . . . . . . . . . . . . . . . . . . . . . . . . 16 Appendix A. Examples . . . . . . . . . . . . . . . . . . . . . . 16
13.1. Normative References . . . . . . . . . . . . . . . . . . 17 A.1. Dynamic Subscriptions . . . . . . . . . . . . . . . . . . 16
13.2. Informative References . . . . . . . . . . . . . . . . . 18 A.1.1. Establishing Dynamic Subscriptions . . . . . . . . . 16
Appendix A. RESTCONF over GRPC . . . . . . . . . . . . . . . . . 19 A.1.2. Modifying Dynamic Subscriptions . . . . . . . . . . . 19
Appendix B. Examples . . . . . . . . . . . . . . . . . . . . . . 19 A.1.3. Deleting Dynamic Subscriptions . . . . . . . . . . . 20
B.1. Dynamic Subscriptions . . . . . . . . . . . . . . . . . . 19 A.2. Subscription State Notifications . . . . . . . . . . . . 21
B.1.1. Establishing Dynamic Subscriptions . . . . . . . . . 19 A.2.1. subscription-started and subscription-modified . . . 21
B.1.2. Modifying Dynamic Subscriptions . . . . . . . . . . . 22 A.2.2. subscription-completed, subscription-resumed, and
B.1.3. Deleting Dynamic Subscriptions . . . . . . . . . . . 23 replay-complete . . . . . . . . . . . . . . . . . . . 22
B.2. Configured Subscriptions . . . . . . . . . . . . . . . . 24 A.2.3. subscription-terminated and subscription-suspended . 22
B.2.1. Creating Configured Subscriptions . . . . . . . . . . 25 Appendix B. Changes between revisions . . . . . . . . . . . . . 23
B.2.2. Modifying Configured Subscriptions . . . . . . . . . 27 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 24
B.2.3. Deleting Configured Subscriptions . . . . . . . . . . 29
B.3. Subscription State Notifications . . . . . . . . . . . . 30
B.3.1. subscription-started and subscription-modified . . . 30
B.3.2. subscription-completed, subscription-resumed, and
replay-complete . . . . . . . . . . . . . . . . . . . 31
B.3.3. subscription-terminated and subscription-suspended . 31
Appendix C. Changes between revisions . . . . . . . . . . . . . 32
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 33
1. Introduction 1. Introduction
Mechanisms to support event subscription and push are defined in Mechanisms to support event subscription and push are defined in
[I-D.draft-ietf-netconf-subscribed-notifications]. Enhancements to [I-D.draft-ietf-netconf-subscribed-notifications]. Enhancements to
[I-D.draft-ietf-netconf-subscribed-notifications] which enable YANG [I-D.draft-ietf-netconf-subscribed-notifications] which enable YANG
datastore subscription and push are defined in datastore subscription and push are defined in
[I-D.ietf-netconf-yang-push]. This document provides a transport [I-D.ietf-netconf-yang-push]. This document provides a transport
specification for these protocols over RESTCONF [RFC8040] and HTTP. specification for dynamic subscriptions over RESTCONF [RFC8040].
Driving these requirements is [RFC7923]. Driving these requirements is [RFC7923].
The streaming of notifications encapsulating the resulting The streaming of notifications encapsulating the resulting
information push can be done with either HTTP1.1 [RFC7231] or HTTP2 information push can be done with either HTTP1.1 [RFC7231] or HTTP2
[RFC7540]. [RFC7540].
2. Terminology 2. Terminology
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in RFC 2119 [RFC2119]. document are to be interpreted as described in RFC 2119 [RFC2119].
The following terms use the definitions from The following terms use the definitions from
[I-D.draft-ietf-netconf-subscribed-notifications]: configured [I-D.draft-ietf-netconf-subscribed-notifications]: dynamic
subscription, dynamic subscription, event stream, notification subscription, event stream, notification message, publisher,
message, publisher, receiver, subscriber, and subscription. receiver, subscriber, and subscription.
Other terms reused include datastore, which is defined in [RFC8342], Other terms reused include datastore, which is defined in [RFC8342],
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 Subscription 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 HTTP 1.1 and HTTP2 via signaling messages dynamic subscriptions over HTTP 1.1 and HTTP2 via signaling messages
transported over RESTCONF [RFC8040]. Subscribing to event streams is transported over RESTCONF [RFC8040]. Subscribing to event streams is
accomplished in this way via a RESTCONF POST into RPCs defined within accomplished in this way via a RESTCONF POST into RPCs defined within
[I-D.draft-ietf-netconf-subscribed-notifications] Section 2.4. YANG [I-D.draft-ietf-netconf-subscribed-notifications] Section 2.4. YANG
datastore subscription is accomplished via augmentations to datastore subscription is accomplished via augmentations to
[I-D.draft-ietf-netconf-subscribed-notifications] as described within [I-D.draft-ietf-netconf-subscribed-notifications] as described within
[I-D.ietf-netconf-yang-push] Section 4.4. [I-D.ietf-netconf-yang-push] Section 4.4.
skipping to change at page 6, line 40 skipping to change at page 6, line 40
3.4. Call Flow for HTTP2 3.4. Call Flow for HTTP2
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 one or more [I-D.ietf-netconf-yang-push] augmented RPCs are sent on one or more
HTTP2 streams indicated by (a) in Figure 1. A successful "establish- HTTP2 streams indicated by (a) in Figure 1. A successful "establish-
subscription" will result in an RPC response returned with both a subscription" will result in an RPC response returned with both a
subscription identifier which uniquely identifies a subscription, as subscription identifier which uniquely identifies a subscription, as
well as a URI which uniquely identifies the location of subscription well as a URI which uniquely identifies the location of subscription
on the publisher. This URI is defined via the "uri" leaf the Data on the publisher. This URI is defined via the "uri" leaf the Data
Model in Section 9. Model in Section 8.
An HTTP POST is then sent on a logically separate HTTP2 stream (b) to An HTTP POST is then sent on a logically separate HTTP2 stream (b) to
the URI on the publisher. This initiates to initiate the flow of the URI on the publisher. This initiates to initiate the flow of
notification messages which are sent in HTTP Data frames as a notification messages which are sent in HTTP Data frames as a
response to the POST. In the case below, a newly established response to the POST. In the case below, a newly established
subscription has its associated notification messages pushed over subscription has its associated notification messages pushed over
HTTP2 stream (7). These notification messages are placed into a HTTP2 stream (7). These notification messages are placed into a
HTTP2 Data frame (see [RFC7540] Section 6.1). HTTP2 Data frame (see [RFC7540] Section 6.1).
+------------+ +------------+ +------------+ +------------+
skipping to change at page 8, line 24 skipping to change at page 8, line 24
3.5. Call flow for HTTP1.1 3.5. Call flow for HTTP1.1
The call flow is defined in Figure 2. Requests to The call flow is defined in Figure 2. Requests to
[I-D.draft-ietf-netconf-subscribed-notifications] or [I-D.draft-ietf-netconf-subscribed-notifications] or
[I-D.ietf-netconf-yang-push] augmented RPCs are sent on a TCP [I-D.ietf-netconf-yang-push] augmented RPCs are sent on a TCP
connection indicated by (a). A successful "establish-subscription" connection indicated by (a). A successful "establish-subscription"
will result in an RPC response returned with both a subscription will result in an RPC response returned with both a subscription
identifier which uniquely identifies a subscription, as well as a URI identifier which uniquely identifies a subscription, as well as a URI
which uniquely identifies the location of subscription on the which uniquely identifies the location of subscription on the
publisher (b). This URI is defined via the "uri" leaf the Data Model publisher (b). This URI is defined via the "uri" leaf the Data Model
in Section 9. in Section 8.
An HTTP POST is then sent on a logically separate TCP connection (b) An HTTP POST is then sent on a logically separate TCP connection (b)
to the URI on the publisher. This initiates to initiate the flow of to the URI on the publisher. This initiates to initiate the flow of
notification messages which are sent in SSE [W3C-20150203] as a notification messages which are sent in SSE [W3C-20150203] as a
response to the POST. response to the POST.
+--------------+ +--------------+ +--------------+ +--------------+
| Subscriber | | Publisher | | Subscriber | | Publisher |
|TCP connection| |TCP connection| |TCP connection| |TCP connection|
| (a) (b) | | (a) (b) | | (a) (b) | | (a) (b) |
skipping to change at page 10, line 8 skipping to change at page 10, line 8
o In addition to an RPC response for a "modify-subscription" RPC o In addition to an RPC response for a "modify-subscription" RPC
traveling over (a), a "subscription-modified" state change traveling over (a), a "subscription-modified" state change
notification must be sent within stream (b). This allows the notification must be sent within stream (b). This allows the
receiver to know exactly when the new terms of the subscription receiver to know exactly when the new terms of the subscription
have been applied to the notification messages. See arrow (c). have been applied to the notification messages. See arrow (c).
Open question, should we just eliminate this possibility of HTTP1.1 Open question, should we just eliminate this possibility of HTTP1.1
for subscriptions? It would make the design simpler. for subscriptions? It would make the design simpler.
4. Configured Subscription 4. QoS Treatment
With a configured subscription, all information needed to establish a
secure relationship with that receiver is available on the publisher.
With this information, the publisher will establish a secure
transport connection with the receiver and then begin pushing
notification messages to the receiver. Since RESTCONF might not
exist on the receiver, it is not desirable to require that subscribed
content be pushed with any dependency on RESTCONF. Therefore in
place of RESTCONF, an HTTP2 Client connection must be established
with an HTTP2 Server located on the receiver. Notification messages
will then be sent as part of an extended HTTP POST to the receiver.
4.1. Transport Connectivity
Configured subscriptions MUST only be connected over HTTP2 via a
client session initiated from the publisher. Following are the
conditions which MUST be met before establishing a new HTTP2
connection with a receiver:
o a configured subscription has a receiver in the connecting state
as described in [I-D.draft-ietf-netconf-subscribed-notifications],
section 2.5.1.,
o the transport configured for that subscription is HTTP2,
o there are state change notifications or notification messages
pending for that receiver, and
o no HTTP2 transport session exists to that receiver,
If the above conditions are met, then the publisher MUST initiate a
transport session via RESTCONF call home [RFC8071], section 4.1 to
that receiver. HTTP2 only communications must be used as per
[RFC7540], Section 3.3 when the HTTP session over TLS [RFC5246]. and
[RFC7540], Section 3.4 when transporting cleartext over TCP. Note
that a subscriber SHOULD establish over TLS in order to secure the
content in transit.
If the RESTCONF call home fails because the publisher receives
receiver credentials which are subsequently declined per [RFC8071],
Section 4.1, step S5 authentication, then that receiver MUST be
placed into the timeout state.
If the call home fails to establish for any other reason, the
publisher MUST NOT progress the receiver to the active state.
Additionally, the publisher SHOULD place the receiver into the
timeout state after a predetermined number of either failed call home
attempts or remote transport session termination by the receiver.
4.2. Call Flow
With HTTP2 connectivity established, a POST of each new
"subscription-started" state change notification messages will be
addressed to HTTP augmentation code on the receiver capable of
accepting and acknowledging to subscription state change
notifications. Until the "HTTP 200 OK" at point (c) of Figure 3 for
each the "subscription-started" state change notification, a
publisher MUST NOT progress the receiver to the active state. In
other words, is at point (c) which indicates that the receiver is
ready for the delivery of subscribed content. At this point a
notification-messages including subscribed content may be placed onto
an HTTP2 stream for that subscription.
+------------+ +------------+
| Receiver | | Publisher |
|HTTP2 Stream| |HTTP2 Stream|
| (a) (b) | | (a) (b) |
+------------+ +------------+
|HTTP Post Headers, Data (subscription-started)|
|<---------------------------------------------|
| HTTP 200 OK |
|-------------------------------------------->(c)
| | HTTP Post Headers, Data (notif-message)|
| |<---------------------------------------------|
| | HTTP Data (notif-message)|
| |<---------------------------------------------|
| | HTTP Data (sub-terminated)|
| |<---------------------------------------------|
| |HTTP 200 OK |
| |--------------------------------------------->|
Figure 3: Configured over HTTP2
Additional requirements for configured subscriptions over HTTP2
include:
o A unique HTTP2 stream MAY be used for each subscription.
o A single HTTP2 stream MUST NOT be used for subscriptions with
different DSCP values.
o All subscription state notifications from a publisher MUST be
returned in a separate HTTP Data frame within the HTTP2 stream
used by the subscription to which the state change refers.
o An HTTP end of stream message MUST not be sent until all
subscriptions using that HTTP2 stream have completed.
5. 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" and copy it into the
HTTP2 stream priority, and HTTP2 stream priority, and
o take any existing subscription "dependency" and map the HTTP2 o take any existing subscription "dependency" and map the HTTP2
stream for the parent subscription into the HTTP2 stream stream for the parent subscription into the HTTP2 stream
dependency. dependency.
6. Mandatory JSON and datastore support 5. Mandatory JSON and datastore support
A publisher supporting [I-D.ietf-netconf-yang-push] MUST support the A publisher supporting [I-D.ietf-netconf-yang-push] MUST support the
"operational" datastore as defined by [RFC8342]. "operational" datastore as defined by [RFC8342].
The "encode-json" feature of The "encode-json" feature of
[I-D.draft-ietf-netconf-subscribed-notifications] is mandatory to [I-D.draft-ietf-netconf-subscribed-notifications] is mandatory to
support. This indicates that JSON is a valid encoding for RPCs, support. This indicates that JSON is a valid encoding for RPCs,
state change notifications, and subscribed content. state change notifications, and subscribed content.
7. Notification Messages 6. Notification Messages
Notification messages transported over HTTP will be encoded using Notification messages transported over HTTP will be encoded using
one-way operation schema defined within [RFC5277], section 4. one-way operation schema defined within [RFC5277], section 4.
8. YANG Tree 7. YANG Tree
The YANG model defined in Section 9 has one leaf augmented into four The YANG model defined in Section 8 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.
9. YANG module 8. 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-http-subscribed-notifications@2018-06-11.yang" <CODE BEGINS> file "ietf-restconf-subscribed-notifications@2018-09-12.yang"
module ietf-http-subscribed-notifications { module ietf-restconf-subscribed-notifications {
yang-version 1.1; yang-version 1.1;
namespace namespace
"urn:ietf:params:xml:ns:yang:ietf-http-subscribed-notifications"; "urn:ietf:params:xml:ns:yang:ietf-restconf-subscribed-notifications";
prefix hsn;
import ietf-subscribed-notifications {
prefix sn;
}
import ietf-inet-types {
prefix inet;
}
organization "IETF NETCONF (Network Configuration) Working Group"; prefix rsn;
contact
"WG Web: <http:/tools.ietf.org/wg/netconf/>
WG List: <mailto:netconf@ietf.org>
Editor: Eric Voit import ietf-subscribed-notifications {
<mailto:evoit@cisco.com> prefix sn;
}
import ietf-inet-types {
prefix inet;
}
Editor: Alexander Clemm organization "IETF NETCONF (Network Configuration) Working Group";
<mailto:ludwig@clemm.org> contact
"WG Web: <http:/tools.ietf.org/wg/netconf/>
WG List: <mailto:netconf@ietf.org>
Editor: Reshad Rahman Editor: Eric Voit
<mailto:rrahman@cisco.com>"; <mailto:evoit@cisco.com>
description Editor: Alexander Clemm
"Defines HTTP variants as a supported transports for subscribed <mailto:ludwig@clemm.org>
event notifications.
Copyright (c) 2018 IETF Trust and the persons identified as authors Editor: Reshad Rahman
of the code. All rights reserved. <mailto:rrahman@cisco.com>";
Redistribution and use in source and binary forms, with or without description
modification, is permitted pursuant to, and subject to the license "Defines RESTCONF as a supported transport for subscribed
terms contained in, the Simplified BSD License set forth in Section event notifications.
4.c of the IETF Trust's Legal Provisions Relating to IETF Documents
(https://trustee.ietf.org/license-info).
This version of this YANG module is part of RFC XXXX; see the RFC Copyright (c) 2018 IETF Trust and the persons identified as authors
itself for full legal notices."; of the code. All rights reserved.
revision 2018-06-11 { Redistribution and use in source and binary forms, with or without
description modification, is permitted pursuant to, and subject to the license
"Initial version"; terms contained in, the Simplified BSD License set forth in Section
reference 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents
"RFC XXXX: RESTCONF and HTTP Transport for Event Notifications"; (https://trustee.ietf.org/license-info).
}
identity http2 { This version of this YANG module is part of RFC XXXX; see the RFC
base sn:transport; itself for full legal notices.";
base sn:inline-address;
base sn:configurable-encoding;
description
"HTTP2 is used a transport for notification messages and state
change notifications.";
}
identity http1.1 { revision 2018-09-12 {
base sn:transport; description
base sn:inline-address; "Initial version";
base sn:configurable-encoding; reference
description "RFC XXXX: RESTCONF Transport for Event Notifications";
"HTTP1.1 is used a transport for notification messages and state
change notifications.";
}
grouping uri { }
description
"Provides a reusable description of a URI.";
leaf uri {
type inet:uri;
config false;
description
"Location of a subscription specific URI on the publisher.";
}
}
augment "/sn:establish-subscription/sn:output" { grouping uri {
description description
"This augmentation allows HTTP specific parameters for a "Provides a reusable description of a URI.";
response to a publisher's subscription request."; leaf uri {
uses uri; type inet:uri;
} config false;
description
"Location of a subscription specific URI on the publisher.";
}
}
augment "/sn:subscriptions/sn:subscription" { augment "/sn:establish-subscription/sn:output" {
description description
"This augmentation allows HTTP specific parameters to be "This augmentation allows HTTP specific parameters for a
exposed for a subscription."; response to a publisher's subscription request.";
uses uri; uses uri;
} }
augment "/sn:subscription-started" { augment "/sn:subscriptions/sn:subscription" {
description description
"This augmentation allows HTTP specific parameters to be included "This augmentation allows HTTP specific parameters to be
part of the notification that a subscription has started."; exposed for a subscription.";
uses uri; uses uri;
} }
augment "/sn:subscription-modified" { augment "/sn:subscription-started" {
description description
"This augmentation allows HTTP specific parameters to be included "This augmentation allows HTTP specific parameters to be included
part of the notification that a subscription has been modified."; part of the notification that a subscription has started.";
uses uri; uses uri;
} }
} augment "/sn:subscription-modified" {
<CODE ENDS> description
"This augmentation allows HTTP specific parameters to be included
part of the notification that a subscription has been modified.";
uses uri;
}
10. IANA Considerations }
<CODE ENDS>
9. 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-http-subscribed-notifications URI: urn:ietf:params:xml:ns:yang:ietf-restconf-subscribed-
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-http-subscribed-notifications Name: ietf-restconf-subscribed-notifications
Namespace: urn:ietf:params:xml:ns:yang:ietf-http-subscribed- Namespace: urn:ietf:params:xml:ns:yang:ietf-restconf-subscribed-
notifications notifications
Prefix: hsn Prefix: rsn
Reference: RFC XXXX: RESTCONF and HTTP Transport for Event Reference: RFC XXXX: RESTCONF Transport for Event Notifications
Notifications
11. Security Considerations 10. 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 16, line 20 skipping to change at page 13, line 46
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.
One or more publishers of configured subscriptions could be used to 11. Acknowledgments
overwhelm a receiver which doesn't even support subscriptions. There
are two protections needing support on a publisher. First,
notification messages for configured subscriptions MUST only be
transmittable over encrypted transports. Clients which do not want
pushed content need only terminate or refuse any transport sessions
from the publisher. Second, the HTTP transport augmentation on the
receiver must send an HTTP 200 OK to a subscription started
notification before the publisher starts streaming any subscribed
content.
One or more publishers could overwhelm a receiver which is unable to
control or handle the volume of Event Notifications received. In
deployments where this might be a concern, HTTP2 transport such as
HTTP2) should be selected.
The NETCONF Authorization Control Model [RFC6536] SHOULD be used to
control and restrict authorization of subscription configuration.
12. 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, and Guangying Zheng. Watsen, Michael Scharf, and Guangying Zheng.
13. References 12. References
13.1. Normative References
[GRPC] "RPC framework that runs over HTTP2", August 2017, 12.1. Normative References
<https://grpc.io/>.
[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 18, line 15 skipping to change at page 15, line 11
[RFC6242] Wasserman, M., "Using the NETCONF Protocol over Secure [RFC6242] Wasserman, M., "Using the NETCONF Protocol over Secure
Shell (SSH)", RFC 6242, DOI 10.17487/RFC6242, June 2011, Shell (SSH)", RFC 6242, DOI 10.17487/RFC6242, June 2011,
<https://www.rfc-editor.org/info/rfc6242>. <https://www.rfc-editor.org/info/rfc6242>.
[RFC6520] Seggelmann, R., Tuexen, M., and M. Williams, "Transport [RFC6520] Seggelmann, R., Tuexen, M., and M. Williams, "Transport
Layer Security (TLS) and Datagram Transport Layer Security Layer Security (TLS) and Datagram Transport Layer Security
(DTLS) Heartbeat Extension", RFC 6520, (DTLS) Heartbeat Extension", RFC 6520,
DOI 10.17487/RFC6520, February 2012, DOI 10.17487/RFC6520, February 2012,
<https://www.rfc-editor.org/info/rfc6520>. <https://www.rfc-editor.org/info/rfc6520>.
[RFC6536] Bierman, A. and M. Bjorklund, "Network Configuration
Protocol (NETCONF) Access Control Model", RFC 6536,
DOI 10.17487/RFC6536, March 2012,
<https://www.rfc-editor.org/info/rfc6536>.
[RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer
Protocol (HTTP/1.1): Message Syntax and Routing", Protocol (HTTP/1.1): Message Syntax and Routing",
RFC 7230, DOI 10.17487/RFC7230, June 2014, RFC 7230, DOI 10.17487/RFC7230, June 2014,
<https://www.rfc-editor.org/info/rfc7230>. <https://www.rfc-editor.org/info/rfc7230>.
[RFC7540] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext [RFC7540] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext
Transfer Protocol Version 2 (HTTP/2)", RFC 7540, Transfer Protocol Version 2 (HTTP/2)", RFC 7540,
DOI 10.17487/RFC7540, May 2015, DOI 10.17487/RFC7540, May 2015,
<https://www.rfc-editor.org/info/rfc7540>. <https://www.rfc-editor.org/info/rfc7540>.
skipping to change at page 18, line 44 skipping to change at page 15, line 35
[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/>.
13.2. Informative References 12.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 19, line 22 skipping to change at page 16, line 15
[RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer
Protocol (HTTP/1.1): Semantics and Content", RFC 7231, Protocol (HTTP/1.1): Semantics and Content", RFC 7231,
DOI 10.17487/RFC7231, June 2014, DOI 10.17487/RFC7231, June 2014,
<https://www.rfc-editor.org/info/rfc7231>. <https://www.rfc-editor.org/info/rfc7231>.
[RFC7923] Voit, E., Clemm, A., and A. Gonzalez Prieto, "Requirements [RFC7923] Voit, E., Clemm, A., and A. Gonzalez Prieto, "Requirements
for Subscription to YANG Datastores", RFC 7923, for Subscription to YANG Datastores", RFC 7923,
DOI 10.17487/RFC7923, June 2016, DOI 10.17487/RFC7923, June 2016,
<https://www.rfc-editor.org/info/rfc7923>. <https://www.rfc-editor.org/info/rfc7923>.
[RFC8071] Watsen, K., "NETCONF Call Home and RESTCONF Call Home", Appendix A. Examples
RFC 8071, DOI 10.17487/RFC8071, February 2017,
<https://www.rfc-editor.org/info/rfc8071>.
Appendix A. RESTCONF over GRPC
An initial goal for this document was to support [GRPC] transport
seamlessly without any mapping or extra layering. However there is
an incompatibility of RESTCONF and GRPC. RESTCONF uses HTTP GET, and
GRPC uses HTTP2's POST rather than GET. As GET is used across
RESTCONF for things like capabilities exchange, a seamless mapping
depends on specification changes outside the scope of this document.
If/when GRPC supports GET, or RESTCONF is updated to support POST,
this should be revisited. It is hoped that the resulting fix will be
transparent to this document.
Appendix B. Examples
This section is non-normative. To allow easy comparison, this This section is non-normative. To allow easy comparison, this
section mirrors the functional examples shown with NETCONF over XML section mirrors the functional examples shown with NETCONF over XML
within [I-D.draft-ietf-netconf-netconf-event-notifications]. In within [I-D.draft-ietf-netconf-netconf-event-notifications]. In
addition, HTTP2 vs HTTP1.1 headers are not shown as the contents of addition, HTTP2 vs HTTP1.1 headers are not shown as the contents of
the JSON encoded objects are identical within. the JSON encoded objects are identical within.
B.1. Dynamic Subscriptions A.1. Dynamic Subscriptions
B.1.1. Establishing Dynamic Subscriptions A.1.1. Establishing Dynamic Subscriptions
The following figure shows two successful "establish-subscription" The following figure shows two successful "establish-subscription"
RPC requests as per RPC requests as per
[I-D.draft-ietf-netconf-subscribed-notifications]. The first request [I-D.draft-ietf-netconf-subscribed-notifications]. The first request
is given a subscription identifier of 22, the second, an identifier is given a subscription identifier of 22, the second, an identifier
of 23. of 23.
+------------+ +-----------+ +------------+ +-----------+
| Subscriber | | Publisher | | Subscriber | | Publisher |
+------------+ +-----------+ +------------+ +-----------+
skipping to change at page 20, line 35 skipping to change at page 17, line 33
|POST (URI#2) | |POST (URI#2) |
|------------------------------>| |------------------------------>|
| | | |
| | | |
| notif-mesg (id#22)| | notif-mesg (id#22)|
|<------------------------------| |<------------------------------|
| HTTP 200 OK,notif-mesg (id#23)| | HTTP 200 OK,notif-mesg (id#23)|
|<------------------------------| |<------------------------------|
| | | |
Figure 4: Multiple subscriptions over RESTCONF/HTTP Figure 3: 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 4 are detailed below: messages for interactions in Figure 3 are detailed below:
POST /restconf/operations/subscriptions:establish-subscription POST /restconf/operations/subscriptions:establish-subscription
{ {
"ietf-subscribed-notifications:input": { "ietf-subscribed-notifications:input": {
"stream": "NETCONF", "stream": "NETCONF",
"stream-xpath-filter": "/ex:foo/", "stream-xpath-filter": "/ex:foo/",
"dscp": "10" "dscp": "10"
} }
} }
Figure 5: establish-subscription request (a) Figure 4: 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
{ {
"identifier": "22", "id": "22",
"uri": "/subscriptions/22" "uri": "/subscriptions/22"
} }
Figure 6: establish-subscription success (b) Figure 5: establish-subscription success (b)
Upon receipt of the successful response, the subscriber POSTs to the Upon receipt of the successful response, the subscriber POSTs to 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 publisher receives this, the subscription is moved to the active
state (c). state (c).
POST /restconf/operations/subscriptions/22 POST /restconf/operations/subscriptions/22
Figure 7: establish-subscription subsequent POST Figure 6: establish-subscription subsequent POST
While not shown in Figure 4, if the publisher had not been able to While not shown in Figure 3, 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 5 proved unacceptable, the publisher may the subscriber in Figure 4 proved unacceptable, the publisher may
have returned: have returned:
HTTP status code - 406 HTTP status code - 406
{ "ietf-restconf:errors" : { { "ietf-restconf:errors" : {
"error" : [ "error" : [
{ {
"error-type": "application", "error-type": "application",
"error-tag": "operation-failed", "error-tag": "operation-failed",
"error-severity": "error", "error-severity": "error",
"error-app-tag": "error-app-tag":
"ietf-subscribed-notifications:dscp-unavailable" "ietf-subscribed-notifications:dscp-unavailable"
} }
] ]
} }
} }
Figure 8: an unsuccessful establish subscription Figure 7: an unsuccessful establish subscription
The subscriber can use this information in future attempts to The subscriber can use this information in future attempts to
establish a subscription. establish a subscription.
B.1.2. Modifying Dynamic Subscriptions A.1.2. Modifying Dynamic Subscriptions
An existing subscription may be modified. The following exchange An existing subscription may be modified. The following exchange
shows a negotiation of such a modification via several exchanges shows a negotiation of such a modification via several exchanges
between a subscriber and a publisher. This negotiation consists of a between a subscriber and a publisher. This negotiation consists of a
failed RPC modification request/response, followed by a successful failed RPC modification request/response, followed by a successful
one. one.
+------------+ +-----------+ +------------+ +-----------+
| Subscriber | | Publisher | | Subscriber | | Publisher |
+------------+ +-----------+ +------------+ +-----------+
skipping to change at page 22, line 37 skipping to change at page 19, line 34
| | | |
|modify-subscription (id#23) | |modify-subscription (id#23) |
|----------------------------->| |----------------------------->|
| HTTP 200 OK | | HTTP 200 OK |
|<-----------------------------| |<-----------------------------|
| | | |
| notif-mesg (id#23)| | notif-mesg (id#23)|
|<-----------------------------| |<-----------------------------|
| | | |
Figure 9: Interaction model for successful subscription modification Figure 8: Interaction model for successful subscription modification
If the subscription being modified in Figure 9 is a datastore If the subscription being modified in Figure 8 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 10. As can be request made in (d) may look like that shown in Figure 9. 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/subscriptions:modify-subscription
{ {
"ietf-subscribed-notifications:input": { "ietf-subscribed-notifications:input": {
"identifier": "23", "id": "23",
"ietf-yang-push:datastore-xpath-filter": "ietf-yang-push:datastore-xpath-filter":
"/interfaces-state/interface/oper-status" "/interfaces-state/interface/oper-status"
"ietf-yang-push:periodic": { "ietf-yang-push:periodic": {
"ietf-yang-push:period": "500" "ietf-yang-push:period": "500"
} }
} }
} }
Figure 10: Subscription modification request (c) Figure 9: 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:
HTTP status code - 406 HTTP status code - 406
skipping to change at page 23, line 45 skipping to change at page 20, line 45
"error-info": { "error-info": {
"ietf-yang-push": "ietf-yang-push":
"modify-subscription-datastore-error-info": { "modify-subscription-datastore-error-info": {
"period-hint": "3000" "period-hint": "3000"
} }
} }
] ]
} }
} }
Figure 11: Modify subscription failure with Hint (e) Figure 10: Modify subscription failure with Hint (e)
B.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/subscriptions:delete-subscription
{ {
"delete-subscription": { "delete-subscription": {
"identifier": "22" "id": "22"
} }
} }
Figure 12: Delete subscription Figure 11: 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 13 error-rpc element indicating the modification didn't work. Figure 12
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
session: session:
HTTP status code - 406 HTTP status code - 406
{ {
"ietf-restconf:errors" : { "ietf-restconf:errors" : {
"error" : [ "error" : [
"error-type": "application", "error-type": "application",
"error-tag": "operation-failed", "error-tag": "operation-failed",
"error-severity": "error", "error-severity": "error",
"error-app-tag": "error-app-tag":
"ietf-subscribed-notifications:no-such-subscription" "ietf-subscribed-notifications:no-such-subscription"
] ]
} }
} }
Figure 13: Unsuccessful delete subscription Figure 12: Unsuccessful delete subscription
B.2. Configured Subscriptions
Configured subscriptions may be established, modified, and deleted
using configuration operations against the top-level subtree of
[I-D.draft-ietf-netconf-subscribed-notifications] or
[I-D.ietf-netconf-yang-push].
In this section, we present examples of how to manage the
configuration subscriptions using a HTTP2 client.
B.2.1. Creating Configured Subscriptions
For subscription creation via configuration operations, a RESTCONF
client may send:
POST /restconf/operations/subscriptions/
{
"edit-config": {
"target": {
"running": null
},
"default-operation": "none",
"config": {
"subscriptions": {
"subscription": {
"identifier": "22",
"transport": "HTTP2",
"stream": "NETCONF",
"receivers": {
"receiver": {
"name": "receiver1",
"address": "1.2.3.4"
}
}
}
}
}
}
}
Figure 14: Create a configured subscription
If the request is accepted, the publisher will indicate this. If the
request is not accepted because the publisher cannot serve it, no
configuration is changed. In this case the publisher may reply:
HTTP status code - 406
{
"ietf-restconf:errors" : {
"error" : [
"error-type": "application",
"error-tag": "resource-denied",
"error-severity": "error",
"error-message": {
"@lang": "en",
"#text": "Temporarily the publisher cannot serve this
subscription due to the current workload."
}
]
}
}
Figure 15: Response to a failed configured subscription establishment
After a subscription has been created and been verified as VALID,
HTTP2 connectivity to each receiver will be established if that
connectivity does not already exist.
The following figure shows the interaction model for the successful
creation of a configured subscription.
+----------+ +-----------+ +---------+
|Config Ops| | Publisher | | 1.2.3.4 |
+----------+ +-----------+ +---------+
| | |
| Capability Exchange | |
|<-------------------------->| |
| | |
| | |
| Edit-config | |
|--------------------------->| |
| RPC Reply: OK | |
|<---------------------------| |
| | Call Home |
| |<-------------->|
| | |
| | subscription- |
| | started |
| |--------------->|
| | |
| | notification |
| | message |
| |--------------->|
Figure 16: Interaction model for configured subscription
establishment
B.2.2. Modifying Configured Subscriptions
Configured subscriptions can be modified using configuration
operations against the top-level container "/subscriptions".
For example, the subscription established in the previous section
could be modified as follows, here a adding a second receiver:
POST /restconf/operations/subscriptions
{
"edit-config": {
"target": {
"running": null
},
"config": {
"subscriptions": {
"subscription": {
"identifier": "1922",
"receivers": {
"receiver": {
"name": "receiver2",
"address": "1.2.3.5"
}
}
}
}
}
}
}
Figure 17: Modify configured subscription
If the request is accepted, the publisher will indicate success. The
result is that the interaction model described in Figure 16 may be
extended as follows.
+----------+ +-----------+ +---------+ +---------+
|Config Ops| | Publisher | | 1.2.3.4 | | 1.2.3.5 |
+----------+ +-----------+ +---------+ +---------+
| | notification | |
| | message | |
| |--------------->| |
| Edit-config | | |
|--------------------------->| | |
| RPC Reply: OK | | |
|<---------------------------| | |
| | subscription- | |
| | started | |
| |---------------------------->|
| | | |
| | notification | |
| | message | |
| |--------------->| |
| |---------------------------->|
| | | |
Figure 18: Interaction model for configured subscription modification
Note in the above that in the specific example above, modifying a
configured subscription actually resulted in "subscription-started"
notification. And because of existing HTTP2 connectivity, no
additional call home was needed. Also note that if the edit of the
configuration had impacted the filter, a separate modify-subscription
would have been required for the original receiver.
B.2.3. Deleting Configured Subscriptions
Configured subscriptions can be deleted using configuration
operations against the top-level container "/subscriptions".
Deleting the subscription above would result in the following flow
impacting all active receivers.
+----------+ +-----------+ +---------+ +---------+
|Config Ops| | Publisher | | 1.2.3.4 | | 1.2.3.5 |
+----------+ +-----------+ +---------+ +---------+
| | | |
| | notification | |
| | message | |
| |--------------->| |
| |---------------------------->|
| | | |
| Edit-config | | |
|--------------------------->| | |
| RPC Reply: OK | | |
|<---------------------------| | |
| | subscription- | |
| | terminated | |
| |--------------->| |
| |---------------------------->|
| | | |
Figure 19: Interaction model for configured subscription deletion
B.3. Subscription State Notifications A.2. Subscription State Notifications
A publisher will send subscription state notifications according to A publisher will send subscription state notifications according to
the definitions within the definitions within
[I-D.draft-ietf-netconf-subscribed-notifications]). [I-D.draft-ietf-netconf-subscribed-notifications]).
B.3.1. subscription-started and subscription-modified A.2.1. subscription-started and subscription-modified
A "subscription-started" encoded in JSON would look like: A "subscription-started" 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-started": { "ietf-subscribed-notifications:subscription-started": {
"identifier": "39", "id": "39",
"transport": "HTTP2", "transport": "HTTP2",
"stream-xpath-filter": "/ex:foo", "stream-xpath-filter": "/ex:foo",
"stream": { "stream": {
"ietf-netconf-subscribed-notifications" : "NETCONF" "ietf-netconf-subscribed-notifications" : "NETCONF"
} }
} }
} }
} }
Figure 20: subscription-started subscription state notification Figure 13: subscription-started subscription state notification
The "subscription-modified" is identical to Figure 20, with just the The "subscription-modified" is identical to Figure 13, with just the
word "started" being replaced by "modified". word "started" being replaced by "modified".
B.3.2. subscription-completed, subscription-resumed, and replay- A.2.2. subscription-completed, subscription-resumed, and replay-
complete complete
A "subscription-completed" would look like: A "subscription-completed" 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-completed": { "ietf-subscribed-notifications:subscription-completed": {
"identifier": "39", "id": "39",
} }
} }
} }
Figure 21: subscription-completed notification in JSON Figure 14: subscription-completed notification in JSON
The "subscription-resumed" and "replay-complete" are virtually The "subscription-resumed" and "replay-complete" are virtually
identical, with "subscription-completed" simply being replaced by identical, with "subscription-completed" simply being replaced by
"subscription-resumed" and "replay-complete". "subscription-resumed" and "replay-complete".
B.3.3. subscription-terminated and subscription-suspended A.2.3. subscription-terminated and subscription-suspended
A "subscription-terminated" would look like: A "subscription-terminated" 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-terminated": { "ietf-subscribed-notifications:subscription-terminated": {
"identifier": "39", "id": "39",
"error-id": "suspension-timeout" "error-id": "suspension-timeout"
} }
} }
} }
Figure 22: subscription-terminated subscription state notification Figure 15: subscription-terminated subscription state notification
The "subscription-suspended" is virtually identical, with The "subscription-suspended" is virtually identical, with
"subscription-terminated" simply being replaced by "subscription- "subscription-terminated" simply being replaced by "subscription-
suspended". suspended".
Appendix C. 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)
v06 - v07
o Removed configured subscriptions.
o Subscription identifier renamed to id.
v05 - v06 v05 - v06
o JSON examples updated by Reshad. o JSON examples updated by Reshad.
v04 - v05 v04 - v05
o Error mechanisms updated to match embedded RESTCONF mechanisms o Error mechanisms updated to match embedded RESTCONF mechanisms
o Restructured format and sections of document. o Restructured format and sections of document.
 End of changes. 84 change blocks. 
531 lines changed or deleted 177 lines changed or added

This html diff was produced by rfcdiff 1.47. The latest version is available from http://tools.ietf.org/tools/rfcdiff/