From e4fb9cf5bc1fa2bda3d01ad60b37758f0b0df13c Mon Sep 17 00:00:00 2001 From: Jakub Toth Date: Fri, 3 Feb 2017 15:20:45 +0100 Subject: [PATCH] Bug 7735 - Update restconf models by RFC 8040 * rename base class Draft18 -> Rfc8040 Change-Id: I60da9a81472fb86f8a4e2bb2df6d90c0e58ec9e4 Signed-off-by: Jakub Toth --- .../ietf-restconf-monitoring@2016-08-15.yang | 148 ---------- .../ietf-restconf-monitoring@2017-01-26.yang | 149 ++++++++++ .../main/yang/ietf-restconf@2016-08-15.yang | 256 ---------------- .../main/yang/ietf-restconf@2017-01-26.yang | 279 ++++++++++++++++++ .../SchemaExportContentYangBodyWriter.java | 4 +- .../SchemaExportContentYinBodyWriter.java | 4 +- .../netconf/sal/rest/api/Draft02.java | 4 +- .../impl/JsonNormalizedNodeBodyReader.java | 4 +- .../sal/rest/impl/PATCHJsonBodyWriter.java | 4 +- .../sal/rest/impl/PATCHXmlBodyWriter.java | 4 +- .../listeners/AbstractNotificationsData.java | 2 +- .../restconf/{Draft18.java => Rfc8040.java} | 17 +- .../api/RestconfOperationsService.java | 6 +- .../services/api/RestconfSchemaService.java | 4 +- .../base/services/api/RestconfService.java | 4 +- .../base/services/impl/RestconfImpl.java | 4 +- .../common/references/SchemaContextRef.java | 8 +- .../handlers/SchemaContextHandler.java | 4 +- .../JsonNormalizedNodeBodyReader.java | 4 +- .../providers/JsonToPATCHBodyReader.java | 4 +- .../NormalizedNodeJsonBodyWriter.java | 4 +- .../NormalizedNodeXmlBodyWriter.java | 4 +- .../XmlNormalizedNodeBodyReader.java | 4 +- .../providers/XmlToPATCHBodyReader.java | 4 +- .../services/api/RestconfDataService.java | 24 +- .../api/RestconfInvokeOperationsService.java | 6 +- .../restful/utils/SubscribeToStreamUtil.java | 2 +- .../mapping/RestconfMappingNodeUtil.java | 6 +- .../base/services/impl/RestconfImplTest.java | 2 +- .../mapping/RestconfMappingNodeUtilTest.java | 8 +- .../ietf-restconf-monitoring@2016-08-15.yang | 148 ---------- .../ietf-restconf-monitoring@2017-01-26.yang | 149 ++++++++++ .../ietf-restconf-monitoring@2016-08-15.yang | 148 ---------- .../ietf-restconf-monitoring@2017-01-26.yang | 149 ++++++++++ .../ietf-restconf-monitoring@2016-08-15.yang | 148 ---------- .../ietf-restconf-monitoring@2017-01-26.yang | 149 ++++++++++ .../ietf-restconf-monitoring@2016-08-15.yang | 148 ---------- .../ietf-restconf-monitoring@2017-01-26.yang | 149 ++++++++++ .../ietf-restconf-monitoring@2016-08-15.yang | 148 ---------- .../ietf-restconf-monitoring@2017-01-26.yang | 149 ++++++++++ .../ietf-restconf-monitoring@2016-08-15.yang | 148 ---------- .../ietf-restconf-monitoring@2017-01-26.yang | 149 ++++++++++ .../impl/ietf-restconf@2016-08-15.yang | 256 ---------------- .../impl/ietf-restconf@2017-01-26.yang | 279 ++++++++++++++++++ 44 files changed, 1672 insertions(+), 1622 deletions(-) delete mode 100644 restconf/models/ietf-restconf-monitoring/src/main/yang/ietf-restconf-monitoring@2016-08-15.yang create mode 100644 restconf/models/ietf-restconf-monitoring/src/main/yang/ietf-restconf-monitoring@2017-01-26.yang delete mode 100644 restconf/models/ietf-restconf/src/main/yang/ietf-restconf@2016-08-15.yang create mode 100644 restconf/models/ietf-restconf/src/main/yang/ietf-restconf@2017-01-26.yang rename restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/{Draft18.java => Rfc8040.java} (95%) delete mode 100644 restconf/sal-rest-connector/src/test/resources/invoke-rpc/ietf-restconf-monitoring@2016-08-15.yang create mode 100644 restconf/sal-rest-connector/src/test/resources/invoke-rpc/ietf-restconf-monitoring@2017-01-26.yang delete mode 100644 restconf/sal-rest-connector/src/test/resources/jukebox/ietf-restconf-monitoring@2016-08-15.yang create mode 100644 restconf/sal-rest-connector/src/test/resources/jukebox/ietf-restconf-monitoring@2017-01-26.yang delete mode 100644 restconf/sal-rest-connector/src/test/resources/modules/ietf-restconf-monitoring@2016-08-15.yang create mode 100644 restconf/sal-rest-connector/src/test/resources/modules/ietf-restconf-monitoring@2017-01-26.yang delete mode 100644 restconf/sal-rest-connector/src/test/resources/modules/modules-behind-mount-point/ietf-restconf-monitoring@2016-08-15.yang create mode 100644 restconf/sal-rest-connector/src/test/resources/modules/modules-behind-mount-point/ietf-restconf-monitoring@2017-01-26.yang delete mode 100644 restconf/sal-rest-connector/src/test/resources/notifications/ietf-restconf-monitoring@2016-08-15.yang create mode 100644 restconf/sal-rest-connector/src/test/resources/notifications/ietf-restconf-monitoring@2017-01-26.yang delete mode 100644 restconf/sal-rest-connector/src/test/resources/restconf/impl/ietf-restconf-monitoring@2016-08-15.yang create mode 100644 restconf/sal-rest-connector/src/test/resources/restconf/impl/ietf-restconf-monitoring@2017-01-26.yang delete mode 100644 restconf/sal-rest-connector/src/test/resources/restconf/impl/ietf-restconf@2016-08-15.yang create mode 100644 restconf/sal-rest-connector/src/test/resources/restconf/impl/ietf-restconf@2017-01-26.yang diff --git a/restconf/models/ietf-restconf-monitoring/src/main/yang/ietf-restconf-monitoring@2016-08-15.yang b/restconf/models/ietf-restconf-monitoring/src/main/yang/ietf-restconf-monitoring@2016-08-15.yang deleted file mode 100644 index 82041414d1..0000000000 --- a/restconf/models/ietf-restconf-monitoring/src/main/yang/ietf-restconf-monitoring@2016-08-15.yang +++ /dev/null @@ -1,148 +0,0 @@ -module ietf-restconf-monitoring { - namespace "urn:ietf:params:xml:ns:yang:ietf-restconf-monitoring"; - prefix "rcmon"; - - import ietf-yang-types { prefix yang; } - import ietf-inet-types { prefix inet; } - - organization - "IETF NETCONF (Network Configuration) Working Group"; - - contact - "WG Web: - WG List: - Author: Andy Bierman - - Author: Martin Bjorklund - - Author: Kent Watsen - "; - - description - "This module contains monitoring information for the - RESTCONF protocol. - Copyright (c) 2016 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 - (http://trustee.ietf.org/license-info). - This version of this YANG module is part of RFC XXXX; see - the RFC itself for full legal notices."; - - // RFC Ed.: replace XXXX with actual RFC number and remove this - // note. - - // RFC Ed.: remove this note - // Note: extracted from draft-ietf-netconf-restconf-17.txt - - // RFC Ed.: update the date below with the date of RFC publication - // and remove this note. - revision 2016-08-15 { - description - "Initial revision."; - reference - "RFC XXXX: RESTCONF Protocol."; - } - - container restconf-state { - config false; - description - "Contains RESTCONF protocol monitoring information."; - - container capabilities { - description - "Contains a list of protocol capability URIs"; - - leaf-list capability { - type inet:uri; - description "A RESTCONF protocol capability URI."; - } - } - - container streams { - description - "Container representing the notification event streams - supported by the server."; - reference - "RFC 5277, Section 3.4, element."; - - list stream { - key name; - description - "Each entry describes an event stream supported by - the server."; - - leaf name { - type string; - description "The stream name"; - reference "RFC 5277, Section 3.4, element."; - } - - leaf description { - type string; - description "Description of stream content"; - reference - "RFC 5277, Section 3.4, element."; - } - - leaf replay-support { - type boolean; - default false; - description - "Indicates if replay buffer supported for this stream. - If 'true', then the server MUST support the 'start-time' - and 'stop-time' query parameters for this stream."; - reference - "RFC 5277, Section 3.4, element."; - } - - leaf replay-log-creation-time { - when "../replay-support" { - description - "Only present if notification replay is supported"; - } - type yang:date-and-time; - description - "Indicates the time the replay log for this stream - was created."; - reference - "RFC 5277, Section 3.4, - element."; - } - - list access { - key encoding; - min-elements 1; - description - "The server will create an entry in this list for each - encoding format that is supported for this stream. - The media type 'text/event-stream' is expected - for all event streams. This list identifies the - sub-types supported for this stream."; - - leaf encoding { - type string; - description - "This is the secondary encoding format within the - 'text/event-stream' encoding used by all streams. - The type 'xml' is supported for XML encoding. - The type 'json' is supported for JSON encoding."; - } - - leaf location { - type inet:uri; - mandatory true; - description - "Contains a URL that represents the entry point - for establishing notification delivery via server - sent events."; - } - } - } - } - } - -} diff --git a/restconf/models/ietf-restconf-monitoring/src/main/yang/ietf-restconf-monitoring@2017-01-26.yang b/restconf/models/ietf-restconf-monitoring/src/main/yang/ietf-restconf-monitoring@2017-01-26.yang new file mode 100644 index 0000000000..55c3cb1f64 --- /dev/null +++ b/restconf/models/ietf-restconf-monitoring/src/main/yang/ietf-restconf-monitoring@2017-01-26.yang @@ -0,0 +1,149 @@ +module ietf-restconf-monitoring { + namespace "urn:ietf:params:xml:ns:yang:ietf-restconf-monitoring"; + prefix "rcmon"; + + import ietf-yang-types { prefix yang; } + import ietf-inet-types { prefix inet; } + + organization + "IETF NETCONF (Network Configuration) Working Group"; + + contact + "WG Web: + WG List: + + Author: Andy Bierman + + + Author: Martin Bjorklund + + + Author: Kent Watsen + "; + + description + "This module contains monitoring information for the + RESTCONF protocol. + + Copyright (c) 2017 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 + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 8040; see + the RFC itself for full legal notices."; + + revision 2017-01-26 { + description + "Initial revision."; + reference + "RFC 8040: RESTCONF Protocol."; + } + + container restconf-state { + config false; + description + "Contains RESTCONF protocol monitoring information."; + + container capabilities { + description + "Contains a list of protocol capability URIs."; + + leaf-list capability { + type inet:uri; + description + "A RESTCONF protocol capability URI."; + } + } + + container streams { + description + "Container representing the notification event streams + supported by the server."; + reference + "RFC 5277, Section 3.4, element."; + + list stream { + key name; + description + "Each entry describes an event stream supported by + the server."; + + leaf name { + type string; + description + "The stream name."; + reference + "RFC 5277, Section 3.4, element."; + } + + leaf description { + type string; + description + "Description of stream content."; + reference + "RFC 5277, Section 3.4, element."; + } + + leaf replay-support { + type boolean; + default false; + description + "Indicates if replay buffer is supported for this stream. + If 'true', then the server MUST support the 'start-time' + and 'stop-time' query parameters for this stream."; + reference + "RFC 5277, Section 3.4, element."; + } + + leaf replay-log-creation-time { + when "../replay-support" { + description + "Only present if notification replay is supported."; + } + type yang:date-and-time; + description + "Indicates the time the replay log for this stream + was created."; + reference + "RFC 5277, Section 3.4, + element."; + } + + list access { + key encoding; + min-elements 1; + description + "The server will create an entry in this list for each + encoding format that is supported for this stream. + The media type 'text/event-stream' is expected + for all event streams. This list identifies the + subtypes supported for this stream."; + + leaf encoding { + type string; + description + "This is the secondary encoding format within the + 'text/event-stream' encoding used by all streams. + The type 'xml' is supported for XML encoding. + The type 'json' is supported for JSON encoding."; + } + + leaf location { + type inet:uri; + mandatory true; + description + "Contains a URL that represents the entry point + for establishing notification delivery via + server-sent events."; + } + } + } + } + } +} diff --git a/restconf/models/ietf-restconf/src/main/yang/ietf-restconf@2016-08-15.yang b/restconf/models/ietf-restconf/src/main/yang/ietf-restconf@2016-08-15.yang deleted file mode 100644 index 2f642de75f..0000000000 --- a/restconf/models/ietf-restconf/src/main/yang/ietf-restconf@2016-08-15.yang +++ /dev/null @@ -1,256 +0,0 @@ -module ietf-restconf { - yang-version 1.1; - namespace "urn:ietf:params:xml:ns:yang:ietf-restconf"; - prefix "rc"; - - organization - "IETF NETCONF (Network Configuration) Working Group"; - - contact - "WG Web: - WG List: - Author: Andy Bierman - - Author: Martin Bjorklund - - Author: Kent Watsen - "; - - description - "This module contains conceptual YANG specifications - for basic RESTCONF media type definitions used in - RESTCONF protocol messages. - Note that the YANG definitions within this module do not - represent configuration data of any kind. - The 'restconf-media-type' YANG extension statement - provides a normative syntax for XML and JSON message - encoding purposes. - Copyright (c) 2016 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 - (http://trustee.ietf.org/license-info). - This version of this YANG module is part of RFC XXXX; see - the RFC itself for full legal notices."; - - // RFC Ed.: replace XXXX with actual RFC number and remove this - // note. - - // RFC Ed.: remove this note - // Note: extracted from draft-ietf-netconf-restconf-17.txt - - // RFC Ed.: update the date below with the date of RFC publication - // and remove this note. - revision 2016-08-15 { - description - "Initial revision."; - reference - "RFC XXXX: RESTCONF Protocol."; - } - - extension yang-data { - argument name { - yin-element true; - } - description - "This extension is used to specify a YANG data template which - represents conceptual data defined in YANG. It is - intended to describe hierarchical data independent of - protocol context or specific message encoding format. - Data definition statements within a yang-data extension - specify the generic syntax for the specific YANG data - template, whose name is the argument of the yang-data - extension statement. - Note that this extension does not define a media-type. - A specification using this extension MUST specify the - message encoding rules, including the content media type. - The mandatory 'name' parameter value identifies the YANG - data template that is being defined. It contains the - template name. - This extension is ignored unless it appears as a top-level - statement. It MUST contain data definition statements - that result in exactly one container data node definition. - An instance of a YANG data template can thus be translated - into an XML instance document, whose top-level element - corresponds to the top-level container. - The module name and namespace value for the YANG module using - the extension statement is assigned to instance document data - conforming to the data definition statements within - this extension. - The sub-statements of this extension MUST follow the - 'data-def-stmt' rule in the YANG ABNF. - The XPath document root is the extension statement itself, - such that the child nodes of the document root are - represented by the data-def-stmt sub-statements within - this extension. This conceptual document is the context - for the following YANG statements: - - must-stmt - - when-stmt - - path-stmt - - min-elements-stmt - - max-elements-stmt - - mandatory-stmt - - unique-stmt - - ordered-by - - instance-identifier data type - The following data-def-stmt sub-statements are constrained - when used within a yang-data-resource extension statement. - - The list-stmt is not required to have a key-stmt defined. - - The if-feature-stmt is ignored if present. - - The config-stmt is ignored if present. - - The available identity values for any 'identityref' - leaf or leaf-list nodes is limited to the module - containing this extension statement, and the modules - imported into that module. - "; - } - - rc:yang-data yang-errors { - uses errors; - } - - rc:yang-data yang-api { - uses restconf; - } - - grouping errors { - description - "A grouping that contains a YANG container - representing the syntax and semantics of a - YANG Patch errors report within a response message."; - - container errors { - description - "Represents an error report returned by the server if - a request results in an error."; - - list error { - description - "An entry containing information about one - specific error that occurred while processing - a RESTCONF request."; - reference "RFC 6241, Section 4.3"; - - leaf error-type { - type enumeration { - enum transport { - description "The transport layer"; - } - enum rpc { - description "The rpc or notification layer"; - } - enum protocol { - description "The protocol operation layer"; - } - enum application { - description "The server application layer"; - } - } - mandatory true; - description - "The protocol layer where the error occurred."; - } - - leaf error-tag { - type string; - mandatory true; - description - "The enumerated error tag."; - } - - leaf error-app-tag { - type string; - description - "The application-specific error tag."; - } - - leaf error-path { - type instance-identifier; - description - "The YANG instance identifier associated - with the error node."; - } - - leaf error-message { - type string; - description - "A message describing the error."; - } - - anydata error-info { - description - "This anydata value MUST represent a container with - zero or more data nodes representing additional - error information."; - } - } - } - } - - grouping restconf { - description - "Conceptual grouping representing the RESTCONF - root resource."; - - container restconf { - description - "Conceptual container representing the RESTCONF - root resource."; - - container data { - description - "Container representing the datastore resource. - Represents the conceptual root of all state data - and configuration data supported by the server. - The child nodes of this container can be any data - resource which are defined as top-level data nodes - from the YANG modules advertised by the server in - the ietf-yang-library module."; - } - - container operations { - description - "Container for all operation resources. - Each resource is represented as an empty leaf with the - name of the RPC operation from the YANG rpc statement. - For example, the 'system-restart' RPC operation defined - in the 'ietf-system' module would be represented as - an empty leaf in the 'ietf-system' namespace. This is - a conceptual leaf, and will not actually be found in - the module: - module ietf-system { - leaf system-reset { - type empty; - } - } - To invoke the 'system-restart' RPC operation: - POST /restconf/operations/ietf-system:system-restart - To discover the RPC operations supported by the server: - GET /restconf/operations - In XML the YANG module namespace identifies the module: - - In JSON the YANG module name identifies the module: - { 'ietf-system:system-restart' : [null] } - "; - } - - leaf yang-library-version { - type string { - pattern '\d{4}-\d{2}-\d{2}'; - } - config false; - mandatory true; - description - "Identifies the revision date of the ietf-yang-library - module that is implemented by this RESTCONF server. - Indicates the year, month, and day in YYYY-MM-DD - numeric format."; - } - } - } - -} diff --git a/restconf/models/ietf-restconf/src/main/yang/ietf-restconf@2017-01-26.yang b/restconf/models/ietf-restconf/src/main/yang/ietf-restconf@2017-01-26.yang new file mode 100644 index 0000000000..dc54388b10 --- /dev/null +++ b/restconf/models/ietf-restconf/src/main/yang/ietf-restconf@2017-01-26.yang @@ -0,0 +1,279 @@ +module ietf-restconf { + yang-version 1.1; + namespace "urn:ietf:params:xml:ns:yang:ietf-restconf"; + prefix "rc"; + + organization + "IETF NETCONF (Network Configuration) Working Group"; + + contact + "WG Web: + WG List: + + Author: Andy Bierman + + + Author: Martin Bjorklund + + + Author: Kent Watsen + "; + + description + "This module contains conceptual YANG specifications + for basic RESTCONF media type definitions used in + RESTCONF protocol messages. + + Note that the YANG definitions within this module do not + represent configuration data of any kind. + The 'restconf-media-type' YANG extension statement + provides a normative syntax for XML and JSON + message-encoding purposes. + + Copyright (c) 2017 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 + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 8040; see + the RFC itself for full legal notices."; + + revision 2017-01-26 { + description + "Initial revision."; + reference + "RFC 8040: RESTCONF Protocol."; + } + + extension yang-data { + argument name { + yin-element true; + } + description + "This extension is used to specify a YANG data template that + represents conceptual data defined in YANG. It is + intended to describe hierarchical data independent of + protocol context or specific message-encoding format. + Data definition statements within a yang-data extension + specify the generic syntax for the specific YANG data + template, whose name is the argument of the 'yang-data' + extension statement. + + Note that this extension does not define a media type. + A specification using this extension MUST specify the + message-encoding rules, including the content media type. + + The mandatory 'name' parameter value identifies the YANG + data template that is being defined. It contains the + template name. + + This extension is ignored unless it appears as a top-level + statement. It MUST contain data definition statements + that result in exactly one container data node definition. + An instance of a YANG data template can thus be translated + into an XML instance document, whose top-level element + corresponds to the top-level container. + + The module name and namespace values for the YANG module using + the extension statement are assigned to instance document data + conforming to the data definition statements within + this extension. + + The substatements of this extension MUST follow the + 'data-def-stmt' rule in the YANG ABNF. + + The XPath document root is the extension statement itself, + such that the child nodes of the document root are + represented by the data-def-stmt substatements within + this extension. This conceptual document is the context + for the following YANG statements: + + - must-stmt + - when-stmt + - path-stmt + - min-elements-stmt + - max-elements-stmt + - mandatory-stmt + - unique-stmt + - ordered-by + - instance-identifier data type + + The following data-def-stmt substatements are constrained + when used within a 'yang-data' extension statement. + + - The list-stmt is not required to have a key-stmt defined. + - The if-feature-stmt is ignored if present. + - The config-stmt is ignored if present. + - The available identity values for any 'identityref' + leaf or leaf-list nodes are limited to the module + containing this extension statement and the modules + imported into that module. + "; + } + + rc:yang-data yang-errors { + uses errors; + } + + rc:yang-data yang-api { + uses restconf; + } + + grouping errors { + description + "A grouping that contains a YANG container + representing the syntax and semantics of a + YANG Patch error report within a response message."; + + container errors { + description + "Represents an error report returned by the server if + a request results in an error."; + + list error { + description + "An entry containing information about one + specific error that occurred while processing + a RESTCONF request."; + reference + "RFC 6241, Section 4.3."; + + leaf error-type { + type enumeration { + enum transport { + description + "The transport layer."; + } + enum rpc { + description + "The rpc or notification layer."; + } + enum protocol { + description + "The protocol operation layer."; + } + enum application { + description + "The server application layer."; + } + } + mandatory true; + description + "The protocol layer where the error occurred."; + } + + leaf error-tag { + type string; + mandatory true; + description + "The enumerated error-tag."; + } + + leaf error-app-tag { + type string; + description + "The application-specific error-tag."; + } + + leaf error-path { + type instance-identifier; + description + "The YANG instance identifier associated + with the error node."; + } + + leaf error-message { + type string; + description + "A message describing the error."; + } + + anydata error-info { + description + "This anydata value MUST represent a container with + zero or more data nodes representing additional + error information."; + } + } + } + } + + grouping restconf { + description + "Conceptual grouping representing the RESTCONF + root resource."; + + container restconf { + description + "Conceptual container representing the RESTCONF + root resource."; + + container data { + description + "Container representing the datastore resource. + Represents the conceptual root of all state data + and configuration data supported by the server. + The child nodes of this container can be any data + resources that are defined as top-level data nodes + from the YANG modules advertised by the server in + the 'ietf-yang-library' module."; + } + + container operations { + description + "Container for all operation resources. + + Each resource is represented as an empty leaf with the + name of the RPC operation from the YANG 'rpc' statement. + + For example, the 'system-restart' RPC operation defined + in the 'ietf-system' module would be represented as + an empty leaf in the 'ietf-system' namespace. This is + a conceptual leaf and will not actually be found in + the module: + + module ietf-system { + leaf system-reset { + type empty; + } + } + + To invoke the 'system-restart' RPC operation: + + POST /restconf/operations/ietf-system:system-restart + + To discover the RPC operations supported by the server: + + GET /restconf/operations + + In XML, the YANG module namespace identifies the module: + + + + In JSON, the YANG module name identifies the module: + + { 'ietf-system:system-restart' : [null] } + "; + } + + leaf yang-library-version { + type string { + pattern '\d{4}-\d{2}-\d{2}'; + } + config false; + mandatory true; + description + "Identifies the revision date of the 'ietf-yang-library' + module that is implemented by this RESTCONF server. + Indicates the year, month, and day in YYYY-MM-DD + numeric format."; + } + } + } +} diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/md/sal/rest/schema/SchemaExportContentYangBodyWriter.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/md/sal/rest/schema/SchemaExportContentYangBodyWriter.java index 8d7632733b..abc2ee87e1 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/md/sal/rest/schema/SchemaExportContentYangBodyWriter.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/md/sal/rest/schema/SchemaExportContentYangBodyWriter.java @@ -18,10 +18,10 @@ import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.ext.MessageBodyWriter; import javax.ws.rs.ext.Provider; -import org.opendaylight.restconf.Draft18; +import org.opendaylight.restconf.Rfc8040; @Provider -@Produces({ SchemaRetrievalService.YANG_MEDIA_TYPE, Draft18.MediaTypes.YANG }) +@Produces({ SchemaRetrievalService.YANG_MEDIA_TYPE, Rfc8040.MediaTypes.YANG }) public class SchemaExportContentYangBodyWriter implements MessageBodyWriter { @Override diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/md/sal/rest/schema/SchemaExportContentYinBodyWriter.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/md/sal/rest/schema/SchemaExportContentYinBodyWriter.java index 76a9c4a0dd..9b3351cc30 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/md/sal/rest/schema/SchemaExportContentYinBodyWriter.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/md/sal/rest/schema/SchemaExportContentYinBodyWriter.java @@ -18,12 +18,12 @@ import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.ext.MessageBodyWriter; import javax.ws.rs.ext.Provider; import javax.xml.stream.XMLStreamException; -import org.opendaylight.restconf.Draft18; +import org.opendaylight.restconf.Rfc8040; import org.opendaylight.restconf.utils.RestconfConstants; import org.opendaylight.yangtools.yang.model.export.YinExportUtils; @Provider -@Produces({ SchemaRetrievalService.YIN_MEDIA_TYPE, Draft18.MediaTypes.YIN + RestconfConstants.XML }) +@Produces({ SchemaRetrievalService.YIN_MEDIA_TYPE, Rfc8040.MediaTypes.YIN + RestconfConstants.XML }) public class SchemaExportContentYinBodyWriter implements MessageBodyWriter { @Override diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/api/Draft02.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/api/Draft02.java index 0b1d287727..8a122e7843 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/api/Draft02.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/api/Draft02.java @@ -7,12 +7,12 @@ */ package org.opendaylight.netconf.sal.rest.api; -import org.opendaylight.restconf.Draft18; +import org.opendaylight.restconf.Rfc8040; import org.opendaylight.yangtools.yang.common.QName; /** * @deprecated Do not use old implementation of restconf draft. It will be - * replaced by {@link Draft18}. + * replaced by {@link Rfc8040}. * */ @Deprecated diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/JsonNormalizedNodeBodyReader.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/JsonNormalizedNodeBodyReader.java index 305e006740..226d07360a 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/JsonNormalizedNodeBodyReader.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/JsonNormalizedNodeBodyReader.java @@ -30,7 +30,7 @@ import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext; import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException; import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorTag; import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorType; -import org.opendaylight.restconf.Draft18; +import org.opendaylight.restconf.Rfc8040; import org.opendaylight.restconf.utils.RestconfConstants; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode; @@ -53,7 +53,7 @@ import org.slf4j.LoggerFactory; @Provider @Consumes({ Draft02.MediaTypes.DATA + RestconfService.JSON, Draft02.MediaTypes.OPERATION + RestconfService.JSON, - Draft18.MediaTypes.DATA + RestconfConstants.JSON, MediaType.APPLICATION_JSON }) + Rfc8040.MediaTypes.DATA + RestconfConstants.JSON, MediaType.APPLICATION_JSON }) public class JsonNormalizedNodeBodyReader extends AbstractIdentifierAwareJaxRsProvider implements MessageBodyReader { private final static Logger LOG = LoggerFactory.getLogger(JsonNormalizedNodeBodyReader.class); diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/PATCHJsonBodyWriter.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/PATCHJsonBodyWriter.java index 8165704c9c..59e13927f5 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/PATCHJsonBodyWriter.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/PATCHJsonBodyWriter.java @@ -27,14 +27,14 @@ import org.opendaylight.netconf.sal.rest.api.RestconfService; import org.opendaylight.netconf.sal.restconf.impl.PATCHStatusContext; import org.opendaylight.netconf.sal.restconf.impl.PATCHStatusEntity; import org.opendaylight.netconf.sal.restconf.impl.RestconfError; -import org.opendaylight.restconf.Draft18; +import org.opendaylight.restconf.Rfc8040; import org.opendaylight.restconf.utils.RestconfConstants; import org.opendaylight.yangtools.yang.data.codec.gson.JsonWriterFactory; @Provider @Produces({Draft02.MediaTypes.PATCH_STATUS + RestconfService.JSON, - Draft18.MediaTypes.PATCH_STATUS + RestconfConstants.JSON}) + Rfc8040.MediaTypes.PATCH_STATUS + RestconfConstants.JSON}) public class PATCHJsonBodyWriter implements MessageBodyWriter { @Override diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/PATCHXmlBodyWriter.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/PATCHXmlBodyWriter.java index 0918d509e6..9a60cabc5e 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/PATCHXmlBodyWriter.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/rest/impl/PATCHXmlBodyWriter.java @@ -29,12 +29,12 @@ import org.opendaylight.netconf.sal.rest.api.RestconfService; import org.opendaylight.netconf.sal.restconf.impl.PATCHStatusContext; import org.opendaylight.netconf.sal.restconf.impl.PATCHStatusEntity; import org.opendaylight.netconf.sal.restconf.impl.RestconfError; -import org.opendaylight.restconf.Draft18; +import org.opendaylight.restconf.Rfc8040; import org.opendaylight.restconf.utils.RestconfConstants; @Provider @Produces({Draft02.MediaTypes.PATCH_STATUS + RestconfService.XML, - Draft18.MediaTypes.PATCH_STATUS + RestconfConstants.XML}) + Rfc8040.MediaTypes.PATCH_STATUS + RestconfConstants.XML}) public class PATCHXmlBodyWriter implements MessageBodyWriter { private static final XMLOutputFactory XML_FACTORY; diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/streams/listeners/AbstractNotificationsData.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/streams/listeners/AbstractNotificationsData.java index 14c70a6994..ad90eeedfa 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/streams/listeners/AbstractNotificationsData.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/netconf/sal/streams/listeners/AbstractNotificationsData.java @@ -26,7 +26,7 @@ import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType; import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction; -import org.opendaylight.restconf.Draft18.MonitoringModule; +import org.opendaylight.restconf.Rfc8040.MonitoringModule; import org.opendaylight.restconf.handlers.SchemaContextHandler; import org.opendaylight.restconf.handlers.TransactionChainHandler; import org.opendaylight.restconf.parser.IdentifierCodec; diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/Draft18.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/Rfc8040.java similarity index 95% rename from restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/Draft18.java rename to restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/Rfc8040.java index 9f0e93ef77..9ff4fb127b 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/Draft18.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/Rfc8040.java @@ -12,6 +12,7 @@ import java.net.URISyntaxException; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; + import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.common.QNameModule; import org.slf4j.Logger; @@ -27,14 +28,10 @@ import org.slf4j.LoggerFactory; *
  • {@link MonitoringModule} * * - * - * We used old revision {@link Draft18.RestconfModule#REVISION} of restconf yang - * because the latest restconf draft has to be supported by Yang 1.1 and we are - * not. Then, this is only partial implementation of the latest restconf draft. */ -public final class Draft18 { +public final class Rfc8040 { - private Draft18() { + private Rfc8040() { throw new UnsupportedOperationException("Util class"); } @@ -67,12 +64,12 @@ public final class Draft18 { throw new UnsupportedOperationException("Util class"); } - public static final String REVISION = "2016-08-15"; + public static final String REVISION = "2017-01-26"; public static final String NAME = "ietf-restconf"; public static final String NAMESPACE = "urn:ietf:params:xml:ns:yang:ietf-restconf"; - public static final QName IETF_RESTCONF_QNAME = QName.create(Draft18.RestconfModule.NAMESPACE, - Draft18.RestconfModule.REVISION, Draft18.RestconfModule.NAME); + public static final QName IETF_RESTCONF_QNAME = QName.create(Rfc8040.RestconfModule.NAMESPACE, + Rfc8040.RestconfModule.REVISION, Rfc8040.RestconfModule.NAME); public static Date DATE = null; public static URI URI_MODULE = null; @@ -205,7 +202,7 @@ public final class Draft18 { public static final String NAME = "ietf-restconf-monitoring"; public static final String NAMESPACE = "urn:ietf:params:xml:ns:yang:ietf-restconf-monitoring"; - public static final String REVISION = "2016-08-15"; + public static final String REVISION = "2017-01-26"; public static final String PATH_TO_STREAM_WITHOUT_KEY = "ietf-restconf-monitoring:restconf-state/streams/stream="; public static final String PATH_TO_STREAMS = "ietf-restconf-monitoring:restconf-state/streams"; diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/base/services/api/RestconfOperationsService.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/base/services/api/RestconfOperationsService.java index f43418faf9..63d5e59de6 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/base/services/api/RestconfOperationsService.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/base/services/api/RestconfOperationsService.java @@ -15,7 +15,7 @@ import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.UriInfo; import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext; -import org.opendaylight.restconf.Draft18; +import org.opendaylight.restconf.Rfc8040; import org.opendaylight.restconf.utils.RestconfConstants; /** @@ -34,7 +34,7 @@ public interface RestconfOperationsService { */ @GET @Path("/operations") - @Produces({ Draft18.MediaTypes.DATA + RestconfConstants.JSON, Draft18.MediaTypes.DATA, MediaType.APPLICATION_JSON, + @Produces({ Rfc8040.MediaTypes.DATA + RestconfConstants.JSON, Rfc8040.MediaTypes.DATA, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) public NormalizedNodeContext getOperations(@Context UriInfo uriInfo); @@ -49,7 +49,7 @@ public interface RestconfOperationsService { */ @GET @Path("/operations/{identifier:.+}") - @Produces({ Draft18.MediaTypes.DATA + RestconfConstants.JSON, Draft18.MediaTypes.DATA, MediaType.APPLICATION_JSON, + @Produces({ Rfc8040.MediaTypes.DATA + RestconfConstants.JSON, Rfc8040.MediaTypes.DATA, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) public NormalizedNodeContext getOperations(@PathParam("identifier") String identifier, @Context UriInfo uriInfo); } \ No newline at end of file diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/base/services/api/RestconfSchemaService.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/base/services/api/RestconfSchemaService.java index b6a04223fc..01e73e36d1 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/base/services/api/RestconfSchemaService.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/base/services/api/RestconfSchemaService.java @@ -12,7 +12,7 @@ import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; import org.opendaylight.netconf.md.sal.rest.schema.SchemaExportContext; -import org.opendaylight.restconf.Draft18; +import org.opendaylight.restconf.Rfc8040; import org.opendaylight.restconf.utils.RestconfConstants; /** @@ -30,7 +30,7 @@ public interface RestconfSchemaService { * @return {@link SchemaExportContext} */ @GET - @Produces({ Draft18.MediaTypes.YIN + RestconfConstants.XML, Draft18.MediaTypes.YANG }) + @Produces({ Rfc8040.MediaTypes.YIN + RestconfConstants.XML, Rfc8040.MediaTypes.YANG }) @Path("modules/{identifier:.+}") SchemaExportContext getSchema(@PathParam("identifier") String identifier); } diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/base/services/api/RestconfService.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/base/services/api/RestconfService.java index acdcefc9e0..21e4d1b45b 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/base/services/api/RestconfService.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/base/services/api/RestconfService.java @@ -12,7 +12,7 @@ import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext; -import org.opendaylight.restconf.Draft18; +import org.opendaylight.restconf.Rfc8040; import org.opendaylight.restconf.utils.RestconfConstants; /** @@ -28,7 +28,7 @@ public interface RestconfService { */ @GET @Path("/yang-library-version") - @Produces({ Draft18.MediaTypes.DATA + RestconfConstants.JSON, Draft18.MediaTypes.DATA, MediaType.APPLICATION_JSON, + @Produces({ Rfc8040.MediaTypes.DATA + RestconfConstants.JSON, Rfc8040.MediaTypes.DATA, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) public NormalizedNodeContext getLibraryVersion(); } diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/base/services/impl/RestconfImpl.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/base/services/impl/RestconfImpl.java index bd76052d21..ea87bc484e 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/base/services/impl/RestconfImpl.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/base/services/impl/RestconfImpl.java @@ -9,8 +9,8 @@ package org.opendaylight.restconf.base.services.impl; import org.opendaylight.netconf.sal.restconf.impl.InstanceIdentifierContext; import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext; -import org.opendaylight.restconf.Draft18.IetfYangLibrary; -import org.opendaylight.restconf.Draft18.RestconfModule; +import org.opendaylight.restconf.Rfc8040.IetfYangLibrary; +import org.opendaylight.restconf.Rfc8040.RestconfModule; import org.opendaylight.restconf.base.services.api.RestconfService; import org.opendaylight.restconf.handlers.SchemaContextHandler; import org.opendaylight.yangtools.yang.common.QName; diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/common/references/SchemaContextRef.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/common/references/SchemaContextRef.java index 371fee4bfb..f18ab0af61 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/common/references/SchemaContextRef.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/common/references/SchemaContextRef.java @@ -12,7 +12,7 @@ import java.net.URI; import java.util.Date; import java.util.Set; import org.opendaylight.controller.md.sal.dom.api.DOMMountPoint; -import org.opendaylight.restconf.Draft18; +import org.opendaylight.restconf.Rfc8040; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.model.api.Module; import org.opendaylight.yangtools.yang.model.api.SchemaContext; @@ -73,13 +73,13 @@ public final class SchemaContextRef { /** * Get {@link Module} by ietf-restconf qname from - * {@link Draft18.RestconfModule} + * {@link Rfc8040.RestconfModule} * * @return {@link Module} */ public Module getRestconfModule() { - return this.findModuleByNamespaceAndRevision(Draft18.RestconfModule.IETF_RESTCONF_QNAME.getNamespace(), - Draft18.RestconfModule.IETF_RESTCONF_QNAME.getRevision()); + return this.findModuleByNamespaceAndRevision(Rfc8040.RestconfModule.IETF_RESTCONF_QNAME.getNamespace(), + Rfc8040.RestconfModule.IETF_RESTCONF_QNAME.getRevision()); } /** diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/handlers/SchemaContextHandler.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/handlers/SchemaContextHandler.java index c9f849bc4e..b00d0cfabd 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/handlers/SchemaContextHandler.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/handlers/SchemaContextHandler.java @@ -13,8 +13,8 @@ import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType; import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction; import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException; -import org.opendaylight.restconf.Draft18.IetfYangLibrary; -import org.opendaylight.restconf.Draft18.MonitoringModule; +import org.opendaylight.restconf.Rfc8040.IetfYangLibrary; +import org.opendaylight.restconf.Rfc8040.MonitoringModule; import org.opendaylight.restconf.utils.mapping.RestconfMappingNodeUtil; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier; diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/JsonNormalizedNodeBodyReader.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/JsonNormalizedNodeBodyReader.java index 5b8acd269d..f8ba6be529 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/JsonNormalizedNodeBodyReader.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/JsonNormalizedNodeBodyReader.java @@ -29,7 +29,7 @@ import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext; import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException; import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorTag; import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorType; -import org.opendaylight.restconf.Draft18; +import org.opendaylight.restconf.Rfc8040; import org.opendaylight.restconf.utils.RestconfConstants; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode; @@ -51,7 +51,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; @Provider -@Consumes({ Draft18.MediaTypes.DATA + RestconfConstants.JSON, MediaType.APPLICATION_JSON }) +@Consumes({ Rfc8040.MediaTypes.DATA + RestconfConstants.JSON, MediaType.APPLICATION_JSON }) public class JsonNormalizedNodeBodyReader extends AbstractIdentifierAwareJaxRsProvider implements MessageBodyReader { private final static Logger LOG = LoggerFactory.getLogger(JsonNormalizedNodeBodyReader.class); diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/JsonToPATCHBodyReader.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/JsonToPATCHBodyReader.java index 68b67ccdb9..b9b38ec143 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/JsonToPATCHBodyReader.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/JsonToPATCHBodyReader.java @@ -35,7 +35,7 @@ import org.opendaylight.netconf.sal.restconf.impl.PATCHEntity; import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException; import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorTag; import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorType; -import org.opendaylight.restconf.Draft18; +import org.opendaylight.restconf.Rfc8040; import org.opendaylight.restconf.utils.RestconfConstants; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates; @@ -51,7 +51,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; @Provider -@Consumes({Draft18.MediaTypes.PATCH + RestconfConstants.JSON}) +@Consumes({Rfc8040.MediaTypes.PATCH + RestconfConstants.JSON}) public class JsonToPATCHBodyReader extends AbstractIdentifierAwareJaxRsProvider implements MessageBodyReader { diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/NormalizedNodeJsonBodyWriter.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/NormalizedNodeJsonBodyWriter.java index 6d31d6f26a..b089efe0b1 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/NormalizedNodeJsonBodyWriter.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/NormalizedNodeJsonBodyWriter.java @@ -27,7 +27,7 @@ import javax.ws.rs.ext.Provider; import org.opendaylight.netconf.sal.rest.api.RestconfNormalizedNodeWriter; import org.opendaylight.netconf.sal.restconf.impl.InstanceIdentifierContext; import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext; -import org.opendaylight.restconf.Draft18; +import org.opendaylight.restconf.Rfc8040; import org.opendaylight.restconf.utils.RestconfConstants; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument; @@ -47,7 +47,7 @@ import org.opendaylight.yangtools.yang.model.api.SchemaNode; import org.opendaylight.yangtools.yang.model.api.SchemaPath; @Provider -@Produces({ Draft18.MediaTypes.DATA + RestconfConstants.JSON, MediaType.APPLICATION_JSON }) +@Produces({ Rfc8040.MediaTypes.DATA + RestconfConstants.JSON, MediaType.APPLICATION_JSON }) public class NormalizedNodeJsonBodyWriter implements MessageBodyWriter { private static final int DEFAULT_INDENT_SPACES_NUM = 2; diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/NormalizedNodeXmlBodyWriter.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/NormalizedNodeXmlBodyWriter.java index a6230627a9..373955a248 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/NormalizedNodeXmlBodyWriter.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/NormalizedNodeXmlBodyWriter.java @@ -31,7 +31,7 @@ import javax.xml.stream.XMLStreamWriter; import org.opendaylight.netconf.sal.rest.api.RestconfNormalizedNodeWriter; import org.opendaylight.netconf.sal.restconf.impl.InstanceIdentifierContext; import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext; -import org.opendaylight.restconf.Draft18; +import org.opendaylight.restconf.Rfc8040; import org.opendaylight.restconf.utils.RestconfConstants; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; @@ -45,7 +45,7 @@ import org.opendaylight.yangtools.yang.model.api.SchemaContext; import org.opendaylight.yangtools.yang.model.api.SchemaPath; @Provider -@Produces({ Draft18.MediaTypes.DATA + RestconfConstants.XML, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) +@Produces({ Rfc8040.MediaTypes.DATA + RestconfConstants.XML, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) public class NormalizedNodeXmlBodyWriter implements MessageBodyWriter { private static final XMLOutputFactory XML_FACTORY; diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/XmlNormalizedNodeBodyReader.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/XmlNormalizedNodeBodyReader.java index 8c6fa6b819..71359dd779 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/XmlNormalizedNodeBodyReader.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/XmlNormalizedNodeBodyReader.java @@ -34,7 +34,7 @@ import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext; import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException; import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorTag; import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorType; -import org.opendaylight.restconf.Draft18; +import org.opendaylight.restconf.Rfc8040; import org.opendaylight.restconf.utils.RestconfConstants; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode; @@ -57,7 +57,7 @@ import org.w3c.dom.Document; import org.w3c.dom.Element; @Provider -@Consumes({ Draft18.MediaTypes.DATA + RestconfConstants.XML, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) +@Consumes({ Rfc8040.MediaTypes.DATA + RestconfConstants.XML, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) public class XmlNormalizedNodeBodyReader extends AbstractIdentifierAwareJaxRsProvider implements MessageBodyReader { private final static Logger LOG = LoggerFactory.getLogger(XmlNormalizedNodeBodyReader.class); diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/XmlToPATCHBodyReader.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/XmlToPATCHBodyReader.java index 1bf1efbc9a..b4e0523b0a 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/XmlToPATCHBodyReader.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/jersey/providers/XmlToPATCHBodyReader.java @@ -35,7 +35,7 @@ import org.opendaylight.netconf.sal.restconf.impl.PATCHEntity; import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException; import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorTag; import org.opendaylight.netconf.sal.restconf.impl.RestconfError.ErrorType; -import org.opendaylight.restconf.Draft18; +import org.opendaylight.restconf.Rfc8040; import org.opendaylight.restconf.utils.RestconfConstants; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; @@ -58,7 +58,7 @@ import org.w3c.dom.Node; import org.w3c.dom.NodeList; @Provider -@Consumes({Draft18.MediaTypes.PATCH + RestconfConstants.XML}) +@Consumes({Rfc8040.MediaTypes.PATCH + RestconfConstants.XML}) public class XmlToPATCHBodyReader extends AbstractIdentifierAwareJaxRsProvider implements MessageBodyReader { diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/restful/services/api/RestconfDataService.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/restful/services/api/RestconfDataService.java index 6b5876cb58..58656b6228 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/restful/services/api/RestconfDataService.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/restful/services/api/RestconfDataService.java @@ -24,7 +24,7 @@ import org.opendaylight.netconf.sal.rest.impl.PATCH; import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext; import org.opendaylight.netconf.sal.restconf.impl.PATCHContext; import org.opendaylight.netconf.sal.restconf.impl.PATCHStatusContext; -import org.opendaylight.restconf.Draft18; +import org.opendaylight.restconf.Rfc8040; import org.opendaylight.restconf.utils.RestconfConstants; /** @@ -45,7 +45,7 @@ public interface RestconfDataService { */ @GET @Path("/data/{identifier:.+}") - @Produces({ Draft18.MediaTypes.DATA + RestconfConstants.JSON, Draft18.MediaTypes.DATA, MediaType.APPLICATION_JSON, + @Produces({ Rfc8040.MediaTypes.DATA + RestconfConstants.JSON, Rfc8040.MediaTypes.DATA, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) Response readData(@Encoded @PathParam("identifier") String identifier, @Context UriInfo uriInfo); @@ -58,7 +58,7 @@ public interface RestconfDataService { */ @GET @Path("/data") - @Produces({ Draft18.MediaTypes.DATA + RestconfConstants.JSON, Draft18.MediaTypes.DATA, MediaType.APPLICATION_JSON, + @Produces({ Rfc8040.MediaTypes.DATA + RestconfConstants.JSON, Rfc8040.MediaTypes.DATA, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) Response readData(@Context UriInfo uriInfo); @@ -73,7 +73,7 @@ public interface RestconfDataService { */ @PUT @Path("/data/{identifier:.+}") - @Consumes({ Draft18.MediaTypes.DATA + RestconfConstants.JSON, Draft18.MediaTypes.DATA, MediaType.APPLICATION_JSON, + @Consumes({ Rfc8040.MediaTypes.DATA + RestconfConstants.JSON, Rfc8040.MediaTypes.DATA, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) Response putData(@Encoded @PathParam("identifier") String identifier, NormalizedNodeContext payload, @Context UriInfo uriInfo); @@ -91,7 +91,7 @@ public interface RestconfDataService { */ @POST @Path("/data/{identifier:.+}") - @Consumes({ Draft18.MediaTypes.DATA + RestconfConstants.JSON, Draft18.MediaTypes.DATA, MediaType.APPLICATION_JSON, + @Consumes({ Rfc8040.MediaTypes.DATA + RestconfConstants.JSON, Rfc8040.MediaTypes.DATA, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) Response postData(@Encoded @PathParam("identifier") String identifier, NormalizedNodeContext payload, @Context UriInfo uriInfo); @@ -107,7 +107,7 @@ public interface RestconfDataService { */ @POST @Path("/data") - @Consumes({ Draft18.MediaTypes.DATA + RestconfConstants.JSON, Draft18.MediaTypes.DATA, MediaType.APPLICATION_JSON, + @Consumes({ Rfc8040.MediaTypes.DATA + RestconfConstants.JSON, Rfc8040.MediaTypes.DATA, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) Response postData(NormalizedNodeContext payload, @Context UriInfo uriInfo); @@ -136,9 +136,9 @@ public interface RestconfDataService { */ @PATCH @Path("/data/{identifier:.+}") - @Consumes({ Draft18.MediaTypes.PATCH + RestconfConstants.JSON, Draft18.MediaTypes.PATCH + RestconfConstants.XML }) - @Produces({ Draft18.MediaTypes.PATCH_STATUS + RestconfConstants.JSON, - Draft18.MediaTypes.PATCH_STATUS + RestconfConstants.XML }) + @Consumes({ Rfc8040.MediaTypes.PATCH + RestconfConstants.JSON, Rfc8040.MediaTypes.PATCH + RestconfConstants.XML }) + @Produces({ Rfc8040.MediaTypes.PATCH_STATUS + RestconfConstants.JSON, + Rfc8040.MediaTypes.PATCH_STATUS + RestconfConstants.XML }) PATCHStatusContext patchData(@Encoded @PathParam("identifier") String identifier, PATCHContext context, @Context UriInfo uriInfo); @@ -153,8 +153,8 @@ public interface RestconfDataService { */ @PATCH @Path("/data") - @Consumes({ Draft18.MediaTypes.PATCH + RestconfConstants.JSON, Draft18.MediaTypes.PATCH + RestconfConstants.XML }) - @Produces({ Draft18.MediaTypes.PATCH_STATUS + RestconfConstants.JSON, - Draft18.MediaTypes.PATCH_STATUS + RestconfConstants.XML }) + @Consumes({ Rfc8040.MediaTypes.PATCH + RestconfConstants.JSON, Rfc8040.MediaTypes.PATCH + RestconfConstants.XML }) + @Produces({ Rfc8040.MediaTypes.PATCH_STATUS + RestconfConstants.JSON, + Rfc8040.MediaTypes.PATCH_STATUS + RestconfConstants.XML }) PATCHStatusContext patchData(PATCHContext context, @Context UriInfo uriInfo); } diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/restful/services/api/RestconfInvokeOperationsService.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/restful/services/api/RestconfInvokeOperationsService.java index ebe762813a..becdf548c7 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/restful/services/api/RestconfInvokeOperationsService.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/restful/services/api/RestconfInvokeOperationsService.java @@ -17,7 +17,7 @@ import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.UriInfo; import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext; -import org.opendaylight.restconf.Draft18; +import org.opendaylight.restconf.Rfc8040; import org.opendaylight.restconf.utils.RestconfConstants; /** @@ -41,9 +41,9 @@ public interface RestconfInvokeOperationsService { */ @POST @Path("/operations/{identifier:.+}") - @Produces({ Draft18.MediaTypes.DATA + RestconfConstants.JSON, Draft18.MediaTypes.DATA, MediaType.APPLICATION_JSON, + @Produces({ Rfc8040.MediaTypes.DATA + RestconfConstants.JSON, Rfc8040.MediaTypes.DATA, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) - @Consumes({ Draft18.MediaTypes.DATA + RestconfConstants.JSON, Draft18.MediaTypes.DATA, MediaType.APPLICATION_JSON, + @Consumes({ Rfc8040.MediaTypes.DATA + RestconfConstants.JSON, Rfc8040.MediaTypes.DATA, MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_XML }) NormalizedNodeContext invokeRpc(@Encoded @PathParam("identifier") String identifier, NormalizedNodeContext payload, @Context UriInfo uriInfo); diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/restful/utils/SubscribeToStreamUtil.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/restful/utils/SubscribeToStreamUtil.java index d8df4d20c8..fddbad9ee1 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/restful/utils/SubscribeToStreamUtil.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/restful/utils/SubscribeToStreamUtil.java @@ -37,7 +37,7 @@ import org.opendaylight.netconf.sal.streams.listeners.ListenerAdapter; import org.opendaylight.netconf.sal.streams.listeners.NotificationListenerAdapter; import org.opendaylight.netconf.sal.streams.listeners.Notificator; import org.opendaylight.netconf.sal.streams.websockets.WebSocketServer; -import org.opendaylight.restconf.Draft18.MonitoringModule; +import org.opendaylight.restconf.Rfc8040.MonitoringModule; import org.opendaylight.restconf.handlers.NotificationServiceHandler; import org.opendaylight.restconf.handlers.SchemaContextHandler; import org.opendaylight.restconf.parser.IdentifierCodec; diff --git a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/mapping/RestconfMappingNodeUtil.java b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/mapping/RestconfMappingNodeUtil.java index 5365413296..a5146d8500 100644 --- a/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/mapping/RestconfMappingNodeUtil.java +++ b/restconf/sal-rest-connector/src/main/java/org/opendaylight/restconf/utils/mapping/RestconfMappingNodeUtil.java @@ -13,9 +13,9 @@ import java.util.Collection; import java.util.Date; import java.util.Set; import org.opendaylight.netconf.sal.restconf.impl.RestconfDocumentedException; -import org.opendaylight.restconf.Draft18.IetfYangLibrary; -import org.opendaylight.restconf.Draft18.MonitoringModule; -import org.opendaylight.restconf.Draft18.MonitoringModule.QueryParams; +import org.opendaylight.restconf.Rfc8040.IetfYangLibrary; +import org.opendaylight.restconf.Rfc8040.MonitoringModule; +import org.opendaylight.restconf.Rfc8040.MonitoringModule.QueryParams; import org.opendaylight.restconf.utils.parser.ParserIdentifier; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.library.rev160621.module.list.Module.ConformanceType; import org.opendaylight.yangtools.yang.common.QName; diff --git a/restconf/sal-rest-connector/src/test/java/org/opendaylight/restconf/base/services/impl/RestconfImplTest.java b/restconf/sal-rest-connector/src/test/java/org/opendaylight/restconf/base/services/impl/RestconfImplTest.java index a9d4fdec67..d4997bf4b6 100644 --- a/restconf/sal-rest-connector/src/test/java/org/opendaylight/restconf/base/services/impl/RestconfImplTest.java +++ b/restconf/sal-rest-connector/src/test/java/org/opendaylight/restconf/base/services/impl/RestconfImplTest.java @@ -15,7 +15,7 @@ import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction; import org.opendaylight.controller.md.sal.dom.api.DOMTransactionChain; import org.opendaylight.controller.md.sal.rest.common.TestRestconfUtils; import org.opendaylight.netconf.sal.restconf.impl.NormalizedNodeContext; -import org.opendaylight.restconf.Draft18.IetfYangLibrary; +import org.opendaylight.restconf.Rfc8040.IetfYangLibrary; import org.opendaylight.restconf.handlers.SchemaContextHandler; import org.opendaylight.restconf.handlers.TransactionChainHandler; import org.opendaylight.yangtools.yang.data.api.schema.LeafNode; diff --git a/restconf/sal-rest-connector/src/test/java/org/opendaylight/restconf/utils/mapping/RestconfMappingNodeUtilTest.java b/restconf/sal-rest-connector/src/test/java/org/opendaylight/restconf/utils/mapping/RestconfMappingNodeUtilTest.java index 758bca72a0..01076f26d6 100644 --- a/restconf/sal-rest-connector/src/test/java/org/opendaylight/restconf/utils/mapping/RestconfMappingNodeUtilTest.java +++ b/restconf/sal-rest-connector/src/test/java/org/opendaylight/restconf/utils/mapping/RestconfMappingNodeUtilTest.java @@ -29,10 +29,10 @@ import org.junit.rules.ExpectedException; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.opendaylight.controller.md.sal.rest.common.TestRestconfUtils; -import org.opendaylight.restconf.Draft18.IetfYangLibrary; -import org.opendaylight.restconf.Draft18.MonitoringModule; -import org.opendaylight.restconf.Draft18.MonitoringModule.QueryParams; -import org.opendaylight.restconf.Draft18.RestconfModule; +import org.opendaylight.restconf.Rfc8040.IetfYangLibrary; +import org.opendaylight.restconf.Rfc8040.MonitoringModule; +import org.opendaylight.restconf.Rfc8040.MonitoringModule.QueryParams; +import org.opendaylight.restconf.Rfc8040.RestconfModule; import org.opendaylight.restconf.utils.parser.ParserIdentifier; import org.opendaylight.yangtools.yang.common.QName; import org.opendaylight.yangtools.yang.common.SimpleDateFormatUtil; diff --git a/restconf/sal-rest-connector/src/test/resources/invoke-rpc/ietf-restconf-monitoring@2016-08-15.yang b/restconf/sal-rest-connector/src/test/resources/invoke-rpc/ietf-restconf-monitoring@2016-08-15.yang deleted file mode 100644 index 82041414d1..0000000000 --- a/restconf/sal-rest-connector/src/test/resources/invoke-rpc/ietf-restconf-monitoring@2016-08-15.yang +++ /dev/null @@ -1,148 +0,0 @@ -module ietf-restconf-monitoring { - namespace "urn:ietf:params:xml:ns:yang:ietf-restconf-monitoring"; - prefix "rcmon"; - - import ietf-yang-types { prefix yang; } - import ietf-inet-types { prefix inet; } - - organization - "IETF NETCONF (Network Configuration) Working Group"; - - contact - "WG Web: - WG List: - Author: Andy Bierman - - Author: Martin Bjorklund - - Author: Kent Watsen - "; - - description - "This module contains monitoring information for the - RESTCONF protocol. - Copyright (c) 2016 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 - (http://trustee.ietf.org/license-info). - This version of this YANG module is part of RFC XXXX; see - the RFC itself for full legal notices."; - - // RFC Ed.: replace XXXX with actual RFC number and remove this - // note. - - // RFC Ed.: remove this note - // Note: extracted from draft-ietf-netconf-restconf-17.txt - - // RFC Ed.: update the date below with the date of RFC publication - // and remove this note. - revision 2016-08-15 { - description - "Initial revision."; - reference - "RFC XXXX: RESTCONF Protocol."; - } - - container restconf-state { - config false; - description - "Contains RESTCONF protocol monitoring information."; - - container capabilities { - description - "Contains a list of protocol capability URIs"; - - leaf-list capability { - type inet:uri; - description "A RESTCONF protocol capability URI."; - } - } - - container streams { - description - "Container representing the notification event streams - supported by the server."; - reference - "RFC 5277, Section 3.4, element."; - - list stream { - key name; - description - "Each entry describes an event stream supported by - the server."; - - leaf name { - type string; - description "The stream name"; - reference "RFC 5277, Section 3.4, element."; - } - - leaf description { - type string; - description "Description of stream content"; - reference - "RFC 5277, Section 3.4, element."; - } - - leaf replay-support { - type boolean; - default false; - description - "Indicates if replay buffer supported for this stream. - If 'true', then the server MUST support the 'start-time' - and 'stop-time' query parameters for this stream."; - reference - "RFC 5277, Section 3.4, element."; - } - - leaf replay-log-creation-time { - when "../replay-support" { - description - "Only present if notification replay is supported"; - } - type yang:date-and-time; - description - "Indicates the time the replay log for this stream - was created."; - reference - "RFC 5277, Section 3.4, - element."; - } - - list access { - key encoding; - min-elements 1; - description - "The server will create an entry in this list for each - encoding format that is supported for this stream. - The media type 'text/event-stream' is expected - for all event streams. This list identifies the - sub-types supported for this stream."; - - leaf encoding { - type string; - description - "This is the secondary encoding format within the - 'text/event-stream' encoding used by all streams. - The type 'xml' is supported for XML encoding. - The type 'json' is supported for JSON encoding."; - } - - leaf location { - type inet:uri; - mandatory true; - description - "Contains a URL that represents the entry point - for establishing notification delivery via server - sent events."; - } - } - } - } - } - -} diff --git a/restconf/sal-rest-connector/src/test/resources/invoke-rpc/ietf-restconf-monitoring@2017-01-26.yang b/restconf/sal-rest-connector/src/test/resources/invoke-rpc/ietf-restconf-monitoring@2017-01-26.yang new file mode 100644 index 0000000000..55c3cb1f64 --- /dev/null +++ b/restconf/sal-rest-connector/src/test/resources/invoke-rpc/ietf-restconf-monitoring@2017-01-26.yang @@ -0,0 +1,149 @@ +module ietf-restconf-monitoring { + namespace "urn:ietf:params:xml:ns:yang:ietf-restconf-monitoring"; + prefix "rcmon"; + + import ietf-yang-types { prefix yang; } + import ietf-inet-types { prefix inet; } + + organization + "IETF NETCONF (Network Configuration) Working Group"; + + contact + "WG Web: + WG List: + + Author: Andy Bierman + + + Author: Martin Bjorklund + + + Author: Kent Watsen + "; + + description + "This module contains monitoring information for the + RESTCONF protocol. + + Copyright (c) 2017 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 + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 8040; see + the RFC itself for full legal notices."; + + revision 2017-01-26 { + description + "Initial revision."; + reference + "RFC 8040: RESTCONF Protocol."; + } + + container restconf-state { + config false; + description + "Contains RESTCONF protocol monitoring information."; + + container capabilities { + description + "Contains a list of protocol capability URIs."; + + leaf-list capability { + type inet:uri; + description + "A RESTCONF protocol capability URI."; + } + } + + container streams { + description + "Container representing the notification event streams + supported by the server."; + reference + "RFC 5277, Section 3.4, element."; + + list stream { + key name; + description + "Each entry describes an event stream supported by + the server."; + + leaf name { + type string; + description + "The stream name."; + reference + "RFC 5277, Section 3.4, element."; + } + + leaf description { + type string; + description + "Description of stream content."; + reference + "RFC 5277, Section 3.4, element."; + } + + leaf replay-support { + type boolean; + default false; + description + "Indicates if replay buffer is supported for this stream. + If 'true', then the server MUST support the 'start-time' + and 'stop-time' query parameters for this stream."; + reference + "RFC 5277, Section 3.4, element."; + } + + leaf replay-log-creation-time { + when "../replay-support" { + description + "Only present if notification replay is supported."; + } + type yang:date-and-time; + description + "Indicates the time the replay log for this stream + was created."; + reference + "RFC 5277, Section 3.4, + element."; + } + + list access { + key encoding; + min-elements 1; + description + "The server will create an entry in this list for each + encoding format that is supported for this stream. + The media type 'text/event-stream' is expected + for all event streams. This list identifies the + subtypes supported for this stream."; + + leaf encoding { + type string; + description + "This is the secondary encoding format within the + 'text/event-stream' encoding used by all streams. + The type 'xml' is supported for XML encoding. + The type 'json' is supported for JSON encoding."; + } + + leaf location { + type inet:uri; + mandatory true; + description + "Contains a URL that represents the entry point + for establishing notification delivery via + server-sent events."; + } + } + } + } + } +} diff --git a/restconf/sal-rest-connector/src/test/resources/jukebox/ietf-restconf-monitoring@2016-08-15.yang b/restconf/sal-rest-connector/src/test/resources/jukebox/ietf-restconf-monitoring@2016-08-15.yang deleted file mode 100644 index 82041414d1..0000000000 --- a/restconf/sal-rest-connector/src/test/resources/jukebox/ietf-restconf-monitoring@2016-08-15.yang +++ /dev/null @@ -1,148 +0,0 @@ -module ietf-restconf-monitoring { - namespace "urn:ietf:params:xml:ns:yang:ietf-restconf-monitoring"; - prefix "rcmon"; - - import ietf-yang-types { prefix yang; } - import ietf-inet-types { prefix inet; } - - organization - "IETF NETCONF (Network Configuration) Working Group"; - - contact - "WG Web: - WG List: - Author: Andy Bierman - - Author: Martin Bjorklund - - Author: Kent Watsen - "; - - description - "This module contains monitoring information for the - RESTCONF protocol. - Copyright (c) 2016 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 - (http://trustee.ietf.org/license-info). - This version of this YANG module is part of RFC XXXX; see - the RFC itself for full legal notices."; - - // RFC Ed.: replace XXXX with actual RFC number and remove this - // note. - - // RFC Ed.: remove this note - // Note: extracted from draft-ietf-netconf-restconf-17.txt - - // RFC Ed.: update the date below with the date of RFC publication - // and remove this note. - revision 2016-08-15 { - description - "Initial revision."; - reference - "RFC XXXX: RESTCONF Protocol."; - } - - container restconf-state { - config false; - description - "Contains RESTCONF protocol monitoring information."; - - container capabilities { - description - "Contains a list of protocol capability URIs"; - - leaf-list capability { - type inet:uri; - description "A RESTCONF protocol capability URI."; - } - } - - container streams { - description - "Container representing the notification event streams - supported by the server."; - reference - "RFC 5277, Section 3.4, element."; - - list stream { - key name; - description - "Each entry describes an event stream supported by - the server."; - - leaf name { - type string; - description "The stream name"; - reference "RFC 5277, Section 3.4, element."; - } - - leaf description { - type string; - description "Description of stream content"; - reference - "RFC 5277, Section 3.4, element."; - } - - leaf replay-support { - type boolean; - default false; - description - "Indicates if replay buffer supported for this stream. - If 'true', then the server MUST support the 'start-time' - and 'stop-time' query parameters for this stream."; - reference - "RFC 5277, Section 3.4, element."; - } - - leaf replay-log-creation-time { - when "../replay-support" { - description - "Only present if notification replay is supported"; - } - type yang:date-and-time; - description - "Indicates the time the replay log for this stream - was created."; - reference - "RFC 5277, Section 3.4, - element."; - } - - list access { - key encoding; - min-elements 1; - description - "The server will create an entry in this list for each - encoding format that is supported for this stream. - The media type 'text/event-stream' is expected - for all event streams. This list identifies the - sub-types supported for this stream."; - - leaf encoding { - type string; - description - "This is the secondary encoding format within the - 'text/event-stream' encoding used by all streams. - The type 'xml' is supported for XML encoding. - The type 'json' is supported for JSON encoding."; - } - - leaf location { - type inet:uri; - mandatory true; - description - "Contains a URL that represents the entry point - for establishing notification delivery via server - sent events."; - } - } - } - } - } - -} diff --git a/restconf/sal-rest-connector/src/test/resources/jukebox/ietf-restconf-monitoring@2017-01-26.yang b/restconf/sal-rest-connector/src/test/resources/jukebox/ietf-restconf-monitoring@2017-01-26.yang new file mode 100644 index 0000000000..55c3cb1f64 --- /dev/null +++ b/restconf/sal-rest-connector/src/test/resources/jukebox/ietf-restconf-monitoring@2017-01-26.yang @@ -0,0 +1,149 @@ +module ietf-restconf-monitoring { + namespace "urn:ietf:params:xml:ns:yang:ietf-restconf-monitoring"; + prefix "rcmon"; + + import ietf-yang-types { prefix yang; } + import ietf-inet-types { prefix inet; } + + organization + "IETF NETCONF (Network Configuration) Working Group"; + + contact + "WG Web: + WG List: + + Author: Andy Bierman + + + Author: Martin Bjorklund + + + Author: Kent Watsen + "; + + description + "This module contains monitoring information for the + RESTCONF protocol. + + Copyright (c) 2017 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 + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 8040; see + the RFC itself for full legal notices."; + + revision 2017-01-26 { + description + "Initial revision."; + reference + "RFC 8040: RESTCONF Protocol."; + } + + container restconf-state { + config false; + description + "Contains RESTCONF protocol monitoring information."; + + container capabilities { + description + "Contains a list of protocol capability URIs."; + + leaf-list capability { + type inet:uri; + description + "A RESTCONF protocol capability URI."; + } + } + + container streams { + description + "Container representing the notification event streams + supported by the server."; + reference + "RFC 5277, Section 3.4, element."; + + list stream { + key name; + description + "Each entry describes an event stream supported by + the server."; + + leaf name { + type string; + description + "The stream name."; + reference + "RFC 5277, Section 3.4, element."; + } + + leaf description { + type string; + description + "Description of stream content."; + reference + "RFC 5277, Section 3.4, element."; + } + + leaf replay-support { + type boolean; + default false; + description + "Indicates if replay buffer is supported for this stream. + If 'true', then the server MUST support the 'start-time' + and 'stop-time' query parameters for this stream."; + reference + "RFC 5277, Section 3.4, element."; + } + + leaf replay-log-creation-time { + when "../replay-support" { + description + "Only present if notification replay is supported."; + } + type yang:date-and-time; + description + "Indicates the time the replay log for this stream + was created."; + reference + "RFC 5277, Section 3.4, + element."; + } + + list access { + key encoding; + min-elements 1; + description + "The server will create an entry in this list for each + encoding format that is supported for this stream. + The media type 'text/event-stream' is expected + for all event streams. This list identifies the + subtypes supported for this stream."; + + leaf encoding { + type string; + description + "This is the secondary encoding format within the + 'text/event-stream' encoding used by all streams. + The type 'xml' is supported for XML encoding. + The type 'json' is supported for JSON encoding."; + } + + leaf location { + type inet:uri; + mandatory true; + description + "Contains a URL that represents the entry point + for establishing notification delivery via + server-sent events."; + } + } + } + } + } +} diff --git a/restconf/sal-rest-connector/src/test/resources/modules/ietf-restconf-monitoring@2016-08-15.yang b/restconf/sal-rest-connector/src/test/resources/modules/ietf-restconf-monitoring@2016-08-15.yang deleted file mode 100644 index 82041414d1..0000000000 --- a/restconf/sal-rest-connector/src/test/resources/modules/ietf-restconf-monitoring@2016-08-15.yang +++ /dev/null @@ -1,148 +0,0 @@ -module ietf-restconf-monitoring { - namespace "urn:ietf:params:xml:ns:yang:ietf-restconf-monitoring"; - prefix "rcmon"; - - import ietf-yang-types { prefix yang; } - import ietf-inet-types { prefix inet; } - - organization - "IETF NETCONF (Network Configuration) Working Group"; - - contact - "WG Web: - WG List: - Author: Andy Bierman - - Author: Martin Bjorklund - - Author: Kent Watsen - "; - - description - "This module contains monitoring information for the - RESTCONF protocol. - Copyright (c) 2016 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 - (http://trustee.ietf.org/license-info). - This version of this YANG module is part of RFC XXXX; see - the RFC itself for full legal notices."; - - // RFC Ed.: replace XXXX with actual RFC number and remove this - // note. - - // RFC Ed.: remove this note - // Note: extracted from draft-ietf-netconf-restconf-17.txt - - // RFC Ed.: update the date below with the date of RFC publication - // and remove this note. - revision 2016-08-15 { - description - "Initial revision."; - reference - "RFC XXXX: RESTCONF Protocol."; - } - - container restconf-state { - config false; - description - "Contains RESTCONF protocol monitoring information."; - - container capabilities { - description - "Contains a list of protocol capability URIs"; - - leaf-list capability { - type inet:uri; - description "A RESTCONF protocol capability URI."; - } - } - - container streams { - description - "Container representing the notification event streams - supported by the server."; - reference - "RFC 5277, Section 3.4, element."; - - list stream { - key name; - description - "Each entry describes an event stream supported by - the server."; - - leaf name { - type string; - description "The stream name"; - reference "RFC 5277, Section 3.4, element."; - } - - leaf description { - type string; - description "Description of stream content"; - reference - "RFC 5277, Section 3.4, element."; - } - - leaf replay-support { - type boolean; - default false; - description - "Indicates if replay buffer supported for this stream. - If 'true', then the server MUST support the 'start-time' - and 'stop-time' query parameters for this stream."; - reference - "RFC 5277, Section 3.4, element."; - } - - leaf replay-log-creation-time { - when "../replay-support" { - description - "Only present if notification replay is supported"; - } - type yang:date-and-time; - description - "Indicates the time the replay log for this stream - was created."; - reference - "RFC 5277, Section 3.4, - element."; - } - - list access { - key encoding; - min-elements 1; - description - "The server will create an entry in this list for each - encoding format that is supported for this stream. - The media type 'text/event-stream' is expected - for all event streams. This list identifies the - sub-types supported for this stream."; - - leaf encoding { - type string; - description - "This is the secondary encoding format within the - 'text/event-stream' encoding used by all streams. - The type 'xml' is supported for XML encoding. - The type 'json' is supported for JSON encoding."; - } - - leaf location { - type inet:uri; - mandatory true; - description - "Contains a URL that represents the entry point - for establishing notification delivery via server - sent events."; - } - } - } - } - } - -} diff --git a/restconf/sal-rest-connector/src/test/resources/modules/ietf-restconf-monitoring@2017-01-26.yang b/restconf/sal-rest-connector/src/test/resources/modules/ietf-restconf-monitoring@2017-01-26.yang new file mode 100644 index 0000000000..55c3cb1f64 --- /dev/null +++ b/restconf/sal-rest-connector/src/test/resources/modules/ietf-restconf-monitoring@2017-01-26.yang @@ -0,0 +1,149 @@ +module ietf-restconf-monitoring { + namespace "urn:ietf:params:xml:ns:yang:ietf-restconf-monitoring"; + prefix "rcmon"; + + import ietf-yang-types { prefix yang; } + import ietf-inet-types { prefix inet; } + + organization + "IETF NETCONF (Network Configuration) Working Group"; + + contact + "WG Web: + WG List: + + Author: Andy Bierman + + + Author: Martin Bjorklund + + + Author: Kent Watsen + "; + + description + "This module contains monitoring information for the + RESTCONF protocol. + + Copyright (c) 2017 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 + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 8040; see + the RFC itself for full legal notices."; + + revision 2017-01-26 { + description + "Initial revision."; + reference + "RFC 8040: RESTCONF Protocol."; + } + + container restconf-state { + config false; + description + "Contains RESTCONF protocol monitoring information."; + + container capabilities { + description + "Contains a list of protocol capability URIs."; + + leaf-list capability { + type inet:uri; + description + "A RESTCONF protocol capability URI."; + } + } + + container streams { + description + "Container representing the notification event streams + supported by the server."; + reference + "RFC 5277, Section 3.4, element."; + + list stream { + key name; + description + "Each entry describes an event stream supported by + the server."; + + leaf name { + type string; + description + "The stream name."; + reference + "RFC 5277, Section 3.4, element."; + } + + leaf description { + type string; + description + "Description of stream content."; + reference + "RFC 5277, Section 3.4, element."; + } + + leaf replay-support { + type boolean; + default false; + description + "Indicates if replay buffer is supported for this stream. + If 'true', then the server MUST support the 'start-time' + and 'stop-time' query parameters for this stream."; + reference + "RFC 5277, Section 3.4, element."; + } + + leaf replay-log-creation-time { + when "../replay-support" { + description + "Only present if notification replay is supported."; + } + type yang:date-and-time; + description + "Indicates the time the replay log for this stream + was created."; + reference + "RFC 5277, Section 3.4, + element."; + } + + list access { + key encoding; + min-elements 1; + description + "The server will create an entry in this list for each + encoding format that is supported for this stream. + The media type 'text/event-stream' is expected + for all event streams. This list identifies the + subtypes supported for this stream."; + + leaf encoding { + type string; + description + "This is the secondary encoding format within the + 'text/event-stream' encoding used by all streams. + The type 'xml' is supported for XML encoding. + The type 'json' is supported for JSON encoding."; + } + + leaf location { + type inet:uri; + mandatory true; + description + "Contains a URL that represents the entry point + for establishing notification delivery via + server-sent events."; + } + } + } + } + } +} diff --git a/restconf/sal-rest-connector/src/test/resources/modules/modules-behind-mount-point/ietf-restconf-monitoring@2016-08-15.yang b/restconf/sal-rest-connector/src/test/resources/modules/modules-behind-mount-point/ietf-restconf-monitoring@2016-08-15.yang deleted file mode 100644 index 82041414d1..0000000000 --- a/restconf/sal-rest-connector/src/test/resources/modules/modules-behind-mount-point/ietf-restconf-monitoring@2016-08-15.yang +++ /dev/null @@ -1,148 +0,0 @@ -module ietf-restconf-monitoring { - namespace "urn:ietf:params:xml:ns:yang:ietf-restconf-monitoring"; - prefix "rcmon"; - - import ietf-yang-types { prefix yang; } - import ietf-inet-types { prefix inet; } - - organization - "IETF NETCONF (Network Configuration) Working Group"; - - contact - "WG Web: - WG List: - Author: Andy Bierman - - Author: Martin Bjorklund - - Author: Kent Watsen - "; - - description - "This module contains monitoring information for the - RESTCONF protocol. - Copyright (c) 2016 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 - (http://trustee.ietf.org/license-info). - This version of this YANG module is part of RFC XXXX; see - the RFC itself for full legal notices."; - - // RFC Ed.: replace XXXX with actual RFC number and remove this - // note. - - // RFC Ed.: remove this note - // Note: extracted from draft-ietf-netconf-restconf-17.txt - - // RFC Ed.: update the date below with the date of RFC publication - // and remove this note. - revision 2016-08-15 { - description - "Initial revision."; - reference - "RFC XXXX: RESTCONF Protocol."; - } - - container restconf-state { - config false; - description - "Contains RESTCONF protocol monitoring information."; - - container capabilities { - description - "Contains a list of protocol capability URIs"; - - leaf-list capability { - type inet:uri; - description "A RESTCONF protocol capability URI."; - } - } - - container streams { - description - "Container representing the notification event streams - supported by the server."; - reference - "RFC 5277, Section 3.4, element."; - - list stream { - key name; - description - "Each entry describes an event stream supported by - the server."; - - leaf name { - type string; - description "The stream name"; - reference "RFC 5277, Section 3.4, element."; - } - - leaf description { - type string; - description "Description of stream content"; - reference - "RFC 5277, Section 3.4, element."; - } - - leaf replay-support { - type boolean; - default false; - description - "Indicates if replay buffer supported for this stream. - If 'true', then the server MUST support the 'start-time' - and 'stop-time' query parameters for this stream."; - reference - "RFC 5277, Section 3.4, element."; - } - - leaf replay-log-creation-time { - when "../replay-support" { - description - "Only present if notification replay is supported"; - } - type yang:date-and-time; - description - "Indicates the time the replay log for this stream - was created."; - reference - "RFC 5277, Section 3.4, - element."; - } - - list access { - key encoding; - min-elements 1; - description - "The server will create an entry in this list for each - encoding format that is supported for this stream. - The media type 'text/event-stream' is expected - for all event streams. This list identifies the - sub-types supported for this stream."; - - leaf encoding { - type string; - description - "This is the secondary encoding format within the - 'text/event-stream' encoding used by all streams. - The type 'xml' is supported for XML encoding. - The type 'json' is supported for JSON encoding."; - } - - leaf location { - type inet:uri; - mandatory true; - description - "Contains a URL that represents the entry point - for establishing notification delivery via server - sent events."; - } - } - } - } - } - -} diff --git a/restconf/sal-rest-connector/src/test/resources/modules/modules-behind-mount-point/ietf-restconf-monitoring@2017-01-26.yang b/restconf/sal-rest-connector/src/test/resources/modules/modules-behind-mount-point/ietf-restconf-monitoring@2017-01-26.yang new file mode 100644 index 0000000000..55c3cb1f64 --- /dev/null +++ b/restconf/sal-rest-connector/src/test/resources/modules/modules-behind-mount-point/ietf-restconf-monitoring@2017-01-26.yang @@ -0,0 +1,149 @@ +module ietf-restconf-monitoring { + namespace "urn:ietf:params:xml:ns:yang:ietf-restconf-monitoring"; + prefix "rcmon"; + + import ietf-yang-types { prefix yang; } + import ietf-inet-types { prefix inet; } + + organization + "IETF NETCONF (Network Configuration) Working Group"; + + contact + "WG Web: + WG List: + + Author: Andy Bierman + + + Author: Martin Bjorklund + + + Author: Kent Watsen + "; + + description + "This module contains monitoring information for the + RESTCONF protocol. + + Copyright (c) 2017 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 + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 8040; see + the RFC itself for full legal notices."; + + revision 2017-01-26 { + description + "Initial revision."; + reference + "RFC 8040: RESTCONF Protocol."; + } + + container restconf-state { + config false; + description + "Contains RESTCONF protocol monitoring information."; + + container capabilities { + description + "Contains a list of protocol capability URIs."; + + leaf-list capability { + type inet:uri; + description + "A RESTCONF protocol capability URI."; + } + } + + container streams { + description + "Container representing the notification event streams + supported by the server."; + reference + "RFC 5277, Section 3.4, element."; + + list stream { + key name; + description + "Each entry describes an event stream supported by + the server."; + + leaf name { + type string; + description + "The stream name."; + reference + "RFC 5277, Section 3.4, element."; + } + + leaf description { + type string; + description + "Description of stream content."; + reference + "RFC 5277, Section 3.4, element."; + } + + leaf replay-support { + type boolean; + default false; + description + "Indicates if replay buffer is supported for this stream. + If 'true', then the server MUST support the 'start-time' + and 'stop-time' query parameters for this stream."; + reference + "RFC 5277, Section 3.4, element."; + } + + leaf replay-log-creation-time { + when "../replay-support" { + description + "Only present if notification replay is supported."; + } + type yang:date-and-time; + description + "Indicates the time the replay log for this stream + was created."; + reference + "RFC 5277, Section 3.4, + element."; + } + + list access { + key encoding; + min-elements 1; + description + "The server will create an entry in this list for each + encoding format that is supported for this stream. + The media type 'text/event-stream' is expected + for all event streams. This list identifies the + subtypes supported for this stream."; + + leaf encoding { + type string; + description + "This is the secondary encoding format within the + 'text/event-stream' encoding used by all streams. + The type 'xml' is supported for XML encoding. + The type 'json' is supported for JSON encoding."; + } + + leaf location { + type inet:uri; + mandatory true; + description + "Contains a URL that represents the entry point + for establishing notification delivery via + server-sent events."; + } + } + } + } + } +} diff --git a/restconf/sal-rest-connector/src/test/resources/notifications/ietf-restconf-monitoring@2016-08-15.yang b/restconf/sal-rest-connector/src/test/resources/notifications/ietf-restconf-monitoring@2016-08-15.yang deleted file mode 100644 index 82041414d1..0000000000 --- a/restconf/sal-rest-connector/src/test/resources/notifications/ietf-restconf-monitoring@2016-08-15.yang +++ /dev/null @@ -1,148 +0,0 @@ -module ietf-restconf-monitoring { - namespace "urn:ietf:params:xml:ns:yang:ietf-restconf-monitoring"; - prefix "rcmon"; - - import ietf-yang-types { prefix yang; } - import ietf-inet-types { prefix inet; } - - organization - "IETF NETCONF (Network Configuration) Working Group"; - - contact - "WG Web: - WG List: - Author: Andy Bierman - - Author: Martin Bjorklund - - Author: Kent Watsen - "; - - description - "This module contains monitoring information for the - RESTCONF protocol. - Copyright (c) 2016 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 - (http://trustee.ietf.org/license-info). - This version of this YANG module is part of RFC XXXX; see - the RFC itself for full legal notices."; - - // RFC Ed.: replace XXXX with actual RFC number and remove this - // note. - - // RFC Ed.: remove this note - // Note: extracted from draft-ietf-netconf-restconf-17.txt - - // RFC Ed.: update the date below with the date of RFC publication - // and remove this note. - revision 2016-08-15 { - description - "Initial revision."; - reference - "RFC XXXX: RESTCONF Protocol."; - } - - container restconf-state { - config false; - description - "Contains RESTCONF protocol monitoring information."; - - container capabilities { - description - "Contains a list of protocol capability URIs"; - - leaf-list capability { - type inet:uri; - description "A RESTCONF protocol capability URI."; - } - } - - container streams { - description - "Container representing the notification event streams - supported by the server."; - reference - "RFC 5277, Section 3.4, element."; - - list stream { - key name; - description - "Each entry describes an event stream supported by - the server."; - - leaf name { - type string; - description "The stream name"; - reference "RFC 5277, Section 3.4, element."; - } - - leaf description { - type string; - description "Description of stream content"; - reference - "RFC 5277, Section 3.4, element."; - } - - leaf replay-support { - type boolean; - default false; - description - "Indicates if replay buffer supported for this stream. - If 'true', then the server MUST support the 'start-time' - and 'stop-time' query parameters for this stream."; - reference - "RFC 5277, Section 3.4, element."; - } - - leaf replay-log-creation-time { - when "../replay-support" { - description - "Only present if notification replay is supported"; - } - type yang:date-and-time; - description - "Indicates the time the replay log for this stream - was created."; - reference - "RFC 5277, Section 3.4, - element."; - } - - list access { - key encoding; - min-elements 1; - description - "The server will create an entry in this list for each - encoding format that is supported for this stream. - The media type 'text/event-stream' is expected - for all event streams. This list identifies the - sub-types supported for this stream."; - - leaf encoding { - type string; - description - "This is the secondary encoding format within the - 'text/event-stream' encoding used by all streams. - The type 'xml' is supported for XML encoding. - The type 'json' is supported for JSON encoding."; - } - - leaf location { - type inet:uri; - mandatory true; - description - "Contains a URL that represents the entry point - for establishing notification delivery via server - sent events."; - } - } - } - } - } - -} diff --git a/restconf/sal-rest-connector/src/test/resources/notifications/ietf-restconf-monitoring@2017-01-26.yang b/restconf/sal-rest-connector/src/test/resources/notifications/ietf-restconf-monitoring@2017-01-26.yang new file mode 100644 index 0000000000..55c3cb1f64 --- /dev/null +++ b/restconf/sal-rest-connector/src/test/resources/notifications/ietf-restconf-monitoring@2017-01-26.yang @@ -0,0 +1,149 @@ +module ietf-restconf-monitoring { + namespace "urn:ietf:params:xml:ns:yang:ietf-restconf-monitoring"; + prefix "rcmon"; + + import ietf-yang-types { prefix yang; } + import ietf-inet-types { prefix inet; } + + organization + "IETF NETCONF (Network Configuration) Working Group"; + + contact + "WG Web: + WG List: + + Author: Andy Bierman + + + Author: Martin Bjorklund + + + Author: Kent Watsen + "; + + description + "This module contains monitoring information for the + RESTCONF protocol. + + Copyright (c) 2017 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 + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 8040; see + the RFC itself for full legal notices."; + + revision 2017-01-26 { + description + "Initial revision."; + reference + "RFC 8040: RESTCONF Protocol."; + } + + container restconf-state { + config false; + description + "Contains RESTCONF protocol monitoring information."; + + container capabilities { + description + "Contains a list of protocol capability URIs."; + + leaf-list capability { + type inet:uri; + description + "A RESTCONF protocol capability URI."; + } + } + + container streams { + description + "Container representing the notification event streams + supported by the server."; + reference + "RFC 5277, Section 3.4, element."; + + list stream { + key name; + description + "Each entry describes an event stream supported by + the server."; + + leaf name { + type string; + description + "The stream name."; + reference + "RFC 5277, Section 3.4, element."; + } + + leaf description { + type string; + description + "Description of stream content."; + reference + "RFC 5277, Section 3.4, element."; + } + + leaf replay-support { + type boolean; + default false; + description + "Indicates if replay buffer is supported for this stream. + If 'true', then the server MUST support the 'start-time' + and 'stop-time' query parameters for this stream."; + reference + "RFC 5277, Section 3.4, element."; + } + + leaf replay-log-creation-time { + when "../replay-support" { + description + "Only present if notification replay is supported."; + } + type yang:date-and-time; + description + "Indicates the time the replay log for this stream + was created."; + reference + "RFC 5277, Section 3.4, + element."; + } + + list access { + key encoding; + min-elements 1; + description + "The server will create an entry in this list for each + encoding format that is supported for this stream. + The media type 'text/event-stream' is expected + for all event streams. This list identifies the + subtypes supported for this stream."; + + leaf encoding { + type string; + description + "This is the secondary encoding format within the + 'text/event-stream' encoding used by all streams. + The type 'xml' is supported for XML encoding. + The type 'json' is supported for JSON encoding."; + } + + leaf location { + type inet:uri; + mandatory true; + description + "Contains a URL that represents the entry point + for establishing notification delivery via + server-sent events."; + } + } + } + } + } +} diff --git a/restconf/sal-rest-connector/src/test/resources/restconf/impl/ietf-restconf-monitoring@2016-08-15.yang b/restconf/sal-rest-connector/src/test/resources/restconf/impl/ietf-restconf-monitoring@2016-08-15.yang deleted file mode 100644 index 82041414d1..0000000000 --- a/restconf/sal-rest-connector/src/test/resources/restconf/impl/ietf-restconf-monitoring@2016-08-15.yang +++ /dev/null @@ -1,148 +0,0 @@ -module ietf-restconf-monitoring { - namespace "urn:ietf:params:xml:ns:yang:ietf-restconf-monitoring"; - prefix "rcmon"; - - import ietf-yang-types { prefix yang; } - import ietf-inet-types { prefix inet; } - - organization - "IETF NETCONF (Network Configuration) Working Group"; - - contact - "WG Web: - WG List: - Author: Andy Bierman - - Author: Martin Bjorklund - - Author: Kent Watsen - "; - - description - "This module contains monitoring information for the - RESTCONF protocol. - Copyright (c) 2016 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 - (http://trustee.ietf.org/license-info). - This version of this YANG module is part of RFC XXXX; see - the RFC itself for full legal notices."; - - // RFC Ed.: replace XXXX with actual RFC number and remove this - // note. - - // RFC Ed.: remove this note - // Note: extracted from draft-ietf-netconf-restconf-17.txt - - // RFC Ed.: update the date below with the date of RFC publication - // and remove this note. - revision 2016-08-15 { - description - "Initial revision."; - reference - "RFC XXXX: RESTCONF Protocol."; - } - - container restconf-state { - config false; - description - "Contains RESTCONF protocol monitoring information."; - - container capabilities { - description - "Contains a list of protocol capability URIs"; - - leaf-list capability { - type inet:uri; - description "A RESTCONF protocol capability URI."; - } - } - - container streams { - description - "Container representing the notification event streams - supported by the server."; - reference - "RFC 5277, Section 3.4, element."; - - list stream { - key name; - description - "Each entry describes an event stream supported by - the server."; - - leaf name { - type string; - description "The stream name"; - reference "RFC 5277, Section 3.4, element."; - } - - leaf description { - type string; - description "Description of stream content"; - reference - "RFC 5277, Section 3.4, element."; - } - - leaf replay-support { - type boolean; - default false; - description - "Indicates if replay buffer supported for this stream. - If 'true', then the server MUST support the 'start-time' - and 'stop-time' query parameters for this stream."; - reference - "RFC 5277, Section 3.4, element."; - } - - leaf replay-log-creation-time { - when "../replay-support" { - description - "Only present if notification replay is supported"; - } - type yang:date-and-time; - description - "Indicates the time the replay log for this stream - was created."; - reference - "RFC 5277, Section 3.4, - element."; - } - - list access { - key encoding; - min-elements 1; - description - "The server will create an entry in this list for each - encoding format that is supported for this stream. - The media type 'text/event-stream' is expected - for all event streams. This list identifies the - sub-types supported for this stream."; - - leaf encoding { - type string; - description - "This is the secondary encoding format within the - 'text/event-stream' encoding used by all streams. - The type 'xml' is supported for XML encoding. - The type 'json' is supported for JSON encoding."; - } - - leaf location { - type inet:uri; - mandatory true; - description - "Contains a URL that represents the entry point - for establishing notification delivery via server - sent events."; - } - } - } - } - } - -} diff --git a/restconf/sal-rest-connector/src/test/resources/restconf/impl/ietf-restconf-monitoring@2017-01-26.yang b/restconf/sal-rest-connector/src/test/resources/restconf/impl/ietf-restconf-monitoring@2017-01-26.yang new file mode 100644 index 0000000000..55c3cb1f64 --- /dev/null +++ b/restconf/sal-rest-connector/src/test/resources/restconf/impl/ietf-restconf-monitoring@2017-01-26.yang @@ -0,0 +1,149 @@ +module ietf-restconf-monitoring { + namespace "urn:ietf:params:xml:ns:yang:ietf-restconf-monitoring"; + prefix "rcmon"; + + import ietf-yang-types { prefix yang; } + import ietf-inet-types { prefix inet; } + + organization + "IETF NETCONF (Network Configuration) Working Group"; + + contact + "WG Web: + WG List: + + Author: Andy Bierman + + + Author: Martin Bjorklund + + + Author: Kent Watsen + "; + + description + "This module contains monitoring information for the + RESTCONF protocol. + + Copyright (c) 2017 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 + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 8040; see + the RFC itself for full legal notices."; + + revision 2017-01-26 { + description + "Initial revision."; + reference + "RFC 8040: RESTCONF Protocol."; + } + + container restconf-state { + config false; + description + "Contains RESTCONF protocol monitoring information."; + + container capabilities { + description + "Contains a list of protocol capability URIs."; + + leaf-list capability { + type inet:uri; + description + "A RESTCONF protocol capability URI."; + } + } + + container streams { + description + "Container representing the notification event streams + supported by the server."; + reference + "RFC 5277, Section 3.4, element."; + + list stream { + key name; + description + "Each entry describes an event stream supported by + the server."; + + leaf name { + type string; + description + "The stream name."; + reference + "RFC 5277, Section 3.4, element."; + } + + leaf description { + type string; + description + "Description of stream content."; + reference + "RFC 5277, Section 3.4, element."; + } + + leaf replay-support { + type boolean; + default false; + description + "Indicates if replay buffer is supported for this stream. + If 'true', then the server MUST support the 'start-time' + and 'stop-time' query parameters for this stream."; + reference + "RFC 5277, Section 3.4, element."; + } + + leaf replay-log-creation-time { + when "../replay-support" { + description + "Only present if notification replay is supported."; + } + type yang:date-and-time; + description + "Indicates the time the replay log for this stream + was created."; + reference + "RFC 5277, Section 3.4, + element."; + } + + list access { + key encoding; + min-elements 1; + description + "The server will create an entry in this list for each + encoding format that is supported for this stream. + The media type 'text/event-stream' is expected + for all event streams. This list identifies the + subtypes supported for this stream."; + + leaf encoding { + type string; + description + "This is the secondary encoding format within the + 'text/event-stream' encoding used by all streams. + The type 'xml' is supported for XML encoding. + The type 'json' is supported for JSON encoding."; + } + + leaf location { + type inet:uri; + mandatory true; + description + "Contains a URL that represents the entry point + for establishing notification delivery via + server-sent events."; + } + } + } + } + } +} diff --git a/restconf/sal-rest-connector/src/test/resources/restconf/impl/ietf-restconf@2016-08-15.yang b/restconf/sal-rest-connector/src/test/resources/restconf/impl/ietf-restconf@2016-08-15.yang deleted file mode 100644 index 2f642de75f..0000000000 --- a/restconf/sal-rest-connector/src/test/resources/restconf/impl/ietf-restconf@2016-08-15.yang +++ /dev/null @@ -1,256 +0,0 @@ -module ietf-restconf { - yang-version 1.1; - namespace "urn:ietf:params:xml:ns:yang:ietf-restconf"; - prefix "rc"; - - organization - "IETF NETCONF (Network Configuration) Working Group"; - - contact - "WG Web: - WG List: - Author: Andy Bierman - - Author: Martin Bjorklund - - Author: Kent Watsen - "; - - description - "This module contains conceptual YANG specifications - for basic RESTCONF media type definitions used in - RESTCONF protocol messages. - Note that the YANG definitions within this module do not - represent configuration data of any kind. - The 'restconf-media-type' YANG extension statement - provides a normative syntax for XML and JSON message - encoding purposes. - Copyright (c) 2016 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 - (http://trustee.ietf.org/license-info). - This version of this YANG module is part of RFC XXXX; see - the RFC itself for full legal notices."; - - // RFC Ed.: replace XXXX with actual RFC number and remove this - // note. - - // RFC Ed.: remove this note - // Note: extracted from draft-ietf-netconf-restconf-17.txt - - // RFC Ed.: update the date below with the date of RFC publication - // and remove this note. - revision 2016-08-15 { - description - "Initial revision."; - reference - "RFC XXXX: RESTCONF Protocol."; - } - - extension yang-data { - argument name { - yin-element true; - } - description - "This extension is used to specify a YANG data template which - represents conceptual data defined in YANG. It is - intended to describe hierarchical data independent of - protocol context or specific message encoding format. - Data definition statements within a yang-data extension - specify the generic syntax for the specific YANG data - template, whose name is the argument of the yang-data - extension statement. - Note that this extension does not define a media-type. - A specification using this extension MUST specify the - message encoding rules, including the content media type. - The mandatory 'name' parameter value identifies the YANG - data template that is being defined. It contains the - template name. - This extension is ignored unless it appears as a top-level - statement. It MUST contain data definition statements - that result in exactly one container data node definition. - An instance of a YANG data template can thus be translated - into an XML instance document, whose top-level element - corresponds to the top-level container. - The module name and namespace value for the YANG module using - the extension statement is assigned to instance document data - conforming to the data definition statements within - this extension. - The sub-statements of this extension MUST follow the - 'data-def-stmt' rule in the YANG ABNF. - The XPath document root is the extension statement itself, - such that the child nodes of the document root are - represented by the data-def-stmt sub-statements within - this extension. This conceptual document is the context - for the following YANG statements: - - must-stmt - - when-stmt - - path-stmt - - min-elements-stmt - - max-elements-stmt - - mandatory-stmt - - unique-stmt - - ordered-by - - instance-identifier data type - The following data-def-stmt sub-statements are constrained - when used within a yang-data-resource extension statement. - - The list-stmt is not required to have a key-stmt defined. - - The if-feature-stmt is ignored if present. - - The config-stmt is ignored if present. - - The available identity values for any 'identityref' - leaf or leaf-list nodes is limited to the module - containing this extension statement, and the modules - imported into that module. - "; - } - - rc:yang-data yang-errors { - uses errors; - } - - rc:yang-data yang-api { - uses restconf; - } - - grouping errors { - description - "A grouping that contains a YANG container - representing the syntax and semantics of a - YANG Patch errors report within a response message."; - - container errors { - description - "Represents an error report returned by the server if - a request results in an error."; - - list error { - description - "An entry containing information about one - specific error that occurred while processing - a RESTCONF request."; - reference "RFC 6241, Section 4.3"; - - leaf error-type { - type enumeration { - enum transport { - description "The transport layer"; - } - enum rpc { - description "The rpc or notification layer"; - } - enum protocol { - description "The protocol operation layer"; - } - enum application { - description "The server application layer"; - } - } - mandatory true; - description - "The protocol layer where the error occurred."; - } - - leaf error-tag { - type string; - mandatory true; - description - "The enumerated error tag."; - } - - leaf error-app-tag { - type string; - description - "The application-specific error tag."; - } - - leaf error-path { - type instance-identifier; - description - "The YANG instance identifier associated - with the error node."; - } - - leaf error-message { - type string; - description - "A message describing the error."; - } - - anydata error-info { - description - "This anydata value MUST represent a container with - zero or more data nodes representing additional - error information."; - } - } - } - } - - grouping restconf { - description - "Conceptual grouping representing the RESTCONF - root resource."; - - container restconf { - description - "Conceptual container representing the RESTCONF - root resource."; - - container data { - description - "Container representing the datastore resource. - Represents the conceptual root of all state data - and configuration data supported by the server. - The child nodes of this container can be any data - resource which are defined as top-level data nodes - from the YANG modules advertised by the server in - the ietf-yang-library module."; - } - - container operations { - description - "Container for all operation resources. - Each resource is represented as an empty leaf with the - name of the RPC operation from the YANG rpc statement. - For example, the 'system-restart' RPC operation defined - in the 'ietf-system' module would be represented as - an empty leaf in the 'ietf-system' namespace. This is - a conceptual leaf, and will not actually be found in - the module: - module ietf-system { - leaf system-reset { - type empty; - } - } - To invoke the 'system-restart' RPC operation: - POST /restconf/operations/ietf-system:system-restart - To discover the RPC operations supported by the server: - GET /restconf/operations - In XML the YANG module namespace identifies the module: - - In JSON the YANG module name identifies the module: - { 'ietf-system:system-restart' : [null] } - "; - } - - leaf yang-library-version { - type string { - pattern '\d{4}-\d{2}-\d{2}'; - } - config false; - mandatory true; - description - "Identifies the revision date of the ietf-yang-library - module that is implemented by this RESTCONF server. - Indicates the year, month, and day in YYYY-MM-DD - numeric format."; - } - } - } - -} diff --git a/restconf/sal-rest-connector/src/test/resources/restconf/impl/ietf-restconf@2017-01-26.yang b/restconf/sal-rest-connector/src/test/resources/restconf/impl/ietf-restconf@2017-01-26.yang new file mode 100644 index 0000000000..dc54388b10 --- /dev/null +++ b/restconf/sal-rest-connector/src/test/resources/restconf/impl/ietf-restconf@2017-01-26.yang @@ -0,0 +1,279 @@ +module ietf-restconf { + yang-version 1.1; + namespace "urn:ietf:params:xml:ns:yang:ietf-restconf"; + prefix "rc"; + + organization + "IETF NETCONF (Network Configuration) Working Group"; + + contact + "WG Web: + WG List: + + Author: Andy Bierman + + + Author: Martin Bjorklund + + + Author: Kent Watsen + "; + + description + "This module contains conceptual YANG specifications + for basic RESTCONF media type definitions used in + RESTCONF protocol messages. + + Note that the YANG definitions within this module do not + represent configuration data of any kind. + The 'restconf-media-type' YANG extension statement + provides a normative syntax for XML and JSON + message-encoding purposes. + + Copyright (c) 2017 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 + (http://trustee.ietf.org/license-info). + + This version of this YANG module is part of RFC 8040; see + the RFC itself for full legal notices."; + + revision 2017-01-26 { + description + "Initial revision."; + reference + "RFC 8040: RESTCONF Protocol."; + } + + extension yang-data { + argument name { + yin-element true; + } + description + "This extension is used to specify a YANG data template that + represents conceptual data defined in YANG. It is + intended to describe hierarchical data independent of + protocol context or specific message-encoding format. + Data definition statements within a yang-data extension + specify the generic syntax for the specific YANG data + template, whose name is the argument of the 'yang-data' + extension statement. + + Note that this extension does not define a media type. + A specification using this extension MUST specify the + message-encoding rules, including the content media type. + + The mandatory 'name' parameter value identifies the YANG + data template that is being defined. It contains the + template name. + + This extension is ignored unless it appears as a top-level + statement. It MUST contain data definition statements + that result in exactly one container data node definition. + An instance of a YANG data template can thus be translated + into an XML instance document, whose top-level element + corresponds to the top-level container. + + The module name and namespace values for the YANG module using + the extension statement are assigned to instance document data + conforming to the data definition statements within + this extension. + + The substatements of this extension MUST follow the + 'data-def-stmt' rule in the YANG ABNF. + + The XPath document root is the extension statement itself, + such that the child nodes of the document root are + represented by the data-def-stmt substatements within + this extension. This conceptual document is the context + for the following YANG statements: + + - must-stmt + - when-stmt + - path-stmt + - min-elements-stmt + - max-elements-stmt + - mandatory-stmt + - unique-stmt + - ordered-by + - instance-identifier data type + + The following data-def-stmt substatements are constrained + when used within a 'yang-data' extension statement. + + - The list-stmt is not required to have a key-stmt defined. + - The if-feature-stmt is ignored if present. + - The config-stmt is ignored if present. + - The available identity values for any 'identityref' + leaf or leaf-list nodes are limited to the module + containing this extension statement and the modules + imported into that module. + "; + } + + rc:yang-data yang-errors { + uses errors; + } + + rc:yang-data yang-api { + uses restconf; + } + + grouping errors { + description + "A grouping that contains a YANG container + representing the syntax and semantics of a + YANG Patch error report within a response message."; + + container errors { + description + "Represents an error report returned by the server if + a request results in an error."; + + list error { + description + "An entry containing information about one + specific error that occurred while processing + a RESTCONF request."; + reference + "RFC 6241, Section 4.3."; + + leaf error-type { + type enumeration { + enum transport { + description + "The transport layer."; + } + enum rpc { + description + "The rpc or notification layer."; + } + enum protocol { + description + "The protocol operation layer."; + } + enum application { + description + "The server application layer."; + } + } + mandatory true; + description + "The protocol layer where the error occurred."; + } + + leaf error-tag { + type string; + mandatory true; + description + "The enumerated error-tag."; + } + + leaf error-app-tag { + type string; + description + "The application-specific error-tag."; + } + + leaf error-path { + type instance-identifier; + description + "The YANG instance identifier associated + with the error node."; + } + + leaf error-message { + type string; + description + "A message describing the error."; + } + + anydata error-info { + description + "This anydata value MUST represent a container with + zero or more data nodes representing additional + error information."; + } + } + } + } + + grouping restconf { + description + "Conceptual grouping representing the RESTCONF + root resource."; + + container restconf { + description + "Conceptual container representing the RESTCONF + root resource."; + + container data { + description + "Container representing the datastore resource. + Represents the conceptual root of all state data + and configuration data supported by the server. + The child nodes of this container can be any data + resources that are defined as top-level data nodes + from the YANG modules advertised by the server in + the 'ietf-yang-library' module."; + } + + container operations { + description + "Container for all operation resources. + + Each resource is represented as an empty leaf with the + name of the RPC operation from the YANG 'rpc' statement. + + For example, the 'system-restart' RPC operation defined + in the 'ietf-system' module would be represented as + an empty leaf in the 'ietf-system' namespace. This is + a conceptual leaf and will not actually be found in + the module: + + module ietf-system { + leaf system-reset { + type empty; + } + } + + To invoke the 'system-restart' RPC operation: + + POST /restconf/operations/ietf-system:system-restart + + To discover the RPC operations supported by the server: + + GET /restconf/operations + + In XML, the YANG module namespace identifies the module: + + + + In JSON, the YANG module name identifies the module: + + { 'ietf-system:system-restart' : [null] } + "; + } + + leaf yang-library-version { + type string { + pattern '\d{4}-\d{2}-\d{2}'; + } + config false; + mandatory true; + description + "Identifies the revision date of the 'ietf-yang-library' + module that is implemented by this RESTCONF server. + Indicates the year, month, and day in YYYY-MM-DD + numeric format."; + } + } + } +} -- 2.36.6