+++ /dev/null
-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: <http://tools.ietf.org/wg/netconf/>
- WG List: <mailto:netconf@ietf.org>
- Author: Andy Bierman
- <mailto:andy@yumaworks.com>
- Author: Martin Bjorklund
- <mailto:mbj@tail-f.com>
- Author: Kent Watsen
- <mailto:kwatsen@juniper.net>";
-
- 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, <streams> 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, <name> element.";
- }
-
- leaf description {
- type string;
- description "Description of stream content";
- reference
- "RFC 5277, Section 3.4, <description> 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, <replaySupport> 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, <replayLogCreationTime>
- 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.";
- }
- }
- }
- }
- }
-
-}
--- /dev/null
+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: <https://datatracker.ietf.org/wg/netconf/>
+ WG List: <mailto:netconf@ietf.org>
+
+ Author: Andy Bierman
+ <mailto:andy@yumaworks.com>
+
+ Author: Martin Bjorklund
+ <mailto:mbj@tail-f.com>
+
+ Author: Kent Watsen
+ <mailto:kwatsen@juniper.net>";
+
+ 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, <streams> 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, <name> element.";
+ }
+
+ leaf description {
+ type string;
+ description
+ "Description of stream content.";
+ reference
+ "RFC 5277, Section 3.4, <description> 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, <replaySupport> 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, <replayLogCreationTime>
+ 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.";
+ }
+ }
+ }
+ }
+ }
+}
+++ /dev/null
-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: <http://tools.ietf.org/wg/netconf/>
- WG List: <mailto:netconf@ietf.org>
- Author: Andy Bierman
- <mailto:andy@yumaworks.com>
- Author: Martin Bjorklund
- <mailto:mbj@tail-f.com>
- Author: Kent Watsen
- <mailto:kwatsen@juniper.net>";
-
- 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:
- <system-restart
- xmlns='urn:ietf:params:xml:ns:yang:ietf-system' />
- 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.";
- }
- }
- }
-
-}
--- /dev/null
+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: <https://datatracker.ietf.org/wg/netconf/>
+ WG List: <mailto:netconf@ietf.org>
+
+ Author: Andy Bierman
+ <mailto:andy@yumaworks.com>
+
+ Author: Martin Bjorklund
+ <mailto:mbj@tail-f.com>
+
+ Author: Kent Watsen
+ <mailto:kwatsen@juniper.net>";
+
+ 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:
+
+ <system-restart
+ xmlns='urn:ietf:params:xml:ns:yang:ietf-system'/>
+
+ 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.";
+ }
+ }
+ }
+}
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<SchemaExportContext> {
@Override
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<SchemaExportContext> {
@Override
*/
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
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;
@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<NormalizedNodeContext> {
private final static Logger LOG = LoggerFactory.getLogger(JsonNormalizedNodeBodyReader.class);
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<PATCHStatusContext> {
@Override
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<PATCHStatusContext> {
private static final XMLOutputFactory XML_FACTORY;
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;
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;
* <li>{@link MonitoringModule}
* </ul>
* </ul>
- *
- * 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");
}
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;
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";
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;
/**
*/
@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);
*/
@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
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;
/**
* @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);
}
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;
/**
*/
@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();
}
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;
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;
/**
* 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());
}
/**
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;
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;
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<NormalizedNodeContext> {
private final static Logger LOG = LoggerFactory.getLogger(JsonNormalizedNodeBodyReader.class);
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;
import org.slf4j.LoggerFactory;
@Provider
-@Consumes({Draft18.MediaTypes.PATCH + RestconfConstants.JSON})
+@Consumes({Rfc8040.MediaTypes.PATCH + RestconfConstants.JSON})
public class JsonToPATCHBodyReader extends AbstractIdentifierAwareJaxRsProvider
implements MessageBodyReader<PATCHContext> {
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;
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<NormalizedNodeContext> {
private static final int DEFAULT_INDENT_SPACES_NUM = 2;
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;
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<NormalizedNodeContext> {
private static final XMLOutputFactory XML_FACTORY;
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;
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<NormalizedNodeContext> {
private final static Logger LOG = LoggerFactory.getLogger(XmlNormalizedNodeBodyReader.class);
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;
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<PATCHContext> {
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;
/**
*/
@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);
*/
@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);
*/
@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);
*/
@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);
*/
@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);
*/
@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);
*/
@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);
}
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;
/**
*/
@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);
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;
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;
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;
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;
+++ /dev/null
-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: <http://tools.ietf.org/wg/netconf/>
- WG List: <mailto:netconf@ietf.org>
- Author: Andy Bierman
- <mailto:andy@yumaworks.com>
- Author: Martin Bjorklund
- <mailto:mbj@tail-f.com>
- Author: Kent Watsen
- <mailto:kwatsen@juniper.net>";
-
- 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, <streams> 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, <name> element.";
- }
-
- leaf description {
- type string;
- description "Description of stream content";
- reference
- "RFC 5277, Section 3.4, <description> 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, <replaySupport> 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, <replayLogCreationTime>
- 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.";
- }
- }
- }
- }
- }
-
-}
--- /dev/null
+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: <https://datatracker.ietf.org/wg/netconf/>
+ WG List: <mailto:netconf@ietf.org>
+
+ Author: Andy Bierman
+ <mailto:andy@yumaworks.com>
+
+ Author: Martin Bjorklund
+ <mailto:mbj@tail-f.com>
+
+ Author: Kent Watsen
+ <mailto:kwatsen@juniper.net>";
+
+ 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, <streams> 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, <name> element.";
+ }
+
+ leaf description {
+ type string;
+ description
+ "Description of stream content.";
+ reference
+ "RFC 5277, Section 3.4, <description> 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, <replaySupport> 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, <replayLogCreationTime>
+ 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.";
+ }
+ }
+ }
+ }
+ }
+}
+++ /dev/null
-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: <http://tools.ietf.org/wg/netconf/>
- WG List: <mailto:netconf@ietf.org>
- Author: Andy Bierman
- <mailto:andy@yumaworks.com>
- Author: Martin Bjorklund
- <mailto:mbj@tail-f.com>
- Author: Kent Watsen
- <mailto:kwatsen@juniper.net>";
-
- 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, <streams> 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, <name> element.";
- }
-
- leaf description {
- type string;
- description "Description of stream content";
- reference
- "RFC 5277, Section 3.4, <description> 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, <replaySupport> 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, <replayLogCreationTime>
- 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.";
- }
- }
- }
- }
- }
-
-}
--- /dev/null
+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: <https://datatracker.ietf.org/wg/netconf/>
+ WG List: <mailto:netconf@ietf.org>
+
+ Author: Andy Bierman
+ <mailto:andy@yumaworks.com>
+
+ Author: Martin Bjorklund
+ <mailto:mbj@tail-f.com>
+
+ Author: Kent Watsen
+ <mailto:kwatsen@juniper.net>";
+
+ 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, <streams> 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, <name> element.";
+ }
+
+ leaf description {
+ type string;
+ description
+ "Description of stream content.";
+ reference
+ "RFC 5277, Section 3.4, <description> 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, <replaySupport> 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, <replayLogCreationTime>
+ 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.";
+ }
+ }
+ }
+ }
+ }
+}
+++ /dev/null
-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: <http://tools.ietf.org/wg/netconf/>
- WG List: <mailto:netconf@ietf.org>
- Author: Andy Bierman
- <mailto:andy@yumaworks.com>
- Author: Martin Bjorklund
- <mailto:mbj@tail-f.com>
- Author: Kent Watsen
- <mailto:kwatsen@juniper.net>";
-
- 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, <streams> 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, <name> element.";
- }
-
- leaf description {
- type string;
- description "Description of stream content";
- reference
- "RFC 5277, Section 3.4, <description> 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, <replaySupport> 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, <replayLogCreationTime>
- 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.";
- }
- }
- }
- }
- }
-
-}
--- /dev/null
+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: <https://datatracker.ietf.org/wg/netconf/>
+ WG List: <mailto:netconf@ietf.org>
+
+ Author: Andy Bierman
+ <mailto:andy@yumaworks.com>
+
+ Author: Martin Bjorklund
+ <mailto:mbj@tail-f.com>
+
+ Author: Kent Watsen
+ <mailto:kwatsen@juniper.net>";
+
+ 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, <streams> 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, <name> element.";
+ }
+
+ leaf description {
+ type string;
+ description
+ "Description of stream content.";
+ reference
+ "RFC 5277, Section 3.4, <description> 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, <replaySupport> 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, <replayLogCreationTime>
+ 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.";
+ }
+ }
+ }
+ }
+ }
+}
+++ /dev/null
-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: <http://tools.ietf.org/wg/netconf/>
- WG List: <mailto:netconf@ietf.org>
- Author: Andy Bierman
- <mailto:andy@yumaworks.com>
- Author: Martin Bjorklund
- <mailto:mbj@tail-f.com>
- Author: Kent Watsen
- <mailto:kwatsen@juniper.net>";
-
- 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, <streams> 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, <name> element.";
- }
-
- leaf description {
- type string;
- description "Description of stream content";
- reference
- "RFC 5277, Section 3.4, <description> 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, <replaySupport> 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, <replayLogCreationTime>
- 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.";
- }
- }
- }
- }
- }
-
-}
--- /dev/null
+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: <https://datatracker.ietf.org/wg/netconf/>
+ WG List: <mailto:netconf@ietf.org>
+
+ Author: Andy Bierman
+ <mailto:andy@yumaworks.com>
+
+ Author: Martin Bjorklund
+ <mailto:mbj@tail-f.com>
+
+ Author: Kent Watsen
+ <mailto:kwatsen@juniper.net>";
+
+ 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, <streams> 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, <name> element.";
+ }
+
+ leaf description {
+ type string;
+ description
+ "Description of stream content.";
+ reference
+ "RFC 5277, Section 3.4, <description> 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, <replaySupport> 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, <replayLogCreationTime>
+ 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.";
+ }
+ }
+ }
+ }
+ }
+}
+++ /dev/null
-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: <http://tools.ietf.org/wg/netconf/>
- WG List: <mailto:netconf@ietf.org>
- Author: Andy Bierman
- <mailto:andy@yumaworks.com>
- Author: Martin Bjorklund
- <mailto:mbj@tail-f.com>
- Author: Kent Watsen
- <mailto:kwatsen@juniper.net>";
-
- 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, <streams> 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, <name> element.";
- }
-
- leaf description {
- type string;
- description "Description of stream content";
- reference
- "RFC 5277, Section 3.4, <description> 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, <replaySupport> 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, <replayLogCreationTime>
- 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.";
- }
- }
- }
- }
- }
-
-}
--- /dev/null
+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: <https://datatracker.ietf.org/wg/netconf/>
+ WG List: <mailto:netconf@ietf.org>
+
+ Author: Andy Bierman
+ <mailto:andy@yumaworks.com>
+
+ Author: Martin Bjorklund
+ <mailto:mbj@tail-f.com>
+
+ Author: Kent Watsen
+ <mailto:kwatsen@juniper.net>";
+
+ 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, <streams> 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, <name> element.";
+ }
+
+ leaf description {
+ type string;
+ description
+ "Description of stream content.";
+ reference
+ "RFC 5277, Section 3.4, <description> 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, <replaySupport> 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, <replayLogCreationTime>
+ 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.";
+ }
+ }
+ }
+ }
+ }
+}
+++ /dev/null
-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: <http://tools.ietf.org/wg/netconf/>
- WG List: <mailto:netconf@ietf.org>
- Author: Andy Bierman
- <mailto:andy@yumaworks.com>
- Author: Martin Bjorklund
- <mailto:mbj@tail-f.com>
- Author: Kent Watsen
- <mailto:kwatsen@juniper.net>";
-
- 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, <streams> 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, <name> element.";
- }
-
- leaf description {
- type string;
- description "Description of stream content";
- reference
- "RFC 5277, Section 3.4, <description> 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, <replaySupport> 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, <replayLogCreationTime>
- 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.";
- }
- }
- }
- }
- }
-
-}
--- /dev/null
+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: <https://datatracker.ietf.org/wg/netconf/>
+ WG List: <mailto:netconf@ietf.org>
+
+ Author: Andy Bierman
+ <mailto:andy@yumaworks.com>
+
+ Author: Martin Bjorklund
+ <mailto:mbj@tail-f.com>
+
+ Author: Kent Watsen
+ <mailto:kwatsen@juniper.net>";
+
+ 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, <streams> 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, <name> element.";
+ }
+
+ leaf description {
+ type string;
+ description
+ "Description of stream content.";
+ reference
+ "RFC 5277, Section 3.4, <description> 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, <replaySupport> 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, <replayLogCreationTime>
+ 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.";
+ }
+ }
+ }
+ }
+ }
+}
+++ /dev/null
-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: <http://tools.ietf.org/wg/netconf/>
- WG List: <mailto:netconf@ietf.org>
- Author: Andy Bierman
- <mailto:andy@yumaworks.com>
- Author: Martin Bjorklund
- <mailto:mbj@tail-f.com>
- Author: Kent Watsen
- <mailto:kwatsen@juniper.net>";
-
- 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:
- <system-restart
- xmlns='urn:ietf:params:xml:ns:yang:ietf-system' />
- 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.";
- }
- }
- }
-
-}
--- /dev/null
+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: <https://datatracker.ietf.org/wg/netconf/>
+ WG List: <mailto:netconf@ietf.org>
+
+ Author: Andy Bierman
+ <mailto:andy@yumaworks.com>
+
+ Author: Martin Bjorklund
+ <mailto:mbj@tail-f.com>
+
+ Author: Kent Watsen
+ <mailto:kwatsen@juniper.net>";
+
+ 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:
+
+ <system-restart
+ xmlns='urn:ietf:params:xml:ns:yang:ietf-system'/>
+
+ 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.";
+ }
+ }
+ }
+}