One document matched: draft-bierman-netconf-restconf-01.xml
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt"?>
<!DOCTYPE rfc SYSTEM 'rfc2629.dtd'>
<?rfc toc="yes"?>
<?rfc compact="no"?>
<?rfc subcompact="no"?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes"?>
<?rfc iprnotified="no"?>
<?rfc strict="yes"?>
<rfc ipr="trust200902" category="std"
docName="draft-bierman-netconf-restconf-01" >
<front>
<title abbrev="RESTCONF">RESTCONF Protocol</title>
<author initials="A" surname="Bierman" fullname='Andy Bierman' >
<organization>YumaWorks</organization>
<address>
<email>andy@yumaworks.com</email>
</address>
</author>
<author initials="M" surname="Bjorklund" fullname='Martin Bjorklund' >
<organization>Tail-f Systems</organization>
<address>
<email>mbj@tail-f.com</email>
</address>
</author>
<author initials="K" surname="Watsen" fullname='Kent Watsen' >
<organization>Juniper Networks</organization>
<address>
<email>kwatsen@juniper.net</email>
</address>
</author>
<author initials="R" surname="Fernando" fullname='Rex Fernando' >
<organization>Cisco</organization>
<address>
<email>rex@cisco.com</email>
</address>
</author>
<date/>
<abstract>
<t>
This document describes a RESTful protocol that provides
a programmatic interface over HTTP for accessing data
defined in YANG, using the datastores defined in NETCONF.
</t>
</abstract>
</front>
<middle>
<section title="Introduction">
<t>
There is a need for standard mechanisms to allow WEB applications
to access the configuration data, operational data,
data-model specific protocol operations, and notification events
within a networking device, in a modular and extensible manner.
</t>
<t>
This document describes a RESTful protocol called RESTCONF,
running over HTTP <xref target="RFC2616"/>, for accessing data defined
in YANG <xref target="RFC6020"/>, using datastores defined in NETCONF <xref target="RFC6241"/>.
</t>
<t>
The NETCONF protocol defines configuration datastores and
a set of Create, Retrieve, Update, Delete (CRUD) operations
that can be used to access these datastores. The YANG language
defines the syntax and semantics of datastore content,
operational data, custom protocol operations, and
notification events. RESTful operations are used to
access the hierarchical data within a datastore.
</t>
<t>
A RESTful API can be created that provides CRUD operations on a
NETCONF datastore containing YANG-defined data. This can be done in a
simplified manner, compatible with HTTP and RESTful design principles.
Since NETCONF protocol operations are not relevant, the user should
not need any prior knowledge of NETCONF in order to use the RESTful
API.
</t>
<t>
Configuration data and state data are exposed as resources that
can be retrieved with the GET method.
Resources representing configuration data
can be modified with the DELETE, PATCH, POST, and PUT methods.
Data-model specific protocol operations defined with
the YANG "rpc" statement can be invoked with the POST method.
Data-model specific notification events defined with
the YANG "notification" statement can be accessed (delivery method TBD).
</t>
<section title="Simple Subset of NETCONF Functionality">
<t>
The framework and meta-model used for a RESTful API does not need to
mirror those used by the NETCONF protocol. It just needs to
be compatible with NETCONF. A simplified framework and protocol
is needed that utilizes the three NETCONF datastores (candidate,
running, startup), but hides the complexity of multiple datastores
from the client.
</t>
<t>
A simplified transaction model is needed that allows basic
CRUD operations on a hierarchy of conceptual resources.
This represents a limited subset of the transaction capabilities
of the NETCONF protocol.
</t>
<t>
Applications that require more complex transaction capabilities
might consider NETCONF instead of RESTCONF. The following
transaction features are not directly provided in RESTCONF:
</t>
<t>
<list style="symbols">
<t>
datastore locking (full or partial)
</t>
<t>
candidate datastore
</t>
<t>
startup datastore
</t>
<t>
validate operation
</t>
<t>
confirmed-commit procedure
</t>
</list>
</t>
<t>
It is possible that a server could expose NETCONF operations
as data-model specific operation resources, but that
is out of scope within this document.
</t>
<t>
The RESTful API is not intended to replace NETCONF, but rather provide
an additional simplified interface that follows RESTful principles and
is compatible with a resource-oriented device abstraction. It is
expected that applications that need the full feature set of NETCONF
such as notifications will continue to use NETCONF.
</t>
<t>
The following figure shows the system components:
</t>
<figure>
<artwork><![CDATA[
+-----------+ +-----------------+
| WEB app | <-------> | |
+-----------+ HTTP | network device |
| |
+-----------+ | +-----------+ |
| NMS app | <-------> | | datastore | |
+-----------+ NETCONF | +-----------+ |
+-----------------+
]]></artwork>
</figure>
</section>
<section title="Data Model Driven API">
<t>
RESTCONF combines the simplicity of a RESTful API over HTTP
with the predictability and automation potential
of a schema-driven API.
</t>
<t>
A RESTful client using HATEOAS principles would not use
any data modelling language to define the application-specific content
of the API. The client would discover each new child
resource as it traverses the URIs return as Location IDs
to discover the server capabilities.
</t>
<t>
This approach has 3 significant weaknesses wrt/ control
of complex networking devices:
</t>
<t>
<list style="symbols">
<t>
inefficient performance: configuration APIs will be quite
complex and may require thousands of protocol messages to
discover all the schema information. Typically the
data type information has to be passed in the protocol messages,
which is also wasteful overhead.
</t>
<t>
no data model richness: without a data model, the schema-level
semantics and validation constraints are not available to the
application.
</t>
<t>
no tool automation: API automation tools need some sort of
content schema to function. Such tools can automate
various programming and documentation tasks related
to specific data models.
</t>
</list>
</t>
<t>
Data model modules such as YANG modules serve as an "API contract"
that will be honored by the server. An application designer
can code to the data model, knowing in advance important details
about the exact protocol operations and datastore content
a conforming server implementation will support.
</t>
<t>
RESTCONF provides the YANG module capability information
supported by the server, in case the client wants to use it.
The URIs for custom protocol operations and datastore content
are predictable, based on the YANG module definitions.
Note that the YANG modules and predictable URIs are optional
to use by the client. They can be completely ignored without
any loss of protocol functionality.
</t>
<t>
Operational experience with CLI and SNMP indicates that
operators learn the 'location' of specific service
or device related data and do not expect such information
to be arbitrary and discovered each time the
client opens a management session to a server.
</t>
</section>
<section title="Terminology">
<t>
The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in BCP
14, <xref target="RFC2119"/>.
</t>
<section title="NETCONF">
<t>
The following terms are defined in <xref target="RFC6241"/>:
</t>
<t>
<list style="symbols">
<t>
candidate configuration datastore
</t>
<t>
client
</t>
<t>
configuration data
</t>
<t>
datastore
</t>
<t>
configuration datastore
</t>
<t>
protocol operation
</t>
<t>
running configuration datastore
</t>
<t>
server
</t>
<t>
startup configuration datastore
</t>
<t>
state data
</t>
<t>
user
</t>
</list>
</t>
</section>
<section title="HTTP">
<t>
The following terms are defined in <xref target="RFC2616"/>:
</t>
<t>
<list style="symbols">
<t>
entity tag
</t>
<t>
fragment
</t>
<t>
header line
</t>
<t>
message body
</t>
<t>
method
</t>
<t>
path
</t>
<t>
query
</t>
<t>
request URI
</t>
<t>
response body
</t>
</list>
</t>
</section>
<section title="YANG">
<t>
The following terms are defined in <xref target="RFC6020"/>:
</t>
<t>
<list style="symbols">
<t>
container
</t>
<t>
data node
</t>
<t>
key leaf
</t>
<t>
leaf
</t>
<t>
leaf-list
</t>
<t>
list
</t>
<t>
presence container (or P-container)
</t>
<t>
RPC operation (now called protocol operation)
</t>
<t>
non-presence container (or NP-container)
</t>
<t>
ordered-by system
</t>
<t>
ordered-by user
</t>
</list>
</t>
</section>
<section title="Terms">
<t>
The following terms are used within this document:
</t>
<t>
<list style="symbols">
<t>
API resource: a resource with the media type
"application/vnd.yang.api+xml" or "application/vnd.yang.api+json".
API resources can only be edited by the server.
</t>
<t>
data resource: a resource with the media type
"application/vnd.yang.data+xml" or "application/vnd.yang.data+json".
Data resources can be edited by clients or the server.
Only YANG containers and lists can be data resources.
Top-level YANG terminals are treated as fields within
the datastore resource.
</t>
<t>
datastore resource: a resource with the media type
"application/vnd.yang.datastore+xml" or
"application/vnd.yang.datastore+json".
Datastore resources can only be edited by the server.
</t>
<t>
edit operation: a RESTCONF operation on a data resource
using the POST, PUT, PATCH, or DELETE method.
</t>
<t>
event resource: a resource with the media type
"application/vnd.yang.event+xml" or
"application/vnd.yang.event+json".
It represents a conceptual system or data-model specific event
that is delivered within a notification message.
</t>
<t>
field: a YANG terminal node within a resource.
</t>
<t>
operation: the conceptual RESTCONF operation for a message,
derived from the HTTP method, request URI, headers, and message body.
</t>
<t>
operation resource: a resource with the media type
"application/vnd.yang.operation+xml" or
"application/vnd.yang.operation+json".
</t>
<t>
patch: a generic PATCH operation on the target datastore.
The media type of the message body content will identity
the patch type in use.
</t>
<t>
plain patch: a PATCH operation where the media type
is "application/vnd.yang.data+xml" or "application/vnd.yang.data+json".
</t>
<t>
query parameter: a parameter (and its value if any),
encoded within the query portion of the request URI.
</t>
<t>
resource: a conceptual object representing a manageable
component within a device. Refers to the resource itself of
the resource and all its fields.
</t>
<t>
retrieval request: an operation using the GET or HEAD methods.
</t>
<t>
target resource: the resource that is associated with
a particular message, identified by the "path" component
of the request URI.
</t>
<t>
unified datastore: A conceptual representation of the device
running configuration. The server will hide all NETCONF datastore
details for edit operations, such as the ":candidate" and ":startup"
capabilities.
</t>
<t>
YANG Patch: a PATCH operation where the media type
is "application/vnd.yang.patch+xml" or
"application/vnd.yang.patch+json".
</t>
<t>
YANG terminal node: a YANG node representing a leaf,
leaf-list, or anyxml definition.
</t>
</list>
</t>
</section>
</section>
<section title="Overview">
<t>
This document defines the RESTCONF protocol, a RESTful API for accessing
conceptual datastores containing data defined with YANG language.
RESTCONF provides an application framework and meta-model,
using HTTP methods.
</t>
<t>
The RESTCONF resources are accessed via a set of
URIs defined in this document.
The set of YANG modules supported by the server
will determine the additional data model specific operations
and top-level data node resources available on the server.
</t>
<section title="Resource URI Map">
<t>
The URI hierarchy for the RESTCONF resources
consists of an entry point container,
3 top-level resources, and 1 field.
Refer to <xref target="resources"/> for details on each URI.
</t>
<figure>
<artwork><![CDATA[
/restconf
/datastore
/<top-level-data-nodes> (config=true or false)
/modules
/module
/name
/revision
/namespace
/feature
/deviation
/operations
/<custom protocol operations>
/version (field)
]]></artwork>
</figure>
</section>
<section title="RESTCONF Message Examples" anchor="main-examples">
<t>
The examples within this document use the normative
YANG module defined in <xref target="module"/> and the non-normative
example YANG module defined in <xref target="example-module"/>.
</t>
<t>
This section shows some typical RESTCONF message exchanges.
</t>
<section title="Retrieve the Top-level API Resource">
<t>
By default, when a resource is retrieved,
any nested resources are also
returned, using the default encoding, which is XML.
</t>
<t>
The client may start by retrieving the top-level
API resource, using the entry point URI "/restconf".
</t>
<figure>
<artwork><![CDATA[
GET /restconf?format=json HTTP/1.1
Host: example.com
Accept: application/vnd.yang.api+json
]]></artwork>
</figure>
<t>
The server might respond as follows:
</t>
<figure>
<artwork><![CDATA[
HTTP/1.1 200 OK
Date: Mon, 23 Apr 2012 17:01:00 GMT
Server: example-server
Content-Type: application/vnd.yang.api+json
{
"restconf": {
"datastore" : [ null ],
"modules": {
"module": [
{
"name" : "example-jukebox",
"revision" : "2013-09-04",
"namespace" : "example.com"
}
]
},
"operations" : {
"play" : [ null ]
},
"version": "1.0"
}
}
]]></artwork>
</figure>
<t>
To request that the response content to be encoded in XML,
the "Accept" header can be used, as in this example request:
</t>
<figure>
<artwork><![CDATA[
GET /restconf HTTP/1.1
Host: example.com
Accept: application/vnd.yang.api+xml
]]></artwork>
</figure>
<t>
An alternate approach is provided using the "format" query
parameter, as in this example request:
</t>
<figure>
<artwork><![CDATA[
GET /restconf?format=xml HTTP/1.1
Host: example.com
]]></artwork>
</figure>
<t>
The server will return the same response either way,
which might be as follows :
</t>
<figure>
<artwork><![CDATA[
HTTP/1.1 200 OK
Date: Mon, 23 Apr 2012 17:01:00 GMT
Server: example-server
Cache-Control: no-cache
Pragma: no-cache
Content-Type: application/vnd.yang.api+xml
]]></artwork>
</figure>
<figure>
<artwork><![CDATA[
<restconf xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf">
<datastore />
<modules>
<module>
<name>example-jukebox</name>
<revision>2013-09-04</revision>
<namespace>example.com</namespace>
</module>
</modules>
<operations>
<play xmlns="http://example.com/ns/example-jukebox" />
</operations>
<version>1.0</version>
</restconf>
]]></artwork>
</figure>
<t>
Refer to <xref target="get"/> for details on the GET method.
</t>
</section>
<section title="Create New Data Resources">
<t>
To create a new "jukebox" resource, the client might send:
</t>
<figure>
<artwork><![CDATA[
POST /restconf/datastore HTTP/1.1
Host: example.com
Content-Type: application/vnd.yang.data+json
{ "example-jukebox:jukebox" : [null] }
]]></artwork>
</figure>
<t>
If the resource is created, the server might respond:
</t>
<figure>
<artwork><![CDATA[
HTTP/1.1 201 Created
Date: Mon, 23 Apr 2012 17:01:00 GMT
Server: example-server
Location: http://example.com/restconf/datastore/
example-jukebox:jukebox
Last-Modified: Mon, 23 Apr 2012 17:01:00 GMT
ETag: b3a3e673be2
]]></artwork>
</figure>
<t>
To create a new "artist" resource within the "library"
resource, the client might send the following request.
</t>
<figure>
<artwork><![CDATA[
POST /restconf/datastore/example-jukebox:jukebox/library HTTP/1.1
Host: example.com
Content-Type: application/vnd.yang.data+json
{ "artist" : {
"name" : "Foo Fighters"
}
}
]]></artwork>
</figure>
<t>
If the resource is created, the server might respond as follows.
Note that the "Location" header line is wrapped
for display purposes only:
</t>
<figure>
<artwork><![CDATA[
HTTP/1.1 201 Created
Date: Mon, 23 Apr 2012 17:02:00 GMT
Server: example-server
Location: http://example.com/restconf/datastore/
example-jukebox:jukebox/library/artist/Foo%20Fighters
Last-Modified: Mon, 23 Apr 2012 17:02:00 GMT
ETag: b3830f23a4c
]]></artwork>
</figure>
<t>
To create a new "album" resource for this artist within the "jukebox"
resource, the client might send the following request.
Note that the request URI header line is wrapped
for display purposes only:
</t>
<figure>
<artwork><![CDATA[
POST /restconf/datastore/example-jukebox:jukebox/
library/artist/Foo%20Fighters HTTP/1.1
Host: example.com
Content-Type: application/vnd.yang.data+json
{
"album" : {
"name" : "Wasting Light",
"genre" : "example-jukebox:alternative",
"year" : 2012 // note this is the wrong date
}
}
]]></artwork>
</figure>
<t>
If the resource is created, the server might respond
as follows. Note that the "Location" header line is wrapped
for display purposes only:
</t>
<figure>
<artwork><![CDATA[
HTTP/1.1 201 Created
Date: Mon, 23 Apr 2012 17:03:00 GMT
Server: example-server
Location: http://example.com/restconf/datastore/
example-jukebox:jukebox/library/artist/Foo%20Fighters/
album/Wasting%20Light
Last-Modified: Mon, 23 Apr 2012 17:03:00 GMT
ETag: b8389233a4c
]]></artwork>
</figure>
<t>
Refer to <xref target="post"/> for details on the POST method.
</t>
</section>
<section title="Replace an Existing Data Resource">
<t>
Note: replacing a resource is a fairly drastic operation.
The PATCH method is often more appropriate.
</t>
<t>
The album sub-resource is replaced here for example
purposes only.
To replace the "album" resource contents,
the client might send as follows.
Note that the request URI header line is wrapped
for display purposes only:
</t>
<figure>
<artwork><![CDATA[
PUT /restconf/datastore/example-jukebox:jukebox/
library/artist/Foo%20Fighters/album/Wasting%20Light HTTP/1.1
Host: example.com
If-Match: b3830f23a4c
Content-Type: application/vnd.yang.data+json
{
"album" : {
"name" : "Wasting Light",
"genre" : "example-jukebox:alternative",
"year" : 2011
}
}
]]></artwork>
</figure>
<t>
If the resource is updated, the server might respond:
</t>
<figure>
<artwork><![CDATA[
HTTP/1.1 204 No Content
Date: Mon, 23 Apr 2012 17:04:00 GMT
Server: example-server
Last-Modified: Mon, 23 Apr 2012 17:04:00 GMT
ETag: b27480aeda4c
]]></artwork>
</figure>
<t>
Refer to <xref target="put"/> for details on the PUT method.
</t>
</section>
<section title="Patch an Existing Data Resource">
<t>
To replace just the "year" field in the "album" resource
(instead of replacing the entire resource),
the client might send a plain patch as follows.
Note that the request URI header line is wrapped
for display purposes only:
</t>
<figure>
<artwork><![CDATA[
PATCH /restconf/datastore/example-jukebox:jukebox/
library/artist/Foo%20Fighters/album/Wasting%20Light HTTP/1.1
Host: example.com
If-Match: b8389233a4c
Content-Type: application/vnd.yang.data+json
{ "year" : 2011 }
]]></artwork>
</figure>
<t>
If the field is updated, the server might respond:
</t>
<figure>
<artwork><![CDATA[
HTTP/1.1 204 No Content
Date: Mon, 23 Apr 2012 17:49:30 GMT
Server: example-server
Last-Modified: Mon, 23 Apr 2012 17:49:30 GMT
ETag: b2788923da4c
]]></artwork>
</figure>
<t>
The XML encoding for the same request might be:
</t>
<figure>
<artwork><![CDATA[
PATCH /restconf/datastore/example-jukebox:jukebox/
library/artist/Foo%20Fighters/album/Wasting%20Light HTTP/1.1
Host: example.com
If-Match: b8389233a4c
Content-Type: application/vnd.yang.data+xml
]]></artwork>
</figure>
<figure>
<artwork><![CDATA[
<year xmlns="http://example.com/ns/example-jukebox">2011</year>
]]></artwork>
</figure>
<t>
Refer to <xref target="patch"/> for details on the PATCH method.
</t>
</section>
<section title="Delete an Existing Data Resource">
<t>
To delete a resource such as the "album" resource,
the client might send:
</t>
<figure>
<artwork><![CDATA[
DELETE /restconf/datastore/example-jukebox:jukebox/
library/artist/Foo%20Fighters/album/Wasting%20Light HTTP/1.1
Host: example.com
]]></artwork>
</figure>
<t>
If the resource is deleted, the server might respond:
</t>
<figure>
<artwork><![CDATA[
HTTP/1.1 204 No Content
Date: Mon, 23 Apr 2012 17:49:40 GMT
Server: example-server
]]></artwork>
</figure>
<t>
Refer to <xref target="delete"/> for details on the DELETE method.
</t>
</section>
<section title="Delete an Optional Field Within a Data Resource">
<t>
The DELETE method cannot be used to delete an
optional field within a resource. This can only be done
using the PATCH method with the YANG Patch media type.
</t>
<t>
Refer to <xref target="yang-patch"/> for details on the YANG Patch method.
</t>
</section>
<section title="Invoke a Data Model Specific Operation">
<t>
To invoke a data-model specific operation via an
operation resource, the POST method is used.
A client might send a "backup‑datastore" request as follows:
</t>
<figure>
<artwork><![CDATA[
POST /restconf/operations/example-ops:backup-datastore HTTP/1.1
Host: example.com
]]></artwork>
</figure>
<t>
The server might respond:
</t>
<figure>
<artwork><![CDATA[
HTTP/1.1 204 No Content
Date: Mon, 23 Apr 2012 17:50:00 GMT
Server: example-server
]]></artwork>
</figure>
<t>
Refer to <xref target="protocol-ops"/> for details on using the POST method
with operation resources.
</t>
</section>
</section>
</section>
</section>
<section title="Framework">
<t>
The RESTCONF protocol defines a framework
that can be used to implement a common API for
configuration management. This section describes
the components of the RESTCONF framework.
</t>
<section title="Message Model">
<t>
The RESTCONF protocol uses HTTP entities for messages.
A single HTTP message corresponds to a single protocol method.
Most messages can perform a single task on a single resource,
such as retrieving a resource or editing a resource.
The exception is the PATCH method using the YANG Patch format.
This allows multiple datastore edits within a single message.
</t>
</section>
<section title="Notification Model">
<figure>
<artwork><![CDATA[
[TBD]
]]></artwork>
</figure>
</section>
<section title="Resource Model">
<t>
The RESTCONF protocol operates on a hierarchy of resources,
starting with the top-level API resource itself. Each resource
represents a manageable component within the device.
</t>
<t>
A resource can be considered a collection of conceptual data
and the set of allowed methods on that data. It can contain
child nodes that are nested resources or fields.
The child resource types and methods allowed on them
are data-model specific.
</t>
<t>
A resource has its own media type identifier, represented
by the "Content‑Type" header in the HTTP response message.
A resource can contain zero or more nested resources.
A resource can be created and deleted independently of its
parent resource, as long as the parent resource exists.
</t>
<t>
All RESTCONF resources are defined in this document except
datastore contents, protocol operations, and notification events.
The syntax and semantics for these resource types are
defined with YANG statements.
</t>
<section title="RESTCONF Resource Types">
<t>
The RESTCONF protocol defines some application specific media types
to identify each of the available resource types. The following
table summarizes the purpose of each resource.
</t>
<?rfc compact="yes"?><texttable title="RESTCONF Media Types">
<ttcol align='left'> Resource</ttcol>
<ttcol align='left'>Media Type</ttcol>
<c>API</c>
<c>application/vnd.yang.api</c>
<c>Datastore</c>
<c>application/vnd.yang.datastore</c>
<c>Data</c>
<c>application/vnd.yang.data</c>
<c>Event</c>
<c>application/vnd.yang.event</c>
<c>Operation</c>
<c>application/vnd.yang.operation</c>
<c>Patch</c>
<c>application/vnd.yang.patch</c>
</texttable>
<?rfc compact="no"?> <t>
These resources are described in <xref target="resources"/>.
</t>
</section>
<section title="Resource Discovery" anchor="resource-discovery">
<t>
A client SHOULD start by retrieving the top-level
API resource, using the entry point URI "/restconf".
</t>
<t>
The RESTCONF protocol does not include a
resource discovery mechanism. Instead, the definitions
within the YANG modules advertised by the server
are used to construct a predictable operation or data
resource identifier.
</t>
<t>
The "depth" query parameter can be used to control how many
descendant levels should be included when retrieving
sub-resources. This parameter can be used with the GET method
to discover sub-resources within a particular resource.
</t>
<t>
Refer to <xref target="depth-param"/> for more details on the "depth" parameter.
</t>
</section>
</section>
<section title="Datastore Model">
<t>
A conceptual "unified datastore" is used to simplify resource
management for the client. The RESTCONF datastore is a
combination of the running configuration and any
non-configuration data supported by the device.
By default only configuration data is returned
by a GET method on the datastore contents.
</t>
<t>
The underlying NETCONF datastores can be used
to implement the unified datastore, but the server design
is not limited to the exact datastore procedures defined
in NETCONF.
</t>
<t>
The "candidate" and "startup" datastores are not visible
in the RESTCONF protocol. Transaction management and
configuration persistence are handled by the server
and not controlled by the client.
</t>
<section title="Content Model">
<t>
The RESTCONF protocol operates on a conceptual datastore defined with
the YANG data modeling language. The server lists each YANG
module it supports in the "/restconf/modules/module"
resource in the top-level API resource type, using a structure based on
the YANG module capability URI format defined in RFC 6020.
</t>
<t>
The conceptual datastore contents, data-model-specific
operations and notification events are identified by this set of
YANG module resources. All RESTCONF content identified
as either a data resource, operation resource, or event resource
is defined with the YANG language.
</t>
<t>
The classification of data as configuration or
non-configuration is derived from the YANG "config" statement.
Data retrieval with the GET method can be filtered
in several ways, including the "config" parameter
to retrieve configuration or non-configuration data.
</t>
<t>
Data ordering behavior is derived from the YANG "ordered‑by"
statement. The YANG Patch operation is provided to allow
list or leaf-list fields to be inserted or moved
in the same manner as NETCONF.
</t>
<t>
The server is not required to maintain system ordered data
in any particular persistent order. The server SHOULD
maintain the same data ordering for system ordered data
until the next reboot or termination of the server.
The server MUST maintain the same data ordering for user ordered data
until the next reboot or termination of the server.
</t>
</section>
<section title="Editing Model">
<t>
The RESTCONF datastore editing model is simple and direct,
similar to the behavior of the ":writable‑running"
capability in NETCONF.
</t>
<t>
Each RESTCONF edit of a datastore resource is
activated upon successful completion of the transaction.
It is an implementation-specific matter how the server
accomplishes a RESTCONF edit request. For example,
a server which only accepts edits through a candidate
datastore may internally edit this datastore and perform
the "commit" operation automatically.
</t>
<t>
Applications which need more control over the editing model
might consider using NETCONF instead of RESTCONF.
</t>
<section title="Edit Operation Discovery">
<t>
Sometimes a server does not implement every operation
for every resource. Sometimes data model requirements
cause a node to implement a subset of the edit operations.
For example, a server may not allow modification of a
particular configuration data node after the
parent resource has been created.
</t>
<t>
The OPTIONS method can be used to identify which
HTTP methods are supported by the server for a particular
resource. For example, if the server will allow a data resource
node to be created then the POST method will be
returned in the response.
</t>
</section>
<section title="Edit Collision Detection" anchor="edit-collision">
<t>
Two "edit collision detection" mechanisms are provided
in RESTCONF, for datastore and data resources.
</t>
<t>
<list style="symbols">
<t>
timestamp: the last change time is maintained and
the "Last‑Modified" and "Date" headers are returned in the
response for a retrieval request.
The "If‑Unmodified‑Since" header can be used
in edit operation requests to cause the server
to reject the request if the resource has been modified
since the specified timestamp.
</t>
<t>
entity tag: a unique opaque string is maintained and
the "ETag" header is returned in the
response for a retrieval request.
The "If‑Match" header can be used
in edit operation requests to cause the server
to reject the request if the resource entity tag
does not match the specified value.
</t>
</list>
</t>
<t>
Note that the server is only required to maintain these properties
for a datastore resource, not for individual data resources.
</t>
<t>
Example:
</t>
<t>
In this example, the server just supports the
mandatory datastore last-changed timestamp.
The client has previously retrieved the "Last‑Modified"
header and has some value cached to provide in
the following request to replace a list entry
with key value "11":
</t>
<figure>
<artwork><![CDATA[
PATCH /restconf/datastore/example-jukebox:jukebox/
library/artist/Foo%20Fighters/album/Wasting%20Light/year HTTP/1.1
Host: example.com
Accept: application/vnd.yang.data+json
If-Unmodified-Since: Mon, 23 Apr 2012 17:01:00 GMT
Content-Type: application/vnd.yang.data+json
{ "year" : "2011" }
]]></artwork>
</figure>
<t>
In this example the datastore resource has changed
since the time specified in the "If‑Unmodified‑Since"
header. The server might respond:
</t>
<figure>
<artwork><![CDATA[
HTTP/1.1 304 Not Modified
Date: Mon, 23 Apr 2012 19:01:00 GMT
Server: example-server
Last-Modified: Mon, 23 Apr 2012 17:45:00 GMT
ETag: b34aed893a4c
]]></artwork>
</figure>
</section>
</section>
<section title="Locking Model">
<t>
Datastore locking is not provided by RESTCONF.
An application that needs to make several changes
to the running configuration datastore
contents in sequence, without disturbance from other clients
might consider using the NETCONF protocol instead of RESTCONF.
</t>
</section>
<section title="Persistence Model" anchor="persistence-model">
<t>
Each RESTCONF edit of a datastore resource is
saved to non-volatile storage in an
implementation-specific matter by the server.
There is no guarantee that configuration changes
are saved immediately, or that the saved configuration
is always a mirror of the running configuration.
</t>
<t>
Applications which need more control over the persistence model
might consider using NETCONF instead of RESTCONF.
</t>
</section>
<section title="Defaults Model">
<t>
NETCONF has a rather complex defaults handling model for
leafs. RESTCONF attempts to avoid this complexity by
restricting the operations that can be applied to
a resource.
</t>
<t>
If the target of a GET method (plus "select" value) is a data node
that represents a leaf that has a default value,
and the leaf has not been given a value yet, the server MUST
return the default value that is in use by the server.
</t>
<t>
The GET method returns only descendant nodes that exist, which will
be determined by the server. There is no mechanism for
the client to ask the server for the default values
of nested resources that would be used for any nodes not present,
but some default value is in use by the server. (There is no
retrieval mode like "with‑defaults=report‑all" in NETCONF.)
</t>
<t>
Applications which need more control over the defaults model
might consider using NETCONF instead of RESTCONF.
</t>
</section>
</section>
<section title="Transaction Model" anchor="transaction-model">
<t>
The RESTCONF protocol provides an extensible transaction framework
that allows a simplified transaction model that uses plain
REST operations to edit one resource (and sub-resources)
at a time. It also provides YANG Patch, which is a standard
variant of the PATCH method. This allows a richer set of
edit operations that can be applied to multiple resources
at once.
</t>
<t>
RESTCONF does not provide a more complex transaction
model that allows for multiple edits to be stored in
a temporary scratchpad and committed all at once.
</t>
<t>
Applications which need more control over the transaction model
might consider using NETCONF instead of RESTCONF.
</t>
</section>
<section title="Extensibility Model">
<t>
The RESTCONF protocol is designed to be extensible for
datastore content and data-model specific protocol operations.
New protocol operations can be added without changing
the entry point if they are optional and do not alter
any existing operations.
</t>
<t>
Separate namespaces for each YANG module are used.
Content encoded in XML will indicate the module
using the "namespace" URI value in the YANG module.
Content encoded in JSON will indicate the module
using the module name specified in the YANG module,
but this is not required unless multiple sibling nodes
have the same YANG identifier name.
JSON encoding rules for module names are specified
in <xref target="I-D.lhotka-netmod-json"/>.
</t>
</section>
<section title="Versioning Model">
<t>
The version of a resource instance is identified with an entity tag,
as defined by HTTP.
The version identifiers in this section apply to the
version of the schema definition of a resource.
There are two types of schema versioning information used
in the RESTCONF protocol:
</t>
<t>
<list style="symbols">
<t>
the RESTCONF protocol version
</t>
<t>
data and operation resource definition versions
</t>
</list>
</t>
<t>
The protocol version is identified by the string used for the
well-known URI entry point "/restconf".
This would be changed (e.g., "/restconf2")
if non-backward compatible changes are ever needed.
Minor version changes that do not break
backward-compatibility will not cause the entry point to change.
</t>
<t>
The API "restconf/version" resource can be used by the client to
identify the exact version of the RESTCONF protocol implemented
by the server.
This value will include the complete RESTCONF protocol version.
The "/restconf/version" resource MUST be updated every time
the protocol specification is republished.
</t>
<t>
The resource definition version for a data or operation
resource is a date string,
which is the revision date of the YANG module that defines the
resource.
The resource version for all other resource types is a numeric
string, defined by the "/restconf/version" field.
</t>
</section>
<section title="Retrieval Filtering Model">
<t>
There are three types of filtering for retrieval of data resources
in the RESTCONF protocol.
</t>
<t>
<list style="symbols">
<t>
conditional all-or-nothing: use some conditional test
mechanism in the request headers and retrieve either a
complete "200 OK" response if the condition is met,
or a "304 Not Modified" Status-Line if the condition is not met.
</t>
<t>
data classification: request configuration or non-configuration
data.
</t>
<t>
filter: request a subset of all possible descendant nodes
within the target resource. The "select" query parameter can be used
for this purpose.
</t>
</list>
</t>
<t>
Refer to <xref target="data-retrieval"/> for details on data retrieval filtering.
</t>
</section>
<section title="Access Control Model">
<t>
The RESTCONF protocol provides no granular access control for any
content except for operation and data resources. The NETCONF
Access Control Model (NACM) is defined in <xref target="RFC6536"/>.
There is a specific mapping between RESTCONF operations
and NETCONF edit operations, defined in <xref target="table-crud-operations"/>.
The resource path also needs to be converted internally
by the server to the corresponding YANG instance-identifier.
Using this information, the server can apply the NACM
access control rules to RESTCONF messages.
</t>
<t>
The server MUST NOT allow any operation to any resources that
the client is not authorized to access.
</t>
</section>
</section>
<section title="Operations" anchor="operations">
<t>
The RESTCONF protocol uses HTTP methods to identify
the CRUD operation requested for a particular resource.
The following table
shows how the RESTCONF operations relate to NETCONF
protocol operations:
</t>
<?rfc compact="yes"?><texttable anchor="table-crud-operations" title="CRUD Methods in RESTCONF">
<ttcol align='left'> RESTCONF</ttcol>
<ttcol align='left'>NETCONF</ttcol>
<c>OPTIONS</c>
<c>none</c>
<c>HEAD</c>
<c>none</c>
<c>GET</c>
<c><get-config>, <get></c>
<c>POST</c>
<c><edit-config> (operation="create")</c>
<c>PUT</c>
<c><edit-config> (operation="replace")</c>
<c>PATCH</c>
<c><edit-config> (operation="merge")</c>
<c>DELETE</c>
<c><edit-config> (operation="delete")</c>
</texttable>
<?rfc compact="no"?> <t>
The NETCONF "remove" operation attribute is not supported
by the HTTP DELETE method. The resource must exist or
the DELETE method will fail.
</t>
<t>
This section defines the RESTCONF protocol usage for
each HTTP method.
</t>
<section title="OPTIONS" anchor="options">
<t>
The OPTIONS method is sent by the client to
discover which methods are supported by the server
for a specific resource.
It is supported for all media types.
Note that implementation
of this method is part of HTTP, and this section does
not introduce any additional requirements.
</t>
<t>
The request MUST contain a request URI
that contains at least the entry point component.
</t>
<t>
The server will return a "Status‑Line" header containing
"204 No Content".
and include the "Allow" header in the response.
This header will be filled in, based on the target resource
media type.
Other headers MAY also be included in the response.
</t>
<t>
Example 1:
</t>
<t>
A client might request the methods supported for a data
resource called "library":
</t>
<figure>
<artwork><![CDATA[
OPTIONS /restconf/datastore/example-jukebox:jukebox/
library/artist HTTP/1.1
Host: example.com
]]></artwork>
</figure>
<t>
The server might respond (for a config=true list):
</t>
<figure>
<artwork><![CDATA[
HTTP/1.1 204 No Content
Date: Mon, 23 Apr 2012 17:01:00 GMT
Server: example-server
Allow: OPTIONS,HEAD,GET,POST,PUT,PATCH,DELETE
]]></artwork>
</figure>
<t>
Example 2:
</t>
<t>
A client might request the methods supported for a
non-configuration "counters" resource within a "system" resource:
</t>
<figure>
<artwork><![CDATA[
OPTIONS /restconf/datastore/example-system:system/
counters HTTP/1.1
Host: example.com
]]></artwork>
</figure>
<t>
The server might respond:
</t>
<figure>
<artwork><![CDATA[
HTTP/1.1 204 No Content
Date: Mon, 23 Apr 2012 17:02:00 GMT
Server: example-server
Allow: OPTIONS,HEAD,GET
]]></artwork>
</figure>
<t>
Example 3:
</t>
<t>
A client might request the methods supported for an
operation resource called "play":
</t>
<figure>
<artwork><![CDATA[
OPTIONS /restconf/operations/example-jukebox:play HTTP/1.1
Host: example.com
]]></artwork>
</figure>
<t>
The server might respond:
</t>
<figure>
<artwork><![CDATA[
HTTP/1.1 204 No Content
Date: Mon, 23 Apr 2012 17:02:00 GMT
Server: example-server
Allow: POST
]]></artwork>
</figure>
</section>
<section title="HEAD" anchor="head">
<t>
The HEAD method is sent by the client to
retrieve just the headers that would be returned
for the comparable GET method, without the response body.
It is supported for all resource types, except operation resources.
</t>
<t>
The request MUST contain a request URI
that contains at least the entry point component.
</t>
<t>
The same query parameters supported by the GET method
are supported by the HEAD method. For example,
the "select" query parameter can be used to
specify a nested resource within the target resource.
</t>
<t>
The access control behavior is enforced
as if the method was GET instead of HEAD.
The server MUST respond the same as if the method
was GET instead of HEAD, except that no
response body is included.
</t>
<t>
Example:
</t>
<t>
The client might request the response headers for
JSON representation of the "library" resource:
</t>
<figure>
<artwork><![CDATA[
HEAD /restconf/datastore/example-jukebox:jukebox/
library HTTP/1.1
Host: example.com
Accept: application/vnd.yang.data+json
]]></artwork>
</figure>
<t>
The server might respond:
</t>
<figure>
<artwork><![CDATA[
HTTP/1.1 200 OK
Date: Mon, 23 Apr 2012 17:02:40 GMT
Server: example-server
Content-Type: application/vnd.yang.data+json
Cache-Control: no-cache
Pragma: no-cache
ETag: a74eefc993a2b
Last-Modified: Mon, 23 Apr 2012 11:02:14 GMT
]]></artwork>
</figure>
</section>
<section title="GET" anchor="get">
<t>
The GET method is sent by the client to
retrieve data and meta-data for a resource.
It is supported for all resource types, except operation resources.
The request MUST contain a request URI
that contains at least the entry point component.
</t>
<t>
The following query parameters are supported
by the GET method:
</t>
<?rfc compact="yes"?><texttable title="GET Query Parameters">
<ttcol align='left'> Name</ttcol>
<ttcol align='left'>Section</ttcol>
<ttcol align='left'>Description</ttcol>
<c>config</c>
<c><xref format="counter" target="config-param"/></c>
<c>Request either configuration or non-configuration data</c>
<c>depth</c>
<c><xref format="counter" target="depth-param"/></c>
<c>Control the depth of a retrieval request</c>
<c>format</c>
<c><xref format="counter" target="format-param"/></c>
<c>Request either JSON or XML content in the response</c>
<c>select</c>
<c><xref format="counter" target="select-param"/></c>
<c>Specify a nested resource within the target resource</c>
</texttable>
<?rfc compact="no"?> <t>
The server MUST NOT return any data resources for which the user
does not have read privileges.
</t>
<t>
If the user is not authorized to read any portion of
the target resource, an error response containing
a "403 Forbidden" Status-Line is returned to
the client.
</t>
<t>
If the user is authorized to read some but not all of
the target resource, the unauthorized content is omitted
from the response message body, and the authorized content
is returned to the client.
</t>
<t>
Example:
</t>
<t>
The client might request the response headers for a
JSON representation of the "library" resource:
</t>
<figure>
<artwork><![CDATA[
GET /restconf/datastore/example-jukebox:jukebox/
library/artist/Foo%20Fighters/album?format=json HTTP/1.1
Host: example.com
Accept: application/vnd.yang.api+json
]]></artwork>
</figure>
<t>
The server might respond:
</t>
<figure>
<artwork><![CDATA[
HTTP/1.1 200 OK
Date: Mon, 23 Apr 2012 17:02:40 GMT
Server: example-server
Content-Type: application/vnd.yang.data+json
Cache-Control: no-cache
Pragma: no-cache
ETag: a74eefc993a2b
Last-Modified: Mon, 23 Apr 2012 11:02:14 GMT
{
"album" : {
"name" : "Wasting Light",
"genre" : "example-jukebox:alternative",
"year" : 2011
}
}
]]></artwork>
</figure>
</section>
<section title="POST" anchor="post">
<t>
The POST method is sent by the client for various
reasons. The server uses the target resource media type
to determine how to process the request.
</t>
<t>
The request MUST contain a request URI
that contains a target resource which
identifies one of the following resource types:
</t>
<?rfc compact="yes"?><texttable title="Resource Types that Support POST">
<ttcol align='left'> Type</ttcol>
<ttcol align='left'>Description</ttcol>
<c>Datastore</c>
<c>Create a top-level configuration data resource</c>
<c>Data</c>
<c>Create a configuration data sub-resource</c>
<c>Operation</c>
<c>Invoke protocol operation</c>
</texttable>
<?rfc compact="no"?><section title="Create Resource Mode">
<t>
If the target resource type is a Datastore or Data resource,
then the POST is treated as a request to create a resource or
sub-resource.
</t>
<t>
The following query parameters are supported
by the POST method for Datastore and Data resource types.
They can only be used for YANG list data nodes
which are ordered by the user.
</t>
<?rfc compact="yes"?><texttable title="POST Query Parameters">
<ttcol align='left'> Name</ttcol>
<ttcol align='left'>Section</ttcol>
<ttcol align='left'>Description</ttcol>
<c>insert</c>
<c><xref format="counter" target="insert-param"/></c>
<c>Specify where to insert a resource</c>
<c>point</c>
<c><xref format="counter" target="point-param"/></c>
<c>Specify the insert point for a resource</c>
</texttable>
<?rfc compact="no"?> <t>
If the POST method succeeds,
a "204 No Content" Status-Line is returned and there is
no response message body.
</t>
<t>
If the user is not authorized to create the target resource,
an error response containing
a "403 Forbidden" Status-Line is returned to
the client. All other error responses are handled according to
the procedures defined in <xref target="error-reporting"/>.
</t>
</section>
<section title="Invoke Operation Mode">
<t>
If the target resource type is an Operation resource,
then the POST method is treated as a request to invoke that operation.
The message body (if any) is processed as the operation input
parameters. Refer to <xref target="operation-resource"/> for details
on Operation resources.
</t>
<t>
If the POST method succeeds, a "200 OK" Status-Line
is returned if there is a response message body, and
a "204 No Content" Status-Line is returned if there is
no response message body.
</t>
<t>
If the user is not authorized to invoke the target operation,
an error response containing
a "403 Forbidden" Status-Line is returned to
the client. All other error responses are handled according to
the procedures defined in <xref target="error-reporting"/>.
</t>
</section>
</section>
<section title="PUT" anchor="put">
<t>
The PUT method is sent by the client to replace
the target resource.
</t>
<t>
The request MUST contain a request URI
that contains a target resource that
identifies the data resource to replace.
</t>
<t>
If the PUT method succeeds, a "200 OK" Status-Line
is returned, and there is no response message body.
</t>
<t>
If the user is not authorized to replace the target resource
an error response containing
a "403 Forbidden" Status-Line is returned to
the client. All other error responses are handled according to
the procedures defined in <xref target="error-reporting"/>.
</t>
</section>
<section title="PATCH" anchor="patch">
<t>
The PATCH method uses the HTTP PATCH method defined
in <xref target="RFC5789"/> to provide an extensible framework for
resource patching mechanisms. Each patch type needs a unique
media type. Any number of patch types can be supported
by the server. There are two mandatory patch types that
MUST be implemented by the server:
</t>
<t>
<list style="symbols">
<t>
plain patch type: If the specified media type
is "application/vnd.yang.data", then the PATCH method is a simple
merge operation on the target resource. The message body contains
the XML or JSON encoded resource content that will be merged
with the target resource.
</t>
<t>
YANG Patch type: If the specified media type
is "application/vnd.yang.patch", then the PATCH method is a
YANG Patch formatted list of edits (see <xref target="yang-patch"/>).
The message body
contains the XML or JSON encoded instance of the 'patch' container
specified in the 'ietf‑restconf' YANG module (see <xref target="module"/>).
</t>
</list>
</t>
<t>
The PATCH method MUST be used to create or delete an optional
field within an existing resource or sub-resource.
</t>
<t>
If the PATCH method succeeds, a "200 OK" Status-Line
is returned, and there is no response message body.
</t>
<t>
If the user is not authorized to alter the target resource
an error response containing
a "403 Forbidden" Status-Line is returned to
the client. All other error responses are handled according to
the procedures defined in <xref target="error-reporting"/>.
</t>
</section>
<section title="DELETE" anchor="delete">
<t>
The DELETE method is used to delete the target resource.
</t>
<t>
If the DELETE method succeeds, a "200 OK" Status-Line
is returned, and there is no response message body.
</t>
<t>
If the user is not authorized to delete the target resource then
an error response containing
a "403 Forbidden" Status-Line is returned to
the client. All other error responses are handled according to
the procedures defined in <xref target="error-reporting"/>.
</t>
</section>
<section title="Query Parameters" anchor="query-parameters">
<t>
Each RESTCONF operation allows zero or more query
parameters to be present in the request URI.
Refer to <xref target="operations"/>
for details on the query parameters used
in the definition of each operation.
</t>
<t>
Query parameters can be given in any order.
Each parameter can appear zero or one time.
A default value may apply if the parameter is missing.
</t>
<t>
This section defines all the RESTCONF query parameters.
</t>
<section title=""config" Parameter" anchor="config-param">
<t>
The "config" parameter is used to specify whether
configuration or non-configuration data is requested.
</t>
<t>
This parameter is only supported for the GET and HEAD methods.
It is also only supported if the target resource is a data resource.
</t>
<figure>
<artwork><![CDATA[
syntax: config= true | false
default: true
]]></artwork>
</figure>
<t>
Example:
</t>
<t>
This example request by the client
would retrieve only the non-configuration data nodes
that exist within the "library" resource.
</t>
<figure>
<artwork><![CDATA[
GET /restconf/datastore/example-jukebox:jukebox/
library?config=false HTTP/1.1
Host: example.com
Accept: application/vnd.yang.data+json
]]></artwork>
</figure>
<t>
The server might respond:
</t>
<figure>
<artwork><![CDATA[
HTTP/1.1 200 OK
Date: Mon, 23 Apr 2012 17:01:30 GMT
Server: example-server
Cache-Control: no-cache
Pragma: no-cache
Content-Type: application/vnd.yang.data+json
{
"library" : {
"artist-count" : 42,
"album-count" : 59,
"song-count" : 374
}
}
]]></artwork>
</figure>
</section>
<section title=""depth" Parameter" anchor="depth-param">
<t>
The "depth" parameter is used to specify the number
of nest levels returned in a response for a GET method.
A nest-level consists of the target resource and any
child nodes which are contained within the target resource node.
</t>
<t>
The start level is determined by the target resource
for the operation.
</t>
<figure>
<artwork><![CDATA[
syntax: depth=<range: 1..max> | unbounded
default: unbounded
]]></artwork>
</figure>
<t>
Example:
</t>
<t>
This example operation would retrieve 2 levels of configuration
data nodes that exist within the top-level "jukebox" resource.
</t>
<figure>
<artwork><![CDATA[
GET /restconf/datastore/example-jukebox:jukebox
?depth=2 HTTP/1.1
Host: example.com
Accept: application/vnd.yang.data+json
]]></artwork>
</figure>
<t>
The server might respond:
</t>
<figure>
<artwork><![CDATA[
HTTP/1.1 200 OK
Date: Mon, 23 Apr 2012 17:11:30 GMT
Server: example-server
Cache-Control: no-cache
Pragma: no-cache
Content-Type: application/vnd.yang.data+json
{
"jukebox" : {
"library" : {
"artist" : {
"name" : "Foo Fighters"
}
},
"player" : {
"gap" : 0.5
}
}
}
]]></artwork>
</figure>
<t>
By default, the server will include all sub-trees within
a retrieved resource, which is the same resource type.
Only only level of sub-resources with a different
media type than the target resource will be returned.
</t>
<t>
For example, if the client retrieves the "application/vnd.yang.api"
resource type,
then the node for the datastore resource is returned
as an empty node, because all its child nodes are data resources.
The entire contents of the datastore are not returned in this case.
The operation resources also are returned as empty nodes
(e.g. "play" operation).
</t>
<t>
Request URL:
</t>
<figure>
<artwork><![CDATA[
GET /restconf HTTP/1.1
]]></artwork>
</figure>
<t>
Response:
</t>
<figure>
<artwork><![CDATA[
{
"restconf": {
"datastore" : [ null ],
"modules": {
"module": [
{
"name" : "example-jukebox",
"revision" : "2013-09-04",
"namespace" : "example.com"
}
]
},
"operations" : {
"play" : [ null ]
},
"version": "1.0"
}
}
]]></artwork>
</figure>
</section>
<section title=""format" Parameter" anchor="format-param">
<t>
The "format" parameter is used to specify the format
of any content returned in the response. Note that
this parameter MAY be used instead of the "Accept" header
to identify the format desired in the response.
</t>
<t>
The "format" parameter is only supported for the GET and
HEAD methods. It is supported for all RESTCONF media types.
</t>
<figure>
<artwork><![CDATA[
syntax: format= xml | json
default: Accept header, then xml
]]></artwork>
</figure>
<t>
If the "format" parameter is present, then it overrides
the Accept header, if present. If neither the Accept
header or the "format" parameter are present, then the
default is XML.
</t>
<t>
Examples:
</t>
<figure>
<artwork><![CDATA[
GET /restconf/datastore/example-routing:routing HTTP/1.1
Host: example.com
Accept: application/vnd.yang.data+json
]]></artwork>
</figure>
<t>
This example request would retrieve only the configuration data nodes
that exist within the top-level "routing" resource, and retrieve
them in JSON encoding.
</t>
<figure>
<artwork><![CDATA[
GET /restconf/datastore/example-routing:routing
?format=json HTTP/1.1
Host: example.com
]]></artwork>
</figure>
<t>
This example request would retrieve only the configuration data nodes
that exist within the top-level "routing" resource, and retrieve
them in JSON encoding.
</t>
</section>
<section title=""insert" Parameter" anchor="insert-param">
<t>
The "insert" parameter is used to specify how a
resource should be inserted within a user-ordered list.
</t>
<t>
This parameter is only supported for the POST method.
It is also only supported if the target resource is
a data resource, and that data represents
a YANG list that is ordered by the user, not the system.
</t>
<t>
If the values "before" or "after" are used, then a "point"
parameter for the insertion parameter MUST also be present.
</t>
<figure>
<artwork><![CDATA[
syntax: insert= first | last | before | after
default: last
]]></artwork>
</figure>
<t>
Example:
</t>
<figure>
<artwork><![CDATA[
Request from client:
PATCH /restconf/datastore/example-jukebox:jukebox/
playlist/Foo-One?insert=first HTTP/1.1
Host: example.com
Content-Type: application/vnd.yang.data+json
{
"song" : {
"index" : 1,
"id" : "/example-jukebox:jukebox/library/artist/
Foo%20Fighters/album/Wasting%20Light/song/Rope"
}
}
Response from server:
HTTP/1.1 201 Created
Date: Mon, 23 Apr 2012 13:01:20 GMT
Server: example-server
Last-Modified: Mon, 23 Apr 2012 13:01:20 GMT
Location: http://example.com/restconf/datastore/
example-jukebox:jukebox/playlist/Foo-One/song/1
ETag: eeeada438af
]]></artwork>
</figure>
</section>
<section title=""point" Parameter" anchor="point-param">
<t>
The "point" parameter is used to specify the insertion point
for a data resource that is being created or moved within
a user ordered list. It is ignored unless the "insert"
query parameter is also present, and has the value "before" or "after".
</t>
<t>
This parameter contains the instance identifier of the
resource to be used as the
insertion point for a POST method. It is
encoded according to the rules defined in <xref target="uri-encoding"/>.
There is no default for this parameter.
</t>
<figure>
<artwork><![CDATA[
syntax: point= <instance-identifier of insertion point node>
]]></artwork>
</figure>
<t>
Example:
</t>
<t>
In this example, the client is inserting a new "song" resource
within an "album" resource after another song.
The request URI is split for display purposes only.
</t>
<figure>
<artwork><![CDATA[
Request from client:
POST /restconf/datastore/example-jukebox:jukebox/
library/artist/Foo%20Fighters/album/Wasting%20Light?insert=after
&point=/restconf/datastore/example-jukebox:jukebox/
library/artist/Foo%20Fighters/album/Wasting%20Light/song/
Bridge%20Burning HTTP/1.1
Host: example.com
Content-Type: application/vnd.yang.data+json
{
"song" : {
"name" : "Rope",
"location" : "/media/rope.mp3",
"format" : "MP3",
"length" : 259
}
}
Response from server:
HTTP/1.1 204 No Content
Date: Mon, 23 Apr 2012 13:01:20 GMT
Server: example-server
Last-Modified: Mon, 23 Apr 2012 13:01:20 GMT
ETag: abcada438af
]]></artwork>
</figure>
</section>
<section title=""select" Parameter" anchor="select-param">
<t>
The "select" query parameter is used to specify an
expression which can represent a subset of all data nodes
within the target resource. It contains a relative
path expression, using the target resource as the context node.
</t>
<t>
It is supported for all resource types except operation resources.
The contents are encoded according to the "api‑select"
rule defined in <xref target="uri-encoding"/>. This parameter is only allowed
for GET and HEAD methods.
</t>
<t>
[FIXME: the syntax of the select string is still TBD;
XPath, schema-identifier, regular expressions, something else;
Perhaps add parameter "xselect" for XPath and this param
is limited to a path-expr.]
</t>
<t>
In this example the client is retrieving the API version
field from the server in JSON format:
</t>
<figure>
<artwork><![CDATA[
GET /restconf?select=version&format=json HTTP/1.1
Host: example.com
Accept: application/vnd.yang.api+json
]]></artwork>
</figure>
<t>
The server might respond as follows.
</t>
<figure>
<artwork><![CDATA[
HTTP/1.1 200 OK
Date: Mon, 23 Apr 2012 17:01:00 GMT
Server: example-server
Cache-Control: no-cache
Pragma: no-cache
Last-Modified: Sun, 22 Apr 2012 01:00:14 GMT
Content-Type: application/vnd.yang.api+json
{ "version": "1.0" }
]]></artwork>
</figure>
</section>
</section>
<section title="Protocol Operations" anchor="protocol-ops">
<t>
The RESTCONF protocol allows data-model specific protocol operations
to be invoked using the POST method. The media type
"application/vnd.yang.operation+xml" or "application/vnd.yang.operation+json"
MUST be used in the "Content‑Type" line in the message header.
</t>
<t>
Data model specific operations are supported.
The syntax and semantics of these operations
exactly correspond to the YANG "rpc" statement definition
for the operation.
</t>
<t>
Refer to <xref target="operation-resource"/> for details on operation resources.
</t>
</section>
</section>
<section title="Messages" anchor="messages">
<t>
This section describes the messages that are used in the RESTCONF
protocol.
</t>
<section title="Request URI Structure">
<t>
Resources are represented with URIs following the structure
for generic URIs in <xref target="RFC3986"/>.
</t>
<t>
A RESTCONF operation is derived from the HTTP method
and the request URI, using the following conceptual fields:
</t>
<figure>
<artwork><![CDATA[
<OP> /restconf/<path>?<query>#<fragment>
]]></artwork>
</figure>
<figure>
<artwork><![CDATA[
^ ^ ^ ^ ^
| | | | |
method entry resource query fragment
M M O O I
M=mandatory, O=optional, I=ignored
]]></artwork>
</figure>
<figure>
<artwork><![CDATA[
<text> replaced by client with real values
]]></artwork>
</figure>
<t>
<list style="symbols">
<t>
method: the HTTP method identifying the RESTCONF operation
requested by the client, to act upon the target resource
specified in the request URI. RESTCONF operation details are
described in <xref target="operations"/>.
</t>
<t>
entry: the well-known RESTCONF entry point ("/restconf").
</t>
<t>
resource: the path expression identifying the resource
that is being accessed by the operation.
If this field is not present, then the target resource
is the API itself, represented by the media type "application/vnd.yang.api".
</t>
<t>
query: the set of parameters associated with the RESTCONF
message. These have the familiar form of "name=value" pairs.
There is a specific set of parameters defined,
although the server MAY choose to support additional
parameters not defined in this document.
</t>
<t>
fragment: This field is not used by the RESTCONF protocol.
</t>
</list>
</t>
<t>
The client SHOULD NOT assume the final structure of
a URI path for a resource. Instead, existing resources can
be discovered with the GET method. When new resources
are created by the client, a "Location" header
is returned, which identifies the path of the newly created resource.
The client MUST use this exact path identifier to access
the resource once it has been created.
</t>
<t>
The "target" of an operation is a resource.
The "path" field in the request URI represents
the target resource for the operation.
</t>
</section>
<section title="Message Headers">
<t>
There are several HTTP header lines utilized in RESTCONF messages.
Messages are not limited to the HTTP headers listed in this section.
</t>
<t>
HTTP defines which header lines are required for particular
circumstances. Refer to each operation definition section
in <xref target="operations"/> for examples on how particular headers are used.
</t>
<t>
There are some request headers that are used within RESTCONF,
usually applied to data resources.
The following tables summarize the headers most relevant
in RESTCONF message requests:
</t>
<?rfc compact="yes"?><texttable title="RESTCONF Request Headers">
<ttcol align='left'> Name</ttcol>
<ttcol align='left'>Description</ttcol>
<c>Accept</c>
<c>Response Content-Types that are acceptable</c>
<c>Content-Type</c>
<c>The media type of the request body</c>
<c>Host</c>
<c>The host address of the server</c>
<c>If-Match</c>
<c>Only perform the action if the entity matches ETag</c>
<c>If-Modified-Since</c>
<c>Only perform the action if modified since time</c>
<c>If-Unmodified-Since</c>
<c>Only perform the action if un-modified since time</c>
</texttable>
<?rfc compact="no"?> <t>
The following tables summarize the headers most relevant
in RESTCONF message responses:
</t>
<?rfc compact="yes"?><texttable title="RESTCONF Response Headers">
<ttcol align='left'> Name</ttcol>
<ttcol align='left'>Description</ttcol>
<c>Allow</c>
<c>Valid actions when 405 error returned</c>
<c>Content-Type</c>
<c>The media type of the response body</c>
<c>Date</c>
<c>The date and time the message was sent</c>
<c>ETag</c>
<c>An identifier for a specific version of a resource</c>
<c>Last-Modified</c>
<c>The last modified date and time of a resource</c>
<c>Location</c>
<c>The resource identifier for a newly created resource</c>
</texttable>
<?rfc compact="no"?></section>
<section title="Message Encoding">
<t>
RESTCONF messages are encoded in HTTP according to RFC 2616.
The "utf‑8" character set is used for all messages.
RESTCONF message content is sent in the HTTP message body.
</t>
<t>
Content is encoded in either JSON or XML format.
</t>
<t>
XML encoding rules for data nodes are defined in <xref target="RFC6020"/>.
The same encoding rules are used for all XML content.
</t>
<t>
JSON encoding rules are defined in <xref target="I-D.lhotka-netmod-json"/>.
Plain JSON cannot be used because special encoding rules
are needed to handle multiple
module namespaces and provide consistent data type processing.
</t>
<t>
Request input content encoding format is identified with the Content-Type
header. This field MUST be present if a message body is sent
by the client.
</t>
<t>
Response output content encoding format is identified with the Accept
header, the "format" query parameter, or if
neither is specified, the request input encoding format is used.
If there was no request input, then the default output encoding is XML.
File extensions encoded in the request are not used to identify
format encoding.
</t>
</section>
<section title="RESTCONF Meta-Data">
<t>
The RESTCONF protocol needs to retrieve the same meta-data that is
used in the NETCONF protocol. Information about default leafs,
last-modified timestamps, etc. are commonly used to annotate
representations of the datastore contents. This meta-data
is not defined in the YANG schema because it applies to the
datastore, and is common across all data nodes.
</t>
<t>
This information is encoded as attributes in XML, but JSON
does not have a standard way of attaching non-schema defined
meta-data to a resource or field.
</t>
<section title="JSON Encoding of RESTCONF Meta-Data">
<t>
The YANG to JSON mapping <xref target="I-D.lhotka-netmod-json"/> does not support
attributes because YANG does not support meta-data in data node
definitions. This section specifies how RESTCONF meta-data is
encoded in JSON.
</t>
<t>
Only simple meta-data is supported:
</t>
<t>
<list style="symbols">
<t>
A meta-data instance can appear 0 or 1 times for a particular
data node
</t>
<t>
A meta-data instance associated with a resource is
encoded as if it were a YANG leaf of type "string",
according to the encoding rules in <xref target="I-D.lhotka-netmod-json"/>,
except the identifier is prepended with a "@" (%40) character.
</t>
<t>
A meta-data instance associated with a field within a resource is
encoded as if it were a container for the meta-data values
and the field value in its native encoding. It is encoded
according to the rules in <xref target="I-D.lhotka-netmod-json"/>,
except the meta-data identifiers are prepended with a "@" (%40) character.
The field name/value pair is repeated inside this container,
which contains the actual value of the field.
</t>
</list>
</t>
<t>
Examples:
</t>
<figure>
<artwork><![CDATA[
Meta-data:
enabled=<boolean>
owner=<owner-name>
YANG example:
container top {
leaf A {
type int32;
}
leaf B {
type boolean;
}
}
]]></artwork>
</figure>
<t>
The client is retrieving the "top" data resource, and the server
is including datastore meta-data. Note that a query parameter to request
or suppress specific meta-data is not provided in RESTCONF.
</t>
<figure>
<artwork><![CDATA[
GET /restconf/datastore/example:top HTTP/1.1
Host: example.com
Accept: application/vnd.yang.api+json
]]></artwork>
</figure>
<t>
The server might respond as follows:
</t>
<figure>
<artwork><![CDATA[
HTTP/1.1 200 OK
Date: Mon, 23 Apr 2012 17:01:00 GMT
Server: example-server
Content-Type: application/vnd.yang.api+json
{
"top": {
"@enabled" : "true",
"@owner" : "fred",
"A" : {
"@enabled" : "true",
"A" : 42
},
"B" : {
"@enabled" : "false",
"B" : true
}
}
}
]]></artwork>
</figure>
</section>
</section>
<section title="Return Status">
<t>
Each message represents some sort of resource access.
An HTTP "Status‑Line" header line is returned for each request.
If a 4xx or 5xx range status code is returned in the Status-Line,
then the error information will be returned in the response,
according to the format defined in <xref target="errors"/>.
</t>
</section>
<section title="Message Caching">
<t>
Since the datastore contents change at unpredictable times,
responses from a RESTCONF server generally SHOULD NOT be cached.
</t>
<t>
The server SHOULD include a "Cache‑Control" header in every response
that specifies whether the response should be cached.
A "Pragma" header specifying "no‑cache" MAY also be sent
in case the "Cache‑Control" header is not supported.
</t>
<t>
Instead of using HTTP caching, the client SHOULD track the "ETag"
and/or "Last‑Modified" headers returned by the server for the
datastore resource (or data resource if the server supports it).
A retrieval request for a resource can include headers
such as "If‑None‑Match" or "If‑Modified‑Since" which
will cause the server to return a "304 Not Modified" Status-Line
if the resource has not changed.
The client MAY use the HEAD method to retrieve just
the message headers, which SHOULD include the "ETag"
and "Last‑Modified" headers, if this meta-data is maintained
for the target resource.
</t>
</section>
</section>
<section title="Resources" anchor="resources">
<t>
The resources used in the RESTCONF protocol are identified
by the "path" component in the request URI. Each operation
is performed on a target resource.
</t>
<section title="API Resource (/restconf) ">
<t>
The API resource contains the state and access points for
the RESTCONF features.
It is the top-level resource and has the media type
"application/vnd.yang.api+xml" or "application/vnd.yang.api+json".
It is accessible through the well-known relative
URI "/restconf".
</t>
<t>
The "restconf" container definition in the "ietf‑restconf" module
defined in <xref target="module"/> is used to specify the structure and syntax
of the conceptual fields and sub-resources within the API resource.
</t>
<t>
The "restconf" entry point container, and all fields and
sub-resources with the same resource type, are defined
in the namespace of the "ietf‑restconf" module.
</t>
<t>
There is one mandatory field "version" that
identifies the specific version of the RESTCONF protocol
implemented by the server:
</t>
<t>
<list style="symbols">
<t>
The same server-wide response MUST be returned
each time this field is retrieved.
</t>
<t>
It is assigned by the server when the server is started.
</t>
<t>
The server MUST return the value "1.0" for this
version of the RESTCONF protocol.
</t>
<t>
This field is encoded with the rules for an "enumeration" data type,
using the "version" leaf definition in <xref target="module"/>.
</t>
</list>
</t>
<t>
This resource has the following child resources:
</t>
<?rfc compact="yes"?><texttable title="RESTCONF Resources">
<ttcol align='left'> Child Resource</ttcol>
<ttcol align='left'>Description</ttcol>
<c>datastore</c>
<c>Link to "datastore" resource</c>
<c>modules</c>
<c>YANG module capability URIs</c>
<c>operations</c>
<c>Data-model specific operations</c>
</texttable>
<?rfc compact="no"?><section title="/restconf/datastore">
<t>
This mandatory resource represents the running configuration
datastore and any non-configuration data available.
It may be retrieved and edited directly.
It cannot be created or deleted by the client.
This resource type is defined in <xref target="datastore-resource"/>.
</t>
</section>
<section title="/restconf/modules">
<t>
This mandatory resource contains the identifiers
for the YANG data model modules supported by the server.
</t>
<t>
The server MUST maintain a last-modified timestamp for this
resource, and return the "Last‑Modified" header when this
resource is retrieved with the GET or HEAD methods.
</t>
<t>
The server SHOULD maintain an entity-tag for this
resource, and return the "ETag" header when this
resource is retrieved with the GET or HEAD methods.
</t>
<section title="/restconf/modules/module">
<t>
This mandatory resource contains one URI string
for each YANG data model module supported by the server.
There MUST be an instance of this resource for every
YANG module that is accessible via an operation resource
or a data resource.
</t>
<t>
The contents of the "module" resource are defined in
the "module" YANG list statement in <xref target="module"/>.
</t>
<t>
The server MAY maintain a last-modified timestamp for
each instance of this resource, and return the
"Last‑Modified" header when this resource is retrieved
with the GET or HEAD methods. If not supported
then the timestamp for the parent "modules" resource
MAY be used instead.
</t>
<t>
The server MAY maintain an entity-tag for each instance
of this resource, and return the "ETag" header when this
resource is retrieved with the GET or HEAD methods.
If not supported then the timestamp for the
parent "modules" resource MAY be used instead.
</t>
<t>
There are additional encoding requirements for this resource.
The URI MUST follow the YANG module capability URI formatting
defined in section 5.6.4 of <xref target="RFC6020"/>.
</t>
</section>
<section title="Retrieval Example">
<t>
In this example the client is retrieving the modules
resource from the server in JSON format:
</t>
<figure>
<artwork><![CDATA[
GET /restconf/modules&format=json HTTP/1.1
Host: example.com
Accept: application/vnd.yang.api+json
]]></artwork>
</figure>
<t>
The server might respond as follows.
</t>
<figure>
<artwork><![CDATA[
HTTP/1.1 200 OK
Date: Mon, 23 Apr 2012 17:01:00 GMT
Server: example-server
Cache-Control: no-cache
Pragma: no-cache
Last-Modified: Sun, 22 Apr 2012 01:00:14 GMT
Content-Type: application/vnd.yang.api+json
{
"modules": {
"module": [
{
"name" : "foo",
"revision" : "2012-01-02",
"namespace" : "http://example.com/ns/foo",
"feature" : [ "feature1", "feature2" ]
},
{
"name" : "foo-types",
"revision" : "2012-01-05",
"namespace" : "http://example.com/ns/foo-types"
},
{
"name" : "bar",
"revision" : "2012-11-05",
"namespace" : "http://example.com/ns/bar",
"feature" : [ "bar-ext" ]
}
]
}
}
]]></artwork>
</figure>
</section>
</section>
<section title="/restconf/operations ">
<t>
This optional resource provides access to the
data-model specific protocol operations supported by the server.
The server MAY omit this resource if no data-model specific
operations are advertised.
</t>
<t>
Any data-model specific operations defined in the YANG
modules advertised by the server MAY be available
as child nodes of this resource.
</t>
</section>
</section>
<section title="Datastore Resource" anchor="datastore-resource">
<t>
A datastore resource represents the conceptual root
of a tree of data resources.
</t>
<t>
The server MUST maintain a last-modified timestamp for this
resource, and return the "Last‑Modified" header when this
resource is retrieved with the GET or HEAD methods.
Only changes to configuration data resources within
the datastore affect this timestamp.
</t>
<t>
The server SHOULD maintain a resource entity tag for this
resource, and return the "ETag" header when this
resource is retrieved with the GET or HEAD methods.
The resource entity tag SHOULD be changed to a new
previously unused value if changes to any configuration
data resources within the datastore are made.
</t>
<t>
A datastore resource can be retrieved with the GET method,
to retrieve either configuration data resources or non-configuration
data resources within the datastore. The "config" query
parameter is used to choose between them.
Refer to <xref target="config-param"/> for more details.
</t>
<t>
The depth of the subtrees returned in retrieval operations
can be controlled with the "depth" query parameter.
The number of nest levels, starting at the target resource,
can be specified, or an unlimited number can be returned.
Refer to <xref target="depth-param"/> for more details.
</t>
<t>
[FIXME: not clear if top-level YANG data nodes MUST be
containers or lists.
</t>
<t>
A datastore resource can only be written directly with
the PATCH method. Only the configuration data resources
within the datastore resource can be edited directly with
all methods.]
</t>
</section>
<section title="Data Resource" anchor="data-resource">
<t>
A data resource represents a YANG data node that is a descendant
node of a datastore resource. Only YANG container and list data node
types are considered to represent data resources. Other YANG data nodes
are considered to be fields within their parent resource.
</t>
<t>
For configuration data resources,
the server MAY maintain a last-modified timestamp for the
resource, and return the "Last‑Modified" header when it
is retrieved with the GET or HEAD methods.
</t>
<t>
For configuration data resources,
the server MAY maintain a resource entity tag for the
resource, and return the "ETag" header when it
is retrieved as the target resource with the GET or HEAD methods.
The resource entity tag SHOULD be changed to a new
previously unused value if changes to the resource
or any configuration resource within the resource is altered.
</t>
<t>
A data resource can be retrieved with the GET method,
to retrieve either configuration data resources or non-configuration
data resources within the target resource. The "config" query
parameter is used to choose between them.
Refer to <xref target="config-param"/> for more details.
</t>
<t>
The depth of the subtrees returned in retrieval operations
can be controlled with the "depth" query parameter.
The number of nest levels, starting at the target resource,
can be specified, or an unlimited number can be returned.
Refer to <xref target="depth-param"/> for more details.
</t>
<t>
A configuration data resource can be altered by the client
with some of all of the edit operations, depending on the
target resource and the specific operation. Refer to <xref target="operations"/>
for more details on edit operations.
</t>
<section title="Encoding YANG Instance Identifiers in the Request URI" anchor="uri-encoding">
<t>
In YANG, data nodes are named with an absolute
XPath expression, from the document root to the target resource.
In RESTCONF, URL friendly path expressions are used instead.
</t>
<t>
The YANG "instance‑identifier" (i-i) data type is represented
in RESTCONF with the path expression format defined
in this section.
</t>
<?rfc compact="yes"?><texttable title="RESTCONF instance-identifier Type Conversion">
<ttcol align='left'> Name</ttcol>
<ttcol align='left'>Comments</ttcol>
<c>point</c>
<c>Insertion point is always a full i-i</c>
<c>path</c>
<c>Request URI path is a full or partial i-i</c>
</texttable>
<?rfc compact="no"?> <t>
The "path" component of the request URI contains the
absolute path expression that identifies the
target resource. The "select" query parameter is
used to optionally identify the requested data nodes
within the target resource to be retrieved in a GET method.
</t>
<t>
A predictable location for a data resource
is important, since applications will code to the YANG
data model module, which uses static naming and defines an
absolute path location for all data nodes.
</t>
<t>
A RESTCONF data resource identifier is not an XPath expression.
It is encoded from left to right, starting with the top-level
data node, according to the "api‑path" rule in <xref target="path-abnf"/>.
The node name of each ancestor of the target resource node
is encoded in order, ending with the node name for the
target resource.
</t>
<t>
If the "select" is present, it is encoded,
starting with a child node of the target resource,
according to the "api‑select" rule defined in <xref target="path-abnf"/>.
</t>
<t>
If a data node in the path expression is a YANG list node,
then the key values for the list (if any) are encoded
according to the "key‑value" rule. If the list node
is the target resource, then the key values MAY be omitted,
according to the operation. For example, the POST
method to create a new data resource for a list node
does not allow the key values to be present in the request URI.
</t>
<t>
The key leaf values for a data resource representing a YANG list
MUST be encoded as follows:
</t>
<t>
<list style="symbols">
<t>
The value of each leaf identified in the "key" statement
is encoded in order.
</t>
<t>
All the components in the "key" statement MUST be encoded.
Partial instance identifiers are not supported.
</t>
<t>
Each value is encoded using the "key‑value" rule in <xref target="path-abnf"/>,
according to the encoding rules for the data type of the key leaf.
</t>
<t>
An empty string can be a valid key value
(e.g., "/top/list/key1//key3").
</t>
<t>
The "/" character MUST be URL-encoded (i.e., "%2F").
</t>
<t>
All whitespace MUST be URL-encoded.
</t>
<t>
A "null" value is not allowed since the "empty" data type is
not allowed for key leafs.
</t>
<t>
The XML encoding is defined in <xref target="RFC6020"/>.
</t>
<t>
The JSON encoding is defined in <xref target="I-D.lhotka-netmod-json"/>.
</t>
<t>
The entire "key‑value" MUST be properly URL-encoded,
according to the rules defined in <xref target="RFC3986"/>.
</t>
<t>
resource URI values returned in Location headers
for data resources SHOULD identify the module name, even
if there are no conflicting local names when the resource
is created. This insures the correct resource will be identified
even if the server loads a new module that the old client
does not know about.
</t>
</list>
</t>
<t>
Examples:
</t>
<figure>
<artwork><![CDATA[
[ lines wrapped for display purposes only ]
/restconf/datastore/example-jukebox:jukebox/library/
artist/Beatles&select=album
/restconf/datastore/example-list:newlist/
17&select=nextlist/22/44/acme-list-ext:ext-leaf
/restconf/datastore/example-list:somelist/
fred%20and%20wilma
/restconf/datastore/example-list:somelist/
fred%20and%20wilma/address
]]></artwork>
</figure>
<section title="ABNF For Data Resource Identifiers" anchor="path-abnf">
<t>
The following ABNF syntax is used to construct RESTCONF
path identifiers:
</t>
<figure>
<artwork><![CDATA[
api-path = "/" api-identifier
0*("/" (api-identifier | key-value ))
[FIXME: the syntax for the select string is still TBD]
api-select = api-identifier
0*("/" (api-identifier | key-value ))
api-identifier = [module-name ":"] identifier
module-name = identifier
key-value = string
;; An identifier MUST NOT start with
;; (('X'|'x') ('M'|'m') ('L'|'l'))
identifier = (ALPHA / "_")
*(ALPHA / DIGIT / "_" / "-" / ".")
string = <an unquoted string>
]]></artwork>
</figure>
</section>
</section>
<section title="Data Resource Retrieval" anchor="data-retrieval">
<t>
There are three types of filtering for retrieval of data resources.
This section defines each mode.
</t>
<section title="Conditional Retrieval">
<t>
The HTTP headers (such as "If‑Modified‑Since" and "If‑Match")
can by used in for a request message for a GET method
to check a condition within the server state, such as the
last time the datastore resource was modified, or the resource
entity tag of the target resource.
</t>
<t>
If the condition is met according to the header
definition, a "200 OK" Status-Line and the data requested is
returned in the response message.
If the condition is not met, a "304 Not Modified"
Status-Line is returned in response message instead.
</t>
</section>
<section title="Data Classification Retrieval">
<t>
The "config" query parameter
can be used with the GET method to specify whether
configuration or non-configuration data is requested.
Refer to <xref target="config-param"/> for more details on the "config"
query parameter.
</t>
</section>
<section title="Filtered Retrieval">
<t>
The "select" query parameter is used to specify a filter
that should be applied to the target resource to
request a subset of all possible descendant nodes
within the target resource.
</t>
<t>
The format of the "select" parameter string is defined
in <xref target="select-param"/>. The set of nodes selected by the
filter expression is applied to each context node
identified by the target resource.
</t>
</section>
</section>
</section>
<section title="Operation Resource" anchor="operation-resource">
<t>
An operation resource represents an protocol operation
defined with the YANG "rpc" statement.
</t>
<t>
All operation resources share the same module namespace
as any top-level data resources, so the name of an operation
resource cannot conflict with the name of a top-level
data resource defined within the same module.
</t>
<t>
If 2 different YANG modules define the same "rpc" identifier,
then the module name MUST be used in the request URI.
For example, if "module‑A" and "module‑B" both defined
a "reset" operation, then invoking the operation from "module‑A"
would be requested as follows:
</t>
<figure>
<artwork><![CDATA[
POST /restconf/operations/module-A:reset HTTP/1.1
Server example.com
]]></artwork>
</figure>
<t>
Any usage of an operation resource from the same module,
with the same name, refers to the same "rpc" statement
definition. This behavior can be used to design protocol operations
that perform the same general function on different
resource types.
</t>
<t>
If the "rpc" statement has an "input" section, then a message body
MAY be sent by the client in the request, otherwise the request
message MUST NOT include a message body.
If the "rpc" statement has an "output" section, then a message body
MAY be sent by the server in the response. Otherwise the
server MUST NOT include a message body in the response message,
and MUST send a "204 No Content" Status-Line instead.
</t>
<section title="Encoding Operation Input Parameters">
<t>
If the "rpc" statement has an "input" section, then
the "input" node is provided in the message body,
corresponding to the YANG data definition statements
within the "input" section.
</t>
<t>
Example:
</t>
<t>
The following YANG definition is used for the examples in this
section.
</t>
<figure>
<artwork><![CDATA[
rpc reboot {
input {
leaf delay {
units seconds;
type uint32;
default 0;
}
leaf message { type string; }
leaf language { type string; }
}
}
]]></artwork>
</figure>
<t>
The client might send the following POST request message:
</t>
<figure>
<artwork><![CDATA[
POST /restconf/datastore/operations/
example-ops:reboot HTTP/1.1
Host: example.com
Content-Type: application/vnd.yang.data+json
{
"input" : {
"delay" : 600,
"message" : "Going down for system maintenance",
"language" : "en-US"
}
}
]]></artwork>
</figure>
<t>
The server might respond:
</t>
<figure>
<artwork><![CDATA[
HTTP/1.1 204 No Content
Date: Mon, 25 Apr 2012 11:01:00 GMT
Server: example-server
]]></artwork>
</figure>
</section>
<section title="Encoding Operation Output Parameters">
<t>
If the "rpc" statement has an "output" section, then
the "output" node is provided in the message body,
corresponding to the YANG data definition statements
within the "output" section.
</t>
<t>
Example:
</t>
<t>
The following YANG definition is used for the examples in this
section.
</t>
<figure>
<artwork><![CDATA[
rpc get-reboot-info {
output {
leaf reboot-time {
units seconds;
type uint32;
}
leaf message { type string; }
leaf language { type string; }
}
}
]]></artwork>
</figure>
<t>
The client might send the following POST request message:
</t>
<figure>
<artwork><![CDATA[
POST /restconf/datastore/operations/example-ops:get-reboot-info
HTTP/1.1
Host: example.com
Content-Type: application/vnd.yang.data+json
]]></artwork>
</figure>
<t>
The server might respond:
</t>
<figure>
<artwork><![CDATA[
HTTP/1.1 200 OK
Date: Mon, 25 Apr 2012 11:10:30 GMT
Server: example-server
{
"output" : {
"reboot-time" : 30,
"message" : "Going down for system maintenance",
"language" : "en-US"
}
}
]]></artwork>
</figure>
</section>
</section>
<section title="Event Resource" anchor="event-resource">
<figure>
<artwork><![CDATA[
[TBD]
]]></artwork>
</figure>
</section>
</section>
<section title="Error Reporting" anchor="error-reporting">
<t>
HTTP Status-Lines are used to report success or failure
for RESTCONF operations.
The <rpc‑error> element returned in NETCONF error responses
contains some useful information. This error information
is adapted for use in RESTCONF, and error information
is returned for "4xx" class of status codes.
</t>
<t>
The following table summarizes the return status codes
used specifically by RESTCONF operations:
</t>
<?rfc compact="yes"?><texttable title="HTTP Status Codes used in RESTCONF">
<ttcol align='left'> Status-Line</ttcol>
<ttcol align='left'>Description</ttcol>
<c>100 Continue</c>
<c>POST accepted, 201 should follow</c>
<c>200 OK</c>
<c>Success with response body</c>
<c>201 Created</c>
<c>POST to create a resource success</c>
<c>202 Accepted</c>
<c>POST to create a resource accepted</c>
<c>204 No Content</c>
<c>Success without response body</c>
<c>304 Not Modified</c>
<c>Conditional operation not done</c>
<c>400 Bad Request</c>
<c>Invalid request message</c>
<c>403 Forbidden</c>
<c>Access to resource denied</c>
<c>404 Not Found</c>
<c>Resource target or resource node not found</c>
<c>405 Method Not Allowed</c>
<c>Method not allowed for target resource</c>
<c>409 Conflict</c>
<c>Resource or lock in use</c>
<c>413 Request Entity Too Large</c>
<c>too-big error</c>
<c>414 Request-URI Too Large</c>
<c>too-big error</c>
<c>415 Unsupported Media Type</c>
<c>non RESTCONF media type</c>
<c>500 Internal Server Error</c>
<c>operation-failed</c>
<c>501 Not Implemented</c>
<c>unknown-operation</c>
<c>503 Service Unavailable</c>
<c>Recoverable server error</c>
</texttable>
<?rfc compact="no"?> <t>
Since an operation resource is defined with a YANG "rpc"
statement, a mapping between the NETCONF <error‑tag> value
and the HTTP status code is needed. The specific error
condition and response code to use are data-model specific
and might be contained in the YANG "description" statement
for the "rpc" statement.
</t>
<?rfc compact="yes"?><texttable title="Mapping from error-tag to status code">
<ttcol align='left'> <error‑tag></ttcol>
<ttcol align='left'>status code</ttcol>
<c>in-use</c>
<c>409</c>
<c>invalid-value</c>
<c>400</c>
<c>too-big</c>
<c>413</c>
<c>missing-attribute</c>
<c>400</c>
<c>bad-attribute</c>
<c>400</c>
<c>unknown-attribute</c>
<c>400</c>
<c>bad-element</c>
<c>400</c>
<c>unknown-element</c>
<c>400</c>
<c>unknown-namespace</c>
<c>400</c>
<c>access-denied</c>
<c>403</c>
<c>lock-denied</c>
<c>409</c>
<c>resource-denied</c>
<c>409</c>
<c>rollback-failed</c>
<c>500</c>
<c>data-exists</c>
<c>409</c>
<c>data-missing</c>
<c>409</c>
<c>operation-not-supported</c>
<c>501</c>
<c>operation-failed</c>
<c>500</c>
<c>partial-operation</c>
<c>500</c>
<c>malformed-message</c>
<c>400</c>
</texttable>
<?rfc compact="no"?><section title="Error Response Message" anchor="errors">
<t>
When an error occurs for a request message on a data resource
or an operation resource, and a "4xx" class of status codes
(except for status code "403"),
then the server SHOULD send a response body containing
the information described by the "errors" container definition
within the YANG module <xref target="module"/>.
</t>
<t>
Example:
</t>
<t>
The following example shows an error returned for
an "lock‑denied" error on a datastore resource.
</t>
<figure>
<artwork><![CDATA[
POST /restconf/operations/example-ops:lock-datastore HTTP/1.1
Host: example.com
]]></artwork>
</figure>
<t>
The server might respond:
</t>
<figure>
<artwork><![CDATA[
HTTP/1.1 409 Conflict
Date: Mon, 23 Apr 2012 17:11:00 GMT
Server: example-server
Content-Type: application/vnd.yang.api+json
{
"errors": {
"error": {
"error-type": "protocol",
"error-tag": "lock-denied",
"error-message": "Lock failed, lock is already held",
}
}
}
]]></artwork>
</figure>
</section>
</section>
<section title="YANG Patch" anchor="yang-patch">
<t>
The YANG Patch operation is provided so complex
editing operations can be performed within RESTCONF.
The "plain patch" operation only provides a simple merge
edit operation on the target datastore.
</t>
<t>
A "YANG Patch" is an ordered list of edits that are applied
to the target datastore by the server. The specific fields
are defined with the 'yang‑patch' container definition in
the YANG module <xref target="module"/>.
</t>
<t>
Each patch is identified by a client provided string,
called the "patch‑id".
</t>
<t>
The client can control the type of error handling that
should be applied to the list of supplied edits.
</t>
<section title="Why not use JSON Patch?">
<t>
The RESTCONF PATCH method requires that the media type
of the patch content be specified, so it should be possible
to use any patch mechanism, including JSON Patch <xref target="RFC6902"/>.
</t>
<t>
The RESTCONF protocol is designed to utilize the YANG
data modelling language to specify content schemas.
The JSON Patch mechanism is incompatible with RESTCONF
for the following reasons:
</t>
<t>
<list style="symbols">
<t>
A patch mechanism that works with either XML or JSON encoding
is needed.
</t>
<t>
YANG configuration nodes can be named with complex keys,
using one or more key leafs. JSON arrays are packed and
all the YANG keys would be collapsed down to a single integer
index.
</t>
<t>
YANG configuration nodes are named with stable, persistent
identifiers, using key leafs. JSON arrays are packed,
and if entry I is added or deleted, then all entries I+1 .. Imax
are renumbered.
</t>
<t>
The edit operation set needs to align with the NETCONF protocol,
and JSON Patch does not provide an aligned set of edit operations.
</t>
<t>
The datastore validation procedures need to be specific and aligned
with YANG validation procedures.
</t>
<t>
The error reporting needs to align with the NETCONF protocol,
and JSON Patch does not provide an aligned error reporting mechanism.
</t>
</list>
</t>
</section>
<section title="YANG Patch Target Data Node">
<t>
The target data node for each edit operation is determined
by the value of the target resource in the request and the
"target" leaf within each "edit" entry.
</t>
<t>
If the target resource specified in the request URI identifies
a datastore resource, then the path string in the "target" leaf
is an absolute path expression. The first node specified
in the "target" leaf is a top-level data node defined within
a YANG module.
</t>
<t>
If the target resource specified in the request URI identifies
a data resource, then the path string in the "target" leaf
is a relative path expression. The first node specified
in the "target" leaf is a child node of the data node associated
with the target resource.
</t>
</section>
<section title="YANG Patch Edit Operations">
<t>
Each YANG patch edit specifies one edit operation on
the target data node. The set of operations is aligned
with the NETCONF edit operations, but also includes
some new operations.
</t>
<?rfc compact="yes"?><texttable title="YANG Patch Edit Operations">
<ttcol align='left'> Operation</ttcol>
<ttcol align='left'>Description</ttcol>
<c>create</c>
<c>create a new data resource if it does not already exist or error</c>
<c>delete</c>
<c>delete a data resource if it already exists or error</c>
<c>insert</c>
<c>insert a new user-ordered data resource</c>
<c>merge</c>
<c>merge the edit value with the target data resource; create if it does not already exist</c>
<c>move</c>
<c>re-order the target data resource</c>
<c>replace</c>
<c>replace the target data resource with the edit value</c>
<c>remove</c>
<c>remove a data resource if it already exists or no error</c>
</texttable>
<?rfc compact="no"?></section>
<section title="YANG Patch Error Handling">
<t>
There are three error handling modes available that the server MUST
support.
These modes specify how the server will behave when errors occur in
the processing of each edit operation. Note that the server MUST ensure
that a well-formed message is received and that the supplied message
body conforms to the YANG schema definition for the "patch" container,
defined in the YANG module <xref target="module"/>.
</t>
<t>
If a well-formed, schema-valid YANG Patch message is received, then
then the server will process the supplied edits in ascending order.
The following error modes apply to the processing of this edit list:
</t>
<t>
<list style="symbols">
<t>
all-or-none: All the specified edits MUST be applied or the
target datastore contents SHOULD be returned to its original state
before the PATCH method started. The server MAY fail to restore
the contents of the target datastore completely and with certainty.
It is possible for a rollback to fail or and "undo" operation
to fail.
</t>
<t>
stop-on-error: Each edit will be attempted in order and if an
error occurs, the the server will stop processing the edit list
and return an error report identifying the edit list entry that
caused the error.
</t>
<t>
continue-on-error: Each edit will be attempted in order and if an
error occurs, the the server will record an error
identifying the edit list entry that caused the error, and continue
to the next edit entry.
</t>
</list>
</t>
<t>
The server will save the running datastore to non-volatile storage
if it has changed, after the edits have been attempted.
</t>
</section>
<section title="YANG Patch Response">
<t>
A special response is returned for YANG Patch operations,
in order to report status information for each individual edit.
It is possible to report general errors as well.
The YANG conceptual container definition "yang‑patch‑status"
defined in <xref target="module"/> is used to define the syntax.
</t>
</section>
<section title="YANG Patch Examples">
<section title="Continue-on-error Example">
<t>
The following example shows several songs being added to
an existing album.
</t>
<t>
<list style="symbols">
<t>
Each edit contains one song.
</t>
<t>
The first song already exists, so an error will be
reported for that edit.
</t>
<t>
The error-action is continue-on-error, so the rest of
the songs will be added without error.
</t>
</list>
</t>
<figure>
<artwork><![CDATA[
Request from client:
PATCH /restconf/datastore/example-jukebox:jukebox/
library/artist/Foo%20Fighters/album/Wasting%20Light HTTP/1.1
Host: example.com
Content-Type: application/vnd.yang.patch+json
{
"yang-patch" : {
"patch-id" : "add-songs-patch",
"error-action" : "continue-on-error",
"edit" : [
{
"edit-id" : 1,
"operation" : "create",
"target" : "/song",
"value" : {
"song" : {
"name" : "Bridge Burning",
"location" : "/media/bridge_burning.mp3",
"format" : "MP3",
"length" : 288
}
}
},
{
"edit-id" : 2,
"operation" : "create",
"target" : "/song",
"value" : {
"song" : {
"name" : "Rope",
"location" : "/media/rope.mp3",
"format" : "MP3",
"length" : 259
}
}
},
{
"edit-id" : 3,
"operation" : "create",
"target" : "/song",
"value" : {
"song" : {
"name" : "Dear Rosemary",
"location" : "/media/dear_rosemary.mp3",
"format" : "MP3",
"length" : 269
}
}
}
]
}
}
Response from server:
HTTP/1.1 409 Conflict
Date: Mon, 23 Apr 2012 13:01:20 GMT
Server: example-server
Last-Modified: Mon, 23 Apr 2012 13:01:20 GMT
Content-Type: application/vnd.yang.api+json
{
"yang-patch-status" : {
"patch-id" : "add-songs-patch",
"edit-status" : {
"edit" : [
{
"edit-id" : 1,
"errors" : {
"error" : {
"error-type": "application",
"error-tag": "data-exists",
"error-path": "/example-jukebox:jukebox/library/artist/
Foo%20Fighters/album/Wasting%20Light/song/
Burning%20Light",
"error-message": "Data already exists, cannot be
created"
}
},
{
"edit-id" : 2,
"location" : "http://example.com/restconf/
datastore/example-jukebox:jukebox/library/artist/
Foo%20Fighters/album/Wasting%20Light/song/Rope"
},
{
"edit-id" : 3,
"location" : "http://example.com/restconf/
datastore/example-jukebox:jukebox/library/artist/
Foo%20Fighters/album/Wasting%20Light/song/
Dear%20Rosemary"
}
}
]
}
}
}
]]></artwork>
</figure>
</section>
<section title="Move list entry example">
<t>
The following example shows a song being moved within
an existing playlist. Song "1" in playlist "Foo‑One" is
being moved after song "3" in the playlist.
The operation succeeds, so a non-error reply example can be shown.
</t>
<figure>
<artwork><![CDATA[
Request from client:
PATCH /restconf/datastore/example-jukebox:jukebox/
playlist/Foo-One HTTP/1.1
Host: example.com
Content-Type: application/vnd.yang.patch+json
{
"yang-patch" : {
"patch-id" : "move-song-patch",
"error-action" : "all-or-none",
"edit" : [
{
"edit-id" : 1,
"operation" : "move",
"target" : "/song/1",
"point" : "/song3",
"where" : "after"
}
]
}
}
Response from server:
HTTP/1.1 400 OK
Date: Mon, 23 Apr 2012 13:01:20 GMT
Server: example-server
Last-Modified: Mon, 23 Apr 2012 13:01:20 GMT
Content-Type: application/vnd.yang.api+json
{
"yang-patch-status" : {
"patch-id" : "move-song-patch",
"edit-status" : {
"edit" : [
{
"edit-id" : 1,
"ok" : [ null ]
}
}
]
}
}
}
]]></artwork>
</figure>
</section>
</section>
</section>
<section title="RESTCONF module" anchor="module">
<t>
The "ietf‑restconf" module defines conceptual definitions
within groupings, which are not meant to be implemented
as datastore contents by a server.
</t>
<t>
The "ietf‑yang‑types" and "ietf‑inet_types" modules from <xref target="RFC6991"/>
are used by this module for some type definitions.
</t>
<t>
RFC Ed.: update the date below with the date of RFC publication and
remove this note.
</t>
<t><CODE BEGINS> file "ietf-restconf@2013-09-09.yang"</t>
<figure>
<artwork><![CDATA[
module ietf-restconf {
// RFC Ed.: replace XXXX with 'ietf' and remove this note
namespace "urn:XXXX:params:xml:ns:yang:ietf-restconf";
prefix "restconf";
import ietf-yang-types { prefix yang; }
import ietf-inet-types { prefix inet; }
organization
"IETF NETCONF (Network Configuration) Working Group";
contact
"Editor: Andy Bierman
<mailto:andy@yumaworks.com>
Editor: Martin Bjorklund
<mailto:mbj@tail-f.com>
Editor: Kent Watsen
<mailto:kwatsen@juniper.net>
Editor: Rex Fernando
<mailto:rex@cisco.com>";
description
"This module contains conceptual YANG specifications
for the YANG Patch and error content that is used in
RESTCONF protocol messages. A conceptual container
representing the RESTCONF API nodes (type vnd.yang.api).
Note that the YANG definitions within this module do not
represent configuration data of any kind.
The YANG grouping statements provide a normative syntax
for XML and JSON message encoding purposes.
Copyright (c) 2013 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-bierman-netconf-restconf-01.txt
// RFC Ed.: update the date below with the date of RFC publication
// and remove this note.
revision 2013-09-09 {
description
"Initial revision.";
reference
"RFC XXXX: RESTCONF Protocol.";
}
typedef data-resource-identifier {
type string {
length "1 .. max";
}
description
"Contains a Data Resource Identifier formatted string
to identify a specific data node.";
reference
"RFC XXXX: [sec. 5.3.1.1 ABNF For Data Resource Identifiers]";
}
// this typedef is TBD; not currently used
typedef datastore-identifier {
type union {
type enumeration {
enum candidate {
description
"Identifies the NETCONF shared candidate datastore.";
reference
"RFC 6241, section 8.3";
}
enum running {
description
"Identifies the NETCONF running datastore.";
reference
"RFC 6241, section 5.1";
}
enum startup {
description
"Identifies the NETCONF startup datastore.";
reference
"RFC 6241, section 8.7";
}
}
type string;
}
description
"Contains a string to identify a specific datastore.
The enumerated datastore identifier values are
reserved for standard datastore names.";
}
typedef revision-identifier {
type string {
pattern '\d{4}-\d{2}-\d{2}';
}
description
"Represents a specific date in YYYY-MM-DD format.
TBD: make pattern more precise to exclude leading zeros.";
}
grouping yang-patch {
description
"A grouping that contains a YANG container
representing the syntax and semantics of a
YANG Patch edit request message.";
container yang-patch {
description
"Represents a conceptual sequence of datastore edits,
called a patch. Each patch is given a client-assigned
patch identifier. A patch is applied with client-specified
error handling to control how the ordered list of edits
is applied if an error is encountered.
A patch MUST be validated by the server to be a
well-formed message before any of the patch edits
are validated or attempted.
The validation model for patches closely follows
the constraint enforcement model in YANG, except it
is conceptually enforced on an ordered list of edits.
The server MUST conceptually perform field validation
for each edit in ascending order, as defined in RFC 6020,
section 8.3.1 and 8.3.2. This is most relevant if the edit
error-action is 'stop-on-error', since the identification
of the first error determines where edit processing is
terminated.
If YANG datastore validation (defined in RFC 6020, section
8.3.3) is required, then it performed after all edits have
been individually validated.
It is possible for a datastore constraint violation to occur
due to any node in the datastore, including nodes not
included in the edit list. Any validation errors SHOULD
be reported in the reply message.
If datastore validation is required and fails, the server
SHOULD NOT allow the datastore to remain invalid. It is an
implementation-specific matter how the server fixes the
invalid datastore. For example, the server might prune
invalid nodes causing the datastore validation error,
or undo the entire patch.";
reference
"RFC 6020, section 8.3.";
leaf patch-id {
type string;
description
"An arbitrary string provided by the client to identify
the entire patch. This value SHOULD be present in any
audit logging records generated by the server for the
patch. Error messages returned by the server pertaining
to this patch will be identified by this patch-id value.";
}
leaf error-action {
type enumeration {
enum all-or-none {
description
"The server will apply all edits in the patch only
if no errors occur. If any errors occur then
none of the edits will be applied and the
contents of the target datastore MUST be unchanged.";
}
enum stop-on-error {
description
"The server will apply edits in the specified order
and will stop processing edits if any error occurs.
Any previous edits which were successfully applied
will remain applied. No further edits will be
attempted after the first error is encountered.";
}
enum continue-on-error {
description
"The server will apply edits in the specified order
and will continue processing edits if any error
occurs.";
}
}
default all-or-none;
description
"The error handling behavior for the ordered list of
edits.";
}
list edit {
key edit-id;
description
"Represents one edit within the YANG Patch
request message.";
leaf edit-id {
type uint32;
description
"Arbitrary integer index for the edit.
The server MUST process edits in ascending order.
Error messages returned by the server pertaining
to a specific edit will be identified by this
identifier value.";
}
leaf operation {
type enumeration {
enum create {
description
"The target data node is created using the
supplied value, only if it does not already
exist.";
}
enum delete {
description
"Delete the target node, only if the data resource
currently exists, otherwise return an error.";
}
enum insert {
description
"Insert the supplied value into a user-ordered
list or leaf-list entry. The target node must
represent a new data resource.";
}
enum merge {
description
"The supplied value is merged with the target data
node.";
}
enum move {
description
"Move the target node. Reorder a user-ordered
list or leaf-list. The target node must represent
an existing data resource.";
}
enum replace {
description
"The supplied value is used to replace the target
data node.";
}
enum remove {
description
"Delete the target node if it currently exists.";
}
}
mandatory true;
description
"The datastore operation requested for the associated
edit entry";
}
leaf target {
type data-resource-identifier;
mandatory true;
description
"Identifies the target data resource for the edit
operation.";
}
leaf point {
when "(../operation = 'insert' or " +
"../operation = 'move') and " +
"(../where = 'before' or ../where = 'after')" {
description
"Point leaf only applies for insert or move
operations, before or after an existing entry.";
}
type data-resource-identifier;
description
"The absolute URL path for the data node that is being
used as the insertion point or move point for the
target of this edit entry.";
}
leaf where {
when "../operation = 'insert' or ../operation = 'move'" {
description
"Where leaf only applies for insert or move
operations.";
}
type enumeration {
enum before {
description
"Insert or move a data node before the data resource
identified by the 'point' parameter.";
}
enum after {
description
"Insert or move a data node after the data resource
identified by the 'point' parameter.";
}
enum first {
description
"Insert or move a data node so it becomes ordered
as the first entry.";
}
enum last {
description
"Insert or move a data node so it becomes ordered
as the last entry.";
}
}
default last;
description
"Identifies where a data resource will be inserted or
moved. YANG only allows these operations for
list and leaf-list data nodes that are ordered-by
user.";
}
anyxml value {
when "(../operation = 'create' or " +
"../operation = 'merge' " +
"or ../operation = 'replace' or " +
"../operation = 'insert')" {
description
"Value node only used for create, merge,
replace, and insert operations";
}
description
"Value used for this edit operation.";
}
}
}
} // grouping yang-patch
grouping yang-patch-status {
description
"A grouping that contains a YANG container
representing the syntax and semantics of
YANG Patch status response message.";
container yang-patch-status {
description
"A container representing the response message
sent by the server after a YANG Patch edit
request message has been processed.";
leaf patch-id {
type string;
description
"The patch-id value used in the request";
}
container global-errors {
uses errors;
description
"This container will be present if global
errors unrelated to a specific edit occurred.";
}
container edit-status {
description
"This container will be present if there are
edit-specific status responses to report.";
list edit {
key edit-id;
description
"Represents a list of status responses,
corresponding to edits in the YANG Patch
request message.";
leaf edit-id {
type uint32;
description
"Response status is for the edit list entry
with this edit-id value.";
}
choice edit-status-choice {
description
"A choice between different types of status
responses for each edit entry.";
leaf ok {
type empty;
description
"This edit entry was invoked without any
errors detected by the server associated
with this edit.";
}
leaf location {
type inet:uri;
description
"Contains the Location header value that would be
returned if this edit causes a new resource to be
created. If the edit identified by the same edit-id
value was successfully invoked and a new resource
was created, then this field will be returned
instead of 'ok'.";
}
leaf skipped {
type empty;
description
"This edit entry was skipped or not reached
by the server.";
}
case errors {
uses errors;
description
"The server detected errors associated with the
edit identified by the same edit-id value.";
}
}
}
}
}
} // grouping yang-patch-status
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 {
config false; // needed so list error does not need a key
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 data-resource-identifier;
description
"The target data resource identifier associated
with the error, if any.";
}
leaf error-message {
type string;
description
"A message describing the error.";
}
container error-info {
description
"A container allowing additional information
to be included in the error report.";
// arbitrary anyxml content here
}
}
}
} // grouping errors
grouping restconf {
description
"A grouping that contains a YANG container
representing the syntax and semantics of
the RESTCONF API resource.";
container restconf {
description
"Conceptual container representing the vnd.yang.api
resource type.";
container datastore {
description
"Container representing the vnd.yang.datastore resource
type. Represents the conceptual root of the unified
datastore containing YANG data nodes. The child nodes
of this container can be data resources (vnd.yang.data)
defined as top-level YANG data nodes from the modules
advertised by the server in /restconf/modules.";
}
container modules {
description
"Contains a list of module description entries.
These modules are currently loaded into the server.";
list module {
key "name revision";
description
"Each entry represents one module currently
supported by the server.";
leaf name {
type yang:yang-identifier;
description "The YANG module name.";
}
leaf revision {
type union {
type revision-identifier;
type string { length 0; }
}
description
"The YANG module revision date. An empty string is
used if no revision statement is present in the
YANG module.";
}
leaf namespace {
type inet:uri;
mandatory true;
description
"The XML namespace identifier for this module.";
}
leaf-list feature {
type yang:yang-identifier;
description
"List of YANG feature names from this module that are
supported by the server.";
}
leaf-list deviation {
type yang:yang-identifier;
description
"List of YANG deviation module names used by this
server to modify the conformance of the module
associated with this entry.";
}
}
}
container operations {
description
"Container for all operation resources
(vnd.yang.operation),
Each resource is represented as an empty leaf with the
name of the RPC operation from the YANG rpc statement.
E.g.;
POST /restconf/operations/show-log-errors
leaf show-log-errors {
type empty;
}
";
}
leaf version {
type enumeration {
enum "1.0" {
description
"Version 1.0 of the RESTCONF protocol.";
}
}
config false;
description
"Contains the RESTCONF protocol version.";
}
}
} // grouping restconf
}
]]></artwork>
</figure>
<t><CODE ENDS></t>
</section>
<section title="IANA Considerations" anchor="iana">
<section title="YANG Module Registry">
<t>
This document registers one URI in the IETF XML registry
<xref target="RFC3688"/>. Following the format in RFC 3688, the following
registration is requested to be made.
</t>
<figure>
<artwork><![CDATA[
// RFC Ed.: replace XXXX with 'ietf' and remove this note
URI: urn:XXXX:params:xml:ns:yang:ietf-restconf
Registrant Contact: The NETMOD WG of the IETF.
XML: N/A, the requested URI is an XML namespace.
]]></artwork>
</figure>
<t>
This document registers one YANG module in the YANG Module Names
registry <xref target="RFC6020"/>.
</t>
<figure>
<artwork><![CDATA[
name: ietf-restconf
namespace: urn:ietf:params:xml:ns:yang:ietf-restconf
prefix: restconf
// RFC Ed.: replace XXXX with RFC number and remove this note
reference: RFC XXXX
]]></artwork>
</figure>
</section>
</section>
<section title="Security Considerations">
<t>
TBD
</t>
</section>
<section title="Change Log">
<figure>
<artwork><![CDATA[
-- RFC Ed.: remove this section before publication.
]]></artwork>
</figure>
<section title="00 to 01">
<t>
<list style="symbols">
<t>
Removed incorrect /.well-known URI prefix.
</t>
<t>
remove incorrect IANA request for well-known URI.
</t>
<t>
Clarified that API resource type nodes are defined in
the ietf-restconf namespace.
</t>
<t>
changed CamelCase names in example-jukebox.yang to lowercase,
and updated examples.
</t>
<t>
updated and corrected YANG types in ietf-restconf module.
</t>
</list>
</t>
</section>
<section title="YANG-API-01 to RESTCONF-00">
<t>
<list style="symbols">
<t>
Protocol renamed from YANG-API to RESTCONF
</t>
<t>
Fields are clarified. Containers and lists are
sub-resources. All other YANG data node types are fields
within a parent resource.
</t>
<t>
The 'optional‑key' YANG extension has been removed.
</t>
<t>
The default value is returned by the server if the target resource
represents a missing data node but the server is using a default value
for the leaf.
</t>
<t>
The default for the 'depth' parameter has been changed from '1'
to 'unbounded'. The depth is only limited if an integer value
for this parameter is specified by the client.
</t>
<t>
The default for the 'format' parameter has been changed from
'json' to 'xml'.
</t>
<t>
expanded introduction
</t>
<t>
removed transactions
</t>
<t>
removed capabilities
</t>
<t>
removed usage of Range and IfRange headers
</t>
<t>
simplified editing model
</t>
<t>
removed global protocol operations from ietf-restconf.yang
</t>
<t>
changed RPC operation terminology to protocol operation
</t>
<t>
updated JSON draft reference
</t>
<t>
updated IANA section
</t>
<t>
added YANG Patch
</t>
<t>
added YANG definitions to ietf-restconf.yang
</t>
<t>
added Kent Watsen and Rex Fernando as co-authors
</t>
<t>
updated YANG modules so they pass pyang --ietf checking
</t>
<t>
changed examples so resource URIs use the module name variant
to identify data resources
</t>
<t>
changed depth behavior so the entire server contents are not
returned for "GET /restconf"; Server will stop at new
resource type; e.g. yang.api --> yang.datastore returns
the datastore as an empty node;
yang.api --> yang.operation returns
the operation name as an empty node;
</t>
</list>
</t>
</section>
</section>
<section title="Closed Issues">
<t>
<list style="symbols">
<t>
Which WG should do this work? NETCONF? NETMOD?
It is not clear since RESTCONF builds on concepts and
standards from documents owned by both working groups.
</t>
</list>
</t>
<t>
A: The NETCONF WG would do this work.
</t>
<t>
<list style="symbols">
<t>
Should sessions be used or not?
Should "reusable sessions" be used? Better for auditing?
How does locking of the /restconf/datastore resource
work for multiple edits if a session is 1 operation?
When does the server release the lock and decide it has
been abandoned or client was disconnected?
</t>
</list>
</t>
<t>
A: RESTCONF is a session-less protocol. It could be implemented
to utilize persistent HTTP connections, but this is not required
or designed into the protocol.
</t>
<t>
<list style="symbols">
<t>
Should the "/restconf/modules" resource within the API resource
be a separate resource, with its own timestamp? Currently the
API timestamp is coupled to any changes to the list of loaded
modules. Should the API resource be static and cacheable?
</t>
</list>
</t>
<t>
A: all child containers are considered sub-resources. The server
MAY support timestamps and entity IDs for data nodes.
</t>
<t>
<list style="symbols">
<t>
What to do about no REMOVE operation, just DELETE?
The effect is local to the request; in a NETCONF
edit-config it is worse, since the netconf request might
create/delete/modify many nodes
</t>
</list>
</t>
<t>
A: The YANG Patch operation allows remove or delete semantics.
</t>
<t>
<list style="symbols">
<t>
Should every YANG data node be a data resource and every YANG RPC
statement an operation resource? Is a YANG extension needed to
allow data modeler control of resource boundaries?
</t>
</list>
</t>
<t>
A: Nested containers and lists are considered sub-resources.
Terminal nodes (leaf, leaf-list, anyxml) are considered properties
of the parent resource.
</t>
<t>
<list style="symbols">
<t>
Resource creation order and other dependencies between resources
are not well identified in YANG.
YANG has leafrefs and instance-identifiers, which can be used
to identify some order dependencies.
Are any new mechanisms needed in RESTCONF needed to identify
resource creation order and other dependency requirements?
</t>
</list>
</t>
<t>
A: YANG Patch allows the client to control creation
order when multiple resources need to be edited at once.
The edit operations allow the server to order
all the descendant resources provided by the client,
for a single datastore edit target node.
</t>
<t>
<list style="symbols">
<t>
Encoding of leafrefs? Is there some additional meta-data needed?
Do leafref nodes need to be identified in responses (RFC 5988) or
is the YANG module definition sufficient to provide this meta-data?
</t>
</list>
</t>
<t>
A: no special message encoding of leaf-refs is needed.
The server must understand the YANG schema no matter what
protocol or encoding is used.
</t>
<t>
<list style="symbols">
<t>
What should the default algorithm be for defining data resources?
Should the default for an augment from another namespace be to
start a new resource? Top-level data node defaults as a resource OK?
</t>
</list>
</t>
<t>
A: Augmented nodes do not follow different rules than other nested
YANG structures. Containers and lists start new sub-resources.
</t>
</section>
<section title="Open Issues">
<t>
<list style="symbols">
<t>
There is no "message‑id" field in a RESTCONF message.
Is a message identifier needed? If so, should either the "Message‑ID"
or "Content‑ID" header from RFC 2392 be used for this purpose?
</t>
<t>
What syntax should be used for the "select" query parameter?
The current choices are "xpath" and "path‑expr". Perhaps an additional
parameter to identify the select string format is needed
to allow extensibility?
</t>
<t>
Are all header lines used by RESTCONF supported by common application
frameworks, such as FastCGI and WSGI? If not, then should
query parameters be used instead, since the QUERY_STRING is
widely available to WEB applications?
</t>
<t>
Should the <errors> element returned in error responses
be a separate media type?
</t>
<t>
How should additional datastores be supported, which may be added to the
NETCONF/NETMOD framework in the future?
</t>
<t>
How does a client know which PATCH media types are supported
by the server in addition to application/vnd.yang.data and
application/vnd.yang.patch?
</t>
<t>
Is the /restconf/version field considered meta-data?
Should it be returned as XRD (Extensible Resource Descriptor)?
In addition or instead of the version field? Should this be
the ietf-restconf YANG module revision date, instead of the string 1.0?
</t>
<t>
Notification message delivery is TBD
</t>
<t>
Alignment between NETCONF and RESTCONF notification is expected
to be very close to RFC 5277 design. Additional Sub/pub features still TBD.
</t>
<t>
Some sections may need to be rewritten to support notifications
and event resources
</t>
<t>
Since data resources can only be YANG containers or lists,
what should be done about top-level YANG data nodes that are
not containers or lists? Are they allowed in RESTCONF?
</t>
<t>
Can a choice be a resource? YANG choices are invisible
to RESTCONF at this time.
</t>
<t>
Does RESTCONF need to Use a .well-known link relation to
to re-map API entry point?
</t>
</list>
</t>
<t>
The client first discovers the server's root for the RESTCONF API.
In this example, it is "/api/restconf":
</t>
<figure>
<artwork><![CDATA[
Request
-------
GET /.well-known/host-meta users HTTP/1.1
Host: example.com
Accept: application/xrd+xml
Response
--------
HTTP/1.1 200 OK
Content-Type: application/xrd+xml
Content-Length: nnn
]]></artwork>
</figure>
<figure>
<artwork><![CDATA[
<XRD xmlns='http://docs.oasis-open.org/ns/xri/xrd-1.0'>
<Link rel='restconf' href='/api/restconf'/>
</XRD>
]]></artwork>
</figure>
<t>
Once discovering the RESTCONF API root, the client MUST
prepend it to any access to a RESTCONF resource:
</t>
<figure>
<artwork><![CDATA[
Request
-------
GET /api/restconf?select=version&format=json HTTP/1.1
Host: example.com
Accept: application/vnd.yang.api+json
Response
--------
HTTP/1.1 200 OK
Date: Mon, 23 Apr 2012 17:01:00 GMT
Server: example-server
Cache-Control: no-cache
Pragma: no-cache
Last-Modified: Sun, 22 Apr 2012 01:00:14 GMT
Content-Type: application/vnd.yang.api+json
{ "version": "1.0" }
]]></artwork>
</figure>
</section>
<section title="Example YANG Module" anchor="example-module">
<figure>
<artwork><![CDATA[
module example-jukebox {
namespace "http://example.com/ns/example-jukebox";
prefix "jbox";
organization "Example, Inc.";
contact "support at example.com";
description "Example Jukebox Data Model Module";
revision "2013-09-09" {
description "Initial version.";
reference "example.com document 1-4673";
}
identity genre {
description "Base for all genre types";
}
// abbreviated list of genre classifications
identity alternative {
base genre;
description "Alternative music";
}
identity blues {
base genre;
description "Blues music";
}
identity country {
base genre;
description "Country music";
}
identity jazz {
base genre;
description "Jazz music";
}
identity pop {
base genre;
description "Pop music";
}
identity rock {
base genre;
description "Rock music";
}
container jukebox {
presence
"An empty container indicates that the jukebox
service is available";
description
"Represents a jukebox resource, with a library, playlists,
and a play operation.";
container library {
description "Represents the jukebox library resource.";
list artist {
key name;
description
"Represents one artist resource within the
jukebox library resource.";
leaf name {
type string {
length "1 .. max";
}
description "The name of the artist.";
}
list album {
key name;
description
"Represents one album resource within one
artist resource, within the jukebox library.";
leaf name {
type string {
length "1 .. max";
}
description "The name of the album.";
}
leaf genre {
type identityref { base genre; }
description
"The genre identifying the type of music on
the album.";
}
leaf year {
type uint16 {
range "1900 .. max";
}
description "The year the album was released";
}
list song {
key name;
description
"Represents one song resource within one
album resource, within the jukebox library.";
leaf name {
type string {
length "1 .. max";
}
description "The name of the song";
}
leaf location {
type string;
mandatory true;
description
"The file location string of the
media file for the song";
}
leaf format {
type string;
description
"An identifier string for the media type
for the file associated with the
'location' leaf for this entry.";
}
leaf length {
type uint32;
units "seconds";
description
"The duration of this song in seconds.";
}
} // end list 'song'
} // end list 'album'
} // end list 'artist'
leaf artist-count {
type uint32;
units "songs";
config false;
description "Number of artists in the library";
}
leaf album-count {
type uint32;
units "albums";
config false;
description "Number of albums in the library";
}
leaf song-count {
type uint32;
units "songs";
description "Number of songs in the library";
}
} // end library
list playlist {
key name;
description
"Example configuration data resource";
leaf name {
type string;
description
"The name of the playlist.";
}
leaf description {
type string;
description
"A comment describing the playlist.";
}
list song {
key index;
ordered-by user;
description
"Example nested configuration data resource";
leaf index { // not really needed
type uint32;
description
"An arbitrary integer index for this
playlist song.";
}
leaf id {
type instance-identifier;
mandatory true;
description
"Song identifier. Must identify an instance of
/jukebox/library/artist/album/song/name.";
}
}
}
container player {
description
"Represents the jukebox player resource.";
leaf gap {
type decimal64 {
fraction-digits 1;
range "0.0 .. 2.0";
}
units "tenths of seconds";
description "Time gap between each song";
}
}
}
rpc play {
description "Control function for the jukebox player";
input {
leaf playlist {
type string;
mandatory true;
description "playlist name";
}
leaf song-number {
type uint32;
mandatory true;
description "Song number in playlist to play";
}
}
}
}
]]></artwork>
</figure>
</section>
</middle>
<back>
<references title="Normative References">
<reference anchor="RFC2119">
<front>
<title>Key words for use in RFCs to Indicate Requirement Levels</title>
<author initials="S." surname="Bradner" fullname="S. Bradner">
<organization>Harvard University</organization>
</author>
<date month="March" year="1997"/>
<abstract>
<t>In many standards track documents several words are used to signify the requirements in the specification. These words are often capitalized. This document defines these words as they should be interpreted in IETF documents.</t>
</abstract>
</front>
<seriesInfo name="BCP" value="14"/>
<seriesInfo name="RFC" value="2119"/>
<format type="TXT" octets="4723" target="ftp://ftp.isi.edu/in-notes/rfc2119.txt"/>
</reference>
<reference anchor="RFC2616">
<front>
<title abbrev="HTTP/1.1">Hypertext Transfer Protocol -- HTTP/1.1</title>
<author initials="R." surname="Fielding" fullname="Roy T. Fielding">
<organization abbrev="UC Irvine">Department of Information and Computer Science</organization>
<address>
<postal>
<street>University of California, Irvine</street>
<city>Irvine</city>
<region>CA</region>
<code>92697-3425</code></postal>
<facsimile>+1(949)824-1715</facsimile>
<email>fielding@ics.uci.edu</email></address></author>
<author initials="J." surname="Gettys" fullname="James Gettys">
<organization abbrev="Compaq/W3C">World Wide Web Consortium</organization>
<address>
<postal>
<street>MIT Laboratory for Computer Science, NE43-356</street>
<street>545 Technology Square</street>
<city>Cambridge</city>
<region>MA</region>
<code>02139</code></postal>
<facsimile>+1(617)258-8682</facsimile>
<email>jg@w3.org</email></address></author>
<author initials="J." surname="Mogul" fullname="Jeffrey C. Mogul">
<organization abbrev="Compaq">Compaq Computer Corporation</organization>
<address>
<postal>
<street>Western Research Laboratory</street>
<street>250 University Avenue</street>
<city>Palo Alto</city>
<region>CA</region>
<code>94305</code></postal>
<email>mogul@wrl.dec.com</email></address></author>
<author initials="H." surname="Frystyk" fullname="Henrik Frystyk Nielsen">
<organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
<address>
<postal>
<street>MIT Laboratory for Computer Science, NE43-356</street>
<street>545 Technology Square</street>
<city>Cambridge</city>
<region>MA</region>
<code>02139</code></postal>
<facsimile>+1(617)258-8682</facsimile>
<email>frystyk@w3.org</email></address></author>
<author initials="L." surname="Masinter" fullname="Larry Masinter">
<organization abbrev="Xerox">Xerox Corporation</organization>
<address>
<postal>
<street>MIT Laboratory for Computer Science, NE43-356</street>
<street>3333 Coyote Hill Road</street>
<city>Palo Alto</city>
<region>CA</region>
<code>94034</code></postal>
<email>masinter@parc.xerox.com</email></address></author>
<author initials="P." surname="Leach" fullname="Paul J. Leach">
<organization abbrev="Microsoft">Microsoft Corporation</organization>
<address>
<postal>
<street>1 Microsoft Way</street>
<city>Redmond</city>
<region>WA</region>
<code>98052</code></postal>
<email>paulle@microsoft.com</email></address></author>
<author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
<organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
<address>
<postal>
<street>MIT Laboratory for Computer Science, NE43-356</street>
<street>545 Technology Square</street>
<city>Cambridge</city>
<region>MA</region>
<code>02139</code></postal>
<facsimile>+1(617)258-8682</facsimile>
<email>timbl@w3.org</email></address></author>
<date year="1999" month="June"/>
<abstract>
<t>
The Hypertext Transfer Protocol (HTTP) is an application-level
protocol for distributed, collaborative, hypermedia information
systems. It is a generic, stateless, protocol which can be used for
many tasks beyond its use for hypertext, such as name servers and
distributed object management systems, through extension of its
request methods, error codes and headers . A feature of HTTP is
the typing and negotiation of data representation, allowing systems
to be built independently of the data being transferred.
</t>
<t>
HTTP has been in use by the World-Wide Web global information
initiative since 1990. This specification defines the protocol
referred to as "HTTP/1.1", and is an update to RFC 2068 .
</t></abstract></front>
<seriesInfo name="RFC" value="2616"/>
<format type="TXT" octets="422317" target="http://www.rfc-editor.org/rfc/rfc2616.txt"/>
<format type="PS" octets="5529857" target="http://www.rfc-editor.org/rfc/rfc2616.ps"/>
<format type="PDF" octets="550558" target="http://www.rfc-editor.org/rfc/rfc2616.pdf"/>
<format type="HTML" octets="636125" target="http://xml.resource.org/public/rfc/html/rfc2616.html"/>
<format type="XML" octets="493420" target="http://xml.resource.org/public/rfc/xml/rfc2616.xml"/>
</reference>
<reference anchor='RFC3688'>
<front>
<title>The IETF XML Registry</title>
<author initials='M.' surname='Mealling' fullname='M. Mealling'>
<organization /></author>
<date year='2004' month='January' />
<abstract>
<t>This document describes an IANA maintained registry for IETF standards which use Extensible Markup Language (XML) related items such as Namespaces, Document Type Declarations (DTDs), Schemas, and Resource Description Framework (RDF) Schemas.</t></abstract></front>
<seriesInfo name='BCP' value='81' />
<seriesInfo name='RFC' value='3688' />
<format type='TXT' octets='17325' target='http://www.rfc-editor.org/rfc/rfc3688.txt' />
</reference>
<reference anchor="RFC3986">
<front>
<title abbrev="URI Generic Syntax">Uniform Resource Identifier (URI): Generic Syntax</title>
<author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
<organization abbrev="W3C/MIT">World Wide Web Consortium</organization>
<address>
<postal>
<street>Massachusetts Institute of Technology</street>
<street>77 Massachusetts Avenue</street>
<city>Cambridge</city>
<region>MA</region>
<code>02139</code>
<country>USA</country></postal>
<phone>+1-617-253-5702</phone>
<facsimile>+1-617-258-5999</facsimile>
<email>timbl@w3.org</email>
<uri>http://www.w3.org/People/Berners-Lee/</uri></address></author>
<author initials="R." surname="Fielding" fullname="Roy T. Fielding">
<organization abbrev="Day Software">Day Software</organization>
<address>
<postal>
<street>5251 California Ave., Suite 110</street>
<city>Irvine</city>
<region>CA</region>
<code>92617</code>
<country>USA</country></postal>
<phone>+1-949-679-2960</phone>
<facsimile>+1-949-679-2972</facsimile>
<email>fielding@gbiv.com</email>
<uri>http://roy.gbiv.com/</uri></address></author>
<author initials="L." surname="Masinter" fullname="Larry Masinter">
<organization abbrev="Adobe Systems">Adobe Systems Incorporated</organization>
<address>
<postal>
<street>345 Park Ave</street>
<city>San Jose</city>
<region>CA</region>
<code>95110</code>
<country>USA</country></postal>
<phone>+1-408-536-3024</phone>
<email>LMM@acm.org</email>
<uri>http://larry.masinter.net/</uri></address></author>
<date year="2005" month="January"/>
<area>Applications</area>
<keyword>uniform resource identifier</keyword>
<keyword>URI</keyword>
<keyword>URL</keyword>
<keyword>URN</keyword>
<keyword>WWW</keyword>
<keyword>resource</keyword>
<abstract>
<t>
A Uniform Resource Identifier (URI) is a compact sequence of characters
that identifies an abstract or physical resource. This specification
defines the generic URI syntax and a process for resolving URI references
that might be in relative form, along with guidelines and security
considerations for the use of URIs on the Internet.
The URI syntax defines a grammar that is a superset of all valid URIs,
allowing an implementation to parse the common components of a URI
reference without knowing the scheme-specific requirements of every
possible identifier. This specification does not define a generative
grammar for URIs; that task is performed by the individual
specifications of each URI scheme.
</t></abstract></front>
<seriesInfo name="STD" value="66"/>
<seriesInfo name="RFC" value="3986"/>
<format type="TXT" octets="141811" target="http://www.rfc-editor.org/rfc/rfc3986.txt"/>
<format type="HTML" octets="213584" target="http://xml.resource.org/public/rfc/html/rfc3986.html"/>
<format type="XML" octets="163534" target="http://xml.resource.org/public/rfc/xml/rfc3986.xml"/>
</reference>
<reference anchor="RFC5789">
<front>
<title>PATCH Method for HTTP</title>
<author initials="L." surname="Dusseault" fullname="L. Dusseault">
<organization/></author>
<author initials="J." surname="Snell" fullname="J. Snell">
<organization/></author>
<date year="2010" month="March"/>
<abstract>
<t>Several applications extending the Hypertext Transfer Protocol (HTTP) require a feature to do partial resource modification. The existing HTTP PUT method only allows a complete replacement of a document. This proposal adds a new HTTP method, PATCH, to modify an existing HTTP resource. [STANDARDS-TRACK]</t></abstract></front>
<seriesInfo name="RFC" value="5789"/>
<format type="TXT" octets="21706" target="http://www.rfc-editor.org/rfc/rfc5789.txt"/>
</reference>
<!--
<reference anchor='RFC5785'>
<front>
<title>Defining Well-Known Uniform Resource Identifiers (URIs)</title>
<author initials='M.' surname='Nottingham' fullname='M. Nottingham'>
<organization /></author>
<author initials='E.' surname='Hammer-Lahav' fullname='E. Hammer-Lahav'>
<organization /></author>
<date year='2010' month='April' />
<abstract>
<t>This memo defines a path prefix for "well-known locations", "/.well-known/", in selected Uniform Resource Identifier (URI) schemes. [STANDARDS-TRACK]</t></abstract></front>
<seriesInfo name='RFC' value='5785' />
<format type='TXT' octets='13779' target='http://www.rfc-editor.org/rfc/rfc5785.txt' />
</reference>
-->
<reference anchor='RFC6241'>
<front>
<title>Network Configuration Protocol (NETCONF)</title>
<author initials='R.' surname='Enns' fullname='R. Enns' role="editor">
<organization/>
</author>
<author initials='M.' surname='Bjorklund' fullname='M. Bjorklund' role="editor">
<organization/>
</author>
<author initials='J.' surname='Schoenwaelder' fullname='J. Schoenwaelder' role="editor">
<organization/>
</author>
<author initials='A.' surname='Bierman' fullname='A. Bierman' role="editor">
<organization/>
</author>
<date year='2011' month='June'/>
</front>
<seriesInfo name='RFC' value='6241'/>
</reference>
<reference anchor="RFC6020">
<front>
<title>YANG - A Data Modeling Language for the Network Configuration Protocol (NETCONF)</title>
<author initials="M." surname="Bjorklund" fullname="M. Bjorklund">
<organization/>
</author>
<date year="2010" month="October"/>
<abstract>
<t>YANG is a data modeling language used to model configuration and state data manipulated by the Network Configuration Protocol (NETCONF), NETCONF remote procedure calls, and NETCONF notifications. [STANDARDS TRACK]</t>
</abstract>
</front>
<seriesInfo name="RFC" value="6020"/>
<format type="TXT" octets="324178" target="http://www.rfc-editor.org/rfc/rfc6020.txt"/>
</reference>
<reference anchor="RFC6536">
<front>
<title>Network Configuration Protocol (NETCONF) Access Control Model</title>
<author initials="A." surname="Bierman" fullname="A. Bierman">
<organization/></author>
<author initials="M." surname="Bjorklund" fullname="M. Bjorklund">
<organization/></author>
<date year="2012" month="March"/>
<abstract>
<t>The standardization of network configuration interfaces for use with the Network Configuration Protocol (NETCONF) requires a structured and secure operating environment that promotes human usability and multi-vendor interoperability. There is a need for standard mechanisms to restrict NETCONF protocol access for particular users to a pre-configured subset of all available NETCONF protocol operations and content. This document defines such an access control model. [STANDARDS-TRACK]</t></abstract></front>
<seriesInfo name="RFC" value="6536"/>
<format type="TXT" octets="90803" target="http://www.rfc-editor.org/rfc/rfc6536.txt"/>
</reference>
<reference anchor="I-D.lhotka-netmod-json">
<front>
<title>Modeling JSON Text with YANG</title>
<author initials="L." surname="Lhotka" fullname="L. Lhotka">
<organization>CZ.NIC</organization>
</author>
<date year="2013" month="April"/>
</front>
<seriesInfo name="Internet-Draft"
value="draft-lhotka-netmod-yang-json-01"/>
<format type='TXT'
target='http://www.ietf.org/id/draft-lhotka-netmod-yang-json-01.txt'/>
</reference>
<reference anchor='RFC6991'>
<front>
<title>Common YANG Data Types</title>
<author initials='J.' surname='Schoenwaelder' fullname='J. Schoenwaelder'>
<organization /></author>
<date year='2013' month='July' />
<abstract>
<t>This document introduces a collection of common data types to be used with the YANG data modeling language. This document obsoletes RFC 6021.</t></abstract></front>
<seriesInfo name='RFC' value='6991' />
<format type='TXT' octets='60242' target='http://www.rfc-editor.org/rfc/rfc6991.txt' />
</reference>
</references>
<references title="Informative References">
<reference anchor='RFC6902'>
<front>
<title>JavaScript Object Notation (JSON) Patch</title>
<author initials='P.' surname='Bryan' fullname='P. Bryan'>
<organization /></author>
<author initials='M.' surname='Nottingham' fullname='M. Nottingham'>
<organization /></author>
<date year='2013' month='April' />
<abstract>
<t>JSON Patch defines a JSON document structure for expressing a sequence of operations to apply to a JavaScript Object Notation (JSON) document; it is suitable for use with the HTTP PATCH method. The "application/json-patch+json" media type is used to identify such patch documents.</t></abstract></front>
<seriesInfo name='RFC' value='6902' />
<format type='TXT' octets='26405' target='http://www.rfc-editor.org/rfc/rfc6902.txt' />
</reference>
</references>
</back></rfc>
| PAFTECH AB 2003-2026 | 2026-04-23 14:29:12 |