Error identity | Uses "error-tag" | HTTP code |
---|---|---|
dscp-unavailable | invalid-value | 400 |
encoding-unsupported | invalid-value | 400 |
filter-unsupported | invalid-value | 400 |
insufficient-resources | resource-denied | 409 |
no-such-subscription | invalid-value | 404 |
replay-unsupported | operation-not-supported | 501 |
Error identity | Uses "error-tag" | HTTP code |
---|---|---|
cant-include | operation-not-supported | 501 |
datastore-not-subscribable | invalid-value | 400 |
no-such-subscription-resync | invalid-value | 404 |
on-change-unsupported | operation-not-supported | 501 |
on-change-sync-unsupported | operation-not-supported | 501 |
period-unsupported | invalid-value | 400 |
update-too-big | too-big | 400 |
sync-too-big | too-big | 400 |
unchanging-selection | operation-failed | 500 |
RPC | Select an identity with a base |
---|---|
establish-subscription | establish-subscription-error |
modify-subscription | modify-subscription-error |
delete-subscription | delete-subscription-error |
kill-subscription | delete-subscription-error |
resync-subscription | resync-subscription-error |
Target: | Return hints in yang-data structure |
---|---|
event stream | establish-subscription-stream-error-info |
datastore | establish-subscription-datastore-error-info |
Target: | Returns hints in yang-data structure |
---|---|
event stream | modify-subscription-stream-error-info |
datastore | modify-subscription-datastore-error-info |
+--------------+ +--------------+ | Subscriber | | Publisher | | | | | | Logical | | Logical | | Connection | | Connection | | (a) (b) | | (a) (b) | +--------------+ +--------------+ | RESTCONF POST (RPC:establish-subscription) | |--------------------------------------------->| | HTTP 200 OK (ID,URI)| |<---------------------------------------------| | |HTTP GET (URI) | | |--------------------------------------------->| | | HTTP 200 OK| | |<---------------------------------------------| | | SSE (notif-message)| | |<---------------------------------------------| | RESTCONF POST (RPC:modify-subscription) | | |--------------------------------------------->| | | | HTTP 200 OK| | |<---------------------------------------------| | | | SSE (subscription-modified)| | |<------------------------------------------(c)| | | SSE (notif-message)| | |<---------------------------------------------| | RESTCONF POST (RPC:delete-subscription) | | |--------------------------------------------->| | | | HTTP 200 OK| | |<---------------------------------------------| | | | | | | | | | (a) (b) (a) (b)
module: ietf-restconf-subscribed-notifications augment /sn:establish-subscription/sn:output: +--ro uri? inet:uri augment /sn:subscriptions/sn:subscription: +--ro uri? inet:uri augment /sn:subscription-modified: +--ro uri? inet:uri
module ietf-restconf-subscribed-notifications { yang-version 1.1; namespace "urn:ietf:params:xml:ns:yang:" + "ietf-restconf-subscribed-notifications"; prefix rsn; import ietf-subscribed-notifications { prefix sn; } import ietf-inet-types { prefix inet; } organization "IETF NETCONF (Network Configuration) Working Group"; contact "WG Web: <https://datatracker.ietf.org/wg/netconf/> WG List: <mailto:netconf@ietf.org> Editor: Eric Voit <mailto:evoit@cisco.com> Editor: Alexander Clemm <mailto:ludwig@clemm.org> Editor: Reshad Rahman <mailto:rrahman@cisco.com>"; description "Defines RESTCONF as a supported transport for subscribed event notifications. Copyright (c) 2019 IETF Trust and the persons identified as authors of the code. All rights reserved. Redistribution and use in source and binary forms, with or without modification, is permitted pursuant to, and subject to the license terms contained in, the Simplified BSD License set forth in Section 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 8650; see the RFC itself for full legal notices."; revision 2019-11-17 { description "Initial version"; reference "RFC 8650: Dynamic Subscription to YANG Events and Datastores over RESTCONF"; } 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" { description "This augmentation allows RESTCONF-specific parameters for a response to a publisher's subscription request."; uses uri; } augment "/sn:subscriptions/sn:subscription" { description "This augmentation allows RESTCONF-specific parameters to be exposed for a subscription."; uses uri; } augment "/sn:subscription-modified" { description "This augmentation allows RESTCONF-specific parameters to be included as part of the notification that a subscription has been modified."; uses uri; } }
+------------+ +-----------+ | Subscriber | | Publisher | +------------+ +-----------+ | | |establish-subscription | |------------------------------>| (a) | HTTP 200 OK, id#22, URI#1 | |<------------------------------| (b) |GET (URI#1) | |------------------------------>| (c) | HTTP 200 OK,notif-mesg (id#22)| |<------------------------------| | | | | |establish-subscription | |------------------------------>| | HTTP 200 OK, id#23, URI#2| |<------------------------------| |GET (URI#2) | |------------------------------>| | | | | | notif-mesg (id#22)| |<------------------------------| | HTTP 200 OK,notif-mesg (id#23)| |<------------------------------| | |
POST /restconf/operations /ietf-subscribed-notifications:establish-subscription { "ietf-subscribed-notifications:input": { "stream-xpath-filter": "/example-module:foo/", "stream": "NETCONF", "dscp": 10 } }
HTTP status code - 200 { "id": 22, "uri": "https://example.com/restconf/subscriptions/22" }
GET /restconf/subscriptions/22
HTTP status code - 400 { "ietf-restconf:errors" : { "error" : [ { "error-type": "application", "error-tag": "invalid-value", "error-severity": "error", "error-app-tag": "ietf-subscribed-notifications:dscp-unavailable" } ] } }
+------------+ +-----------+ | Subscriber | | Publisher | +------------+ +-----------+ | | | notification message (id#23)| |<-----------------------------| | | |modify-subscription (id#23) | |----------------------------->| (d) | HTTP 400 error (with hint)| |<-----------------------------| (e) | | |modify-subscription (id#23) | |----------------------------->| | HTTP 200 OK | |<-----------------------------| | | | notif-mesg (id#23)| |<-----------------------------| | |
POST /restconf/operations /ietf-subscribed-notifications:modify-subscription { "ietf-subscribed-notifications:input": { "id": 23, "ietf-yang-push:datastore-xpath-filter": "/example-module:foo/example-module:bar", "ietf-yang-push:periodic": { "ietf-yang-push:period": 500 } } }
HTTP status code - 400 { "ietf-restconf:errors" : { "error" : [ "error-type": "application", "error-tag": "invalid-value", "error-severity": "error", "error-app-tag": "ietf-yang-push:period-unsupported", "error-info": { "ietf-yang-push": "modify-subscription-datastore-error-info": { "period-hint": 3000 } } ] } }
POST /restconf/operations /ietf-subscribed-notifications:delete-subscription { "delete-subscription": { "id": "22" } }
HTTP status code - 404 { "ietf-restconf:errors" : { "error" : [ "error-type": "application", "error-tag": "invalid-value", "error-severity": "error", "error-app-tag": "ietf-subscribed-notifications:no-such-subscription" ] } }
{ "ietf-restconf:notification" : { "eventTime": "2007-09-01T10:00:00Z", "ietf-subscribed-notifications:subscription-modified": { "id": 39, "uri": "https://example.com/restconf/subscriptions/22" "stream-xpath-filter": "/example-module:foo", "stream": { "ietf-netconf-subscribed-notifications" : "NETCONF" } } } }
{ "ietf-restconf:notification" : { "eventTime": "2007-09-01T10:00:00Z", "ietf-subscribed-notifications:subscription-completed": { "id": 39, } } }
{ "ietf-restconf:notification" : { "eventTime": "2007-09-01T10:00:00Z", "ietf-subscribed-notifications:subscription-terminated": { "id": 39, "error-id": "suspension-timeout" } } }
data: { data: "ietf-restconf:notification" : { data: "eventTime" : "2018-09-14T08:22:33.44Z", data: "ietf-vrrp:vrrp-protocol-error-event" : { data: "protocol-error-reason" : "checksum-error" data: } data: } data: }
POST /restconf/operations /ietf-subscribed-notifications:establish-subscription { "ietf-subscribed-notifications:input": { "stream": "NETCONF", "stream-xpath-filter": "/ietf-vrrp:vrrp-protocol-error-event[ protocol-error-reason='checksum-error']/", } }
POST /restconf/operations /ietf-subscribed-notifications:modify-subscription { "ietf-subscribed-notifications:input": { "stream": "NETCONF", "stream-subtree-filter": { "/ietf-vrrp:vrrp-protocol-error-event" : {} } } }