Network Working Group A. Bierman
Internet-Draft YumaWorks
Intended status: Standards Track M. Bjorklund
Expires: September 23, 2014 Tail-f Systems
K. Watsen
Juniper Networks
R. Fernando
Cisco
March 22, 2014
RESTCONF Protocoldraft-ietf-netconf-restconf-00
Abstract
This document describes a REST-like protocol that provides a
programmatic interface over HTTP for accessing data defined in YANG,
using the datastores defined in NETCONF.
Status of this Memo
This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress."
This Internet-Draft will expire on September 23, 2014.
Copyright Notice
Copyright (c) 2014 IETF Trust and the persons identified as the
document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must
Bierman, et al. Expires September 23, 2014 [Page 1]

Internet-Draft RESTCONF March 20141. Introduction
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.
This document describes a REST-like protocol called RESTCONF, running
over HTTP [RFC2616], for accessing data defined in YANG [RFC6020],
using datastores defined in NETCONF [RFC6241].
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, protocol
operations, and notification events. REST-like operations are used
to access the hierarchical data within a datastore.
A REST-like 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 REST-like design
principles. Since NETCONF protocol operations are not relevant, the
user should not need any prior knowledge of NETCONF in order to use
the REST-like API.
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 is encoded with either XML [W3C.REC-xml-20081126]
or JSON [JSON].
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.
1.1. Simple Subset of NETCONF Functionality
The framework and meta-model used for a REST-like API does not need
to mirror those used by the NETCONF protocol, but it 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.
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
Bierman, et al. Expires September 23, 2014 [Page 5]

Internet-Draft RESTCONF March 2014
protocol.
Applications that require more complex transaction capabilities might
consider NETCONF instead of RESTCONF. The following transaction
features are not directly provided in RESTCONF:
o datastore locking (full or partial)
o candidate datastore
o startup datastore
o validate operation
o confirmed-commit procedure
The REST-like API is not intended to replace NETCONF, but rather
provide an additional simplified interface that follows REST-like
principles and is compatible with a resource-oriented device
abstraction.
The following figure shows the system components:
+-----------+ +-----------------+
| WEB app | <-------> | |
+-----------+ HTTP | network device |
| |
+-----------+ | +-----------+ |
| NMS app | <-------> | | datastore | |
+-----------+ NETCONF | +-----------+ |
+-----------------+
1.2. Data Model Driven API
RESTCONF combines the simplicity of a REST-like API over HTTP with
the predictability and automation potential of a schema-driven API.
A REST-like client using HATEOAS principles would not use any data
modeling language to define the application-specific content of the
API. The client would discover each new child resource as it
traverses the URIs returned as Location IDs to discover the server
capabilities.
This approach has 3 significant weaknesses with regards to control of
complex networking devices:
Bierman, et al. Expires September 23, 2014 [Page 6]

Internet-Draft RESTCONF March 2014
o 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.
o no data model richness: without a data model, the schema-level
semantics and validation constraints are not available to the
application.
o 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.
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.
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.
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.
The RESTCONF protocol operates on a conceptual datastore defined with
the YANG data modeling language. The server lists each YANG module
it supports under "/restconf/modules" in the top-level API resource
type, using a structure based on the YANG module capability URI
format defined in [RFC6020].
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 stream resource is defined
with the YANG language.
The classification of data as configuration or non-configuration is
derived from the YANG "config" statement. Data ordering behavior is
derived from the YANG "ordered-by" statement.
The RESTCONF datastore editing model is simple and direct, similar to
the behavior of the ":writable-running" capability in NETCONF. Each
RESTCONF edit of a datastore resource is activated upon successful
Bierman, et al. Expires September 23, 2014 [Page 7]

Internet-Draft RESTCONF March 2014
resources.
o datastore resource: a resource with the media type "application/
yang.datastore+xml" or "application/yang.datastore+json".
Represents a configuration datastore.
o edit operation: a RESTCONF operation on a data resource using the
POST, PUT, PATCH, or DELETE method.
o event stream resource: a resource with the media type
"application/yang.stream+xml" or "application/yang.stream+json".
This resource represents an SSE (Server-Sent Events) event stream.
The content consists of text using the media type "text/
event-stream", as defined by the HTML5 specification. Each event
represents one <notification> message generated by the server. It
contains a conceptual system or data-model specific event that is
delivered within a notification event stream.
o operation: the conceptual RESTCONF operation for a message,
derived from the HTTP method, request URI, headers, and message
body.
o operation resource: a resource with the media type "application/
yang.operation+xml" or "application/yang.operation+json".
o patch: a generic PATCH method on the target datastore or data
resource. The media type of the message body content will
identify the patch type in use.
o plain patch: a PATCH method where the media type is "application/
yang.data+xml" or "application/yang.data+json".
o query parameter: a parameter (and its value if any), encoded
within the query component of the request URI.
o requested data nodes: the set of data resources identified by the
target resource, or the "select" query parameter if it is present.
o resource: a conceptual object representing a manageable component
within a device. Refers to the resource itself of the resource
and all its sub-resources.
o retrieval request: a request using the GET or HEAD methods.
o target resource: the resource that is associated with a particular
message, identified by the "path" component of the request URI.
Bierman, et al. Expires September 23, 2014 [Page 10]

Internet-Draft RESTCONF March 2014
o 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.
o YANG schema resource: a resource with the media type "application/
yang". The YANG representation of the schema can be retrieved by
the client with the GET method.
o YANG terminal node: a YANG node representing a leaf, leaf-list, or
anyxml definition.
1.3.5. Tree Diagrams
A simplified graphical representation of the data model is used in
this document. The meaning of the symbols in these diagrams is as
follows:
o Brackets "[" and "]" enclose list keys.
o Abbreviations before data node names: "rw" means configuration
(read-write) and "ro" state data (read-only).
o Symbols after data node names: "?" means an optional node and "*"
denotes a "list" and "leaf-list".
o Parentheses enclose choice and case nodes, and case nodes are also
marked with a colon (":").
o Ellipsis ("...") stands for contents of subtrees that are not
shown.
Bierman, et al. Expires September 23, 2014 [Page 11]

Internet-Draft RESTCONF March 20142. Operations
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:
+----------+-------------------------------------+
| RESTCONF | NETCONF |
+----------+-------------------------------------+
| OPTIONS | none |
| HEAD | none |
| GET | <get-config>, <get> |
| POST | <edit-config> (operation="create") |
| PUT | <edit-config> (operation="replace") |
| PATCH | <edit-config> (operation="merge") |
| DELETE | <edit-config> (operation="delete") |
+----------+-------------------------------------+
Table 1: CRUD Methods in RESTCONF
The NETCONF "remove" operation attribute is not supported by the HTTP
DELETE method. The resource must exist or the DELETE method will
fail. The PATCH method is equivalent to a "merge" operation for a
plain PATCH method.
Access control mechanims may be used to limit what operations can be
used. In particular, RESTCONF is compatible with the NETCONF Access
Control Model (NACM) [RFC6536], as there is a specific mapping
between RESTCONF and NETCONF operations, defined in Table 1. The
resource path 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.
The server MUST NOT allow any operation to any resources that the
client is not authorized to access.
Implementation of all methods (except PATCH) are defined in
[RFC2616]. This section defines the RESTCONF protocol usage for each
HTTP method.
2.1. OPTIONS
The OPTIONS method is sent by the client to discover which methods
are supported by the server for a specific resource. If supported,
Bierman, et al. Expires September 23, 2014 [Page 12]

Internet-Draft RESTCONF March 2014
it SHOULD be implemented for all media types. The server SHOULD
implement this method, however the same information could be
extracted from the YANG modules and the RESTCONF protocol
specification.
2.2. HEAD
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.
The request MUST contain a request URI that contains at least the
entry point component. The same query parameters supported by the
GET method are supported by the HEAD method.
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.
2.3. GET
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.
The server MUST NOT return any data resources for which the user does
not have read privileges. 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.
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.
Example:
The client might request the response headers for a JSON
representation of the "library" resource:
GET /restconf/data/example-jukebox:jukebox/
library/artist/Foo%20Fighters/album HTTP/1.1
Host: example.com
Accept: application/yang.data+json
The server might respond:
Bierman, et al. Expires September 23, 2014 [Page 13]

Internet-Draft RESTCONF March 2014
YANG definition in Section 7.
If the POST method succeeds, a "201 Created" Status-Line is returned
and there is no response message body. A "Location" header
identifying the child resource that was created MUST be present in
the response in this case.
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 Section 6.
Example:
To create a new "jukebox" resource, the client might send:
POST /restconf/data HTTP/1.1
Host: example.com
Content-Type: application/yang.data+json
{ "example-jukebox:jukebox" : [null] }
If the resource is created, the server might respond as follows:
HTTP/1.1 201 Created
Date: Mon, 23 Apr 2012 17:01:00 GMT
Server: example-server
Location: http://example.com/restconf/data/example-jukebox:jukebox
Last-Modified: Mon, 23 Apr 2012 17:01:00 GMT
ETag: b3a3e673be2
2.4.2. Invoke Operation Mode
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 Section 4.6 for details on operation resources.
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.
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 Section 6.
Example:
Bierman, et al. Expires September 23, 2014 [Page 15]

Internet-Draft RESTCONF March 2014
In this example, the client is invoking the "play" operation defined
in the "example-jukebox" YANG module.
A client might send a "play" request as follows:
POST /restconf/operations/example-jukebox:play HTTP/1.1
Host: example.com
Content-Type: application/yang.operation+json
{
"example-jukebox:input" : {
"playlist" : "Foo-One",
"song-number" : 2
}
}
The server might respond:
HTTP/1.1 204 No Content
Date: Mon, 23 Apr 2012 17:50:00 GMT
Server: example-server
2.5. PUT
The PUT method is sent by the client to create or replace the target
resource.
The request MUST contain a request URI that contains a target
resource that identifies the data resource to create or replace.
If the resource instance does not exist, and it represents a valid
instance the server could create with a POST request, then the server
SHOULD create it.
The message body is expected to contain the content used to create or
replace the target resource.
The "insert" and "point" query parameters are supported by the PUT
method for data resources, as specified in the YANG definition in
Section 7.
Consistent with [RFC2616], if the PUT method creates a new resource,
a "201 Created" Status-Line is returned. If an existing resource is
modified, either "200 OK" or "204 No Content" are returned.
If the user is not authorized to create or replace the target
resource an error response containing a "403 Forbidden" Status-Line
is returned to the client. All other error responses are handled
Bierman, et al. Expires September 23, 2014 [Page 16]

Internet-Draft RESTCONF March 2014
according to the procedures defined in Section 6.
Example:
An "album" sub-resource defined in the "example-jukebox" YANG module
is replaced or created if it does not already exist.
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:
PUT /restconf/data/example-jukebox:jukebox/
library/artist/Foo%20Fighters/album/Wasting%20Light HTTP/1.1
Host: example.com
Content-Type: application/yang.data+json
{
"example-jukebox:album" : {
"name" : "Wasting Light",
"genre" : "example-jukebox:alternative",
"year" : 2011
}
}
If the resource is updated, the server might respond:
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
2.6. PATCH
The PATCH method uses the HTTP PATCH method defined in [RFC5789] to
provide an extensible framework for resource patching mechanisms. It
is optional to implement by the server. Each patch type needs a
unique media type. Zero or more PATCH media types MAY be supported
by the server.
The "plain patch" PATCH method is used to create or update a sub-
resource within the target resource. If the target resource instance
does not exist, the server MUST NOT create it.
If the PATCH method succeeds, a "200 OK" Status-Line is returned if
there is a message body, and "204 No Content" is returned if no
response message body is sent.
Bierman, et al. Expires September 23, 2014 [Page 17]

Internet-Draft RESTCONF March 2014
| start-time | GET | Replay buffer start time for event-stream |
| | | resources |
| stop-time | GET | Replay buffer stop time for event-stream |
| | | resources |
+------------+----------+-------------------------------------------+
RESTCONF Query Parameters
Query parameters can be given in any order. Each parameter can
appear at most once in a request URI. A default value may apply if
the parameter is missing.
The semantics and syntax for all query parameters are defined in the
"query-parameters" YANG grouping in Section 7. The YANG encoding
MUST be converted to URL-encoded string for use in the request URI.
Refer to Appendix D.3 for examples of query parameter usage.
Bierman, et al. Expires September 23, 2014 [Page 20]

Internet-Draft RESTCONF March 20143. Messages
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,
which allows multiple datastore edits within a single message.
3.1. Request URI Structure
Resources are represented with URIs following the structure for
generic URIs in [RFC3986].
A RESTCONF operation is derived from the HTTP method and the request
URI, using the following conceptual fields:
<OP> /restconf/<path>?<query>#<fragment>
^ ^ ^ ^ ^
| | | | |
method entry resource query fragment
M M O O I
M=mandatory, O=optional, I=ignored
<text> replaced by client with real values
o 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
Section 2.
o entry: the well-known RESTCONF entry point ("/restconf").
o 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/yang.api".
o 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.
The contents of the any query parameter value MUST be encoded
according to [RFC2396], section 3.4. Any reserved characters MUST
Bierman, et al. Expires September 23, 2014 [Page 21]

Internet-Draft RESTCONF March 2014
be encoded with escape sequences, according to [RFC2396], section2.4.
o fragment: This field is not used by the RESTCONF protocol.
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.
The "target" of an operation is a resource. The "path" field in the
request URI represents the target resource for the operation.
3.2. Message Headers
There are several HTTP header lines utilized in RESTCONF messages.
Messages are not limited to the HTTP headers listed in this section.
HTTP defines which header lines are required for particular
circumstances. Refer to each operation definition section in
Section 2 for examples on how particular headers are used.
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:
+---------------------+---------------------------------------------+
| Name | Description |
+---------------------+---------------------------------------------+
| Accept | Response Content-Types that are acceptable |
| Content-Type | The media type of the request body |
| Host | The host address of the server |
| If-Match | Only perform the action if the entity |
| | matches ETag |
| If-Modified-Since | Only perform the action if modified since |
| | time |
| If-Unmodified-Since | Only perform the action if un-modified |
| | since time |
+---------------------+---------------------------------------------+
RESTCONF Request Headers
The following tables summarize the headers most relevant in RESTCONF
message responses:
Bierman, et al. Expires September 23, 2014 [Page 22]

Internet-Draft RESTCONF March 2014
+---------------+---------------------------------------------------+
| Name | Description |
+---------------+---------------------------------------------------+
| Allow | Valid actions when 405 error returned |
| Cache-Control | The cache control parameters for the response |
| Content-Type | The media type of the response body |
| Date | The date and time the message was sent |
| ETag | An identifier for a specific version of a |
| | resource |
| Last-Modified | The last modified date and time of a resource |
| Location | The resource identifier for a newly created |
| | resource |
+---------------+---------------------------------------------------+
RESTCONF Response Headers
3.3. Message Encoding
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.
Content is encoded in either JSON or XML format.
XML encoding rules for data nodes are defined in [RFC6020]. The same
encoding rules are used for all XML content.
JSON encoding rules are defined in [I-D.lhotka-netmod-json]. This
encoding is valid JSON, but also has special encoding rules to
identify module namespaces and provide consistent type processing of
YANG data.
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.
Response output content encoding format is identified with the Accept
header in the request, or if is not 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.
3.4. RESTCONF Meta-Data
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
Bierman, et al. Expires September 23, 2014 [Page 23]

Internet-Draft RESTCONF March 2014
defined in the YANG schema because it applies to the datastore, and
is common across all data nodes.
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.
3.4.1. JSON Encoding of RESTCONF Meta-Data
The YANG to JSON mapping [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.
Only simple meta-data is supported:
o A meta-data instance can appear 0 or 1 times for a particular data
node
o 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 [I-D.lhotka-netmod-json], except the identifier is
prepended with a "@" (%40) character.
o A meta-data instance associated with a YANG leaf or leaf-list
within a resource is encoded as if it were a container for the
meta-data values and the resource value in its native encoding.
It is encoded according to the rules in [I-D.lhotka-netmod-json],
except the meta-data identifiers are prepended with a "@" (%40)
character. The resource name/value pair is repeated inside this
container, which contains the actual value of the resource.
Example:
Bierman, et al. Expires September 23, 2014 [Page 24]

Internet-Draft RESTCONF March 20143.5. Return Status
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 Section 6.1.
3.6. Message Caching
Since the datastore contents change at unpredictable times, responses
from a RESTCONF server generally SHOULD NOT be cached.
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.
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 the "If-None-Match"
and/or "If-Modified-Since" headers, 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.
Bierman, et al. Expires September 23, 2014 [Page 26]

Internet-Draft RESTCONF March 20144. Resources
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.
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. The child resource types and methods allowed
on them are data-model specific.
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.
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 in YANG modules.
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, top-level
data node resources, and notification event messages supported by the
server.
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.
4.1. RESTCONF Resource Types
The RESTCONF protocol defines some application specific media types
to identify each of the available resource types. The following
resource types are defined in RESTCONF:
+-----------+----------------------------+
| Resource | Media Type |
+-----------+----------------------------+
| API | application/yang.api |
| Datastore | application/yang.datastore |
| Data | application/yang.data |
| Operation | application/yang.operation |
| Schema | application/yang |
| Stream | application/yang.stream |
+-----------+----------------------------+
Bierman, et al. Expires September 23, 2014 [Page 27]

Internet-Draft RESTCONF March 2014
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/yang.data+json
{
"example-jukebox:library" : {
"artist-count" : 42,
"album-count" : 59,
"song-count" : 374
}
}
4.3.2. /restconf/modules
This mandatory resource contains the identifiers for the YANG data
model modules supported by the server.
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.
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.
4.3.2.1. /restconf/modules/module
This mandatory resource contains one list entry 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.
The contents of the "module" resource are defined in the "module"
YANG list statement in Section 7.
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.
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.
Bierman, et al. Expires September 23, 2014 [Page 30]

Internet-Draft RESTCONF March 20144.3.3. /restconf/operations
This optional resource is a container that 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.
Any data-model specific operations defined in the YANG modules
advertised by the server MAY be available as child nodes of this
resource.
Operation resources are defined in Section 4.6.
4.3.4. /restconf/streams
This optional resource is a container that provides access to the
notification event streams supported by the server. The server MAY
omit this resource if no notification event streams are supported.
The media type for this resource is "application/yang.api".
The server will populate this container with a stream list entry for
each stream type it supports. Each stream contains a leaf called
"events" which represents an event stream resource. The media type
for this resource is "application/yang.stream".
Stream resources are defined in Section 4.8. Notifications are
defined in Section 5.
4.3.5. /restconf/version
This sub-resource can be used by the client to identify the exact
version of the RESTCONF protocol implemented by the server. The same
server-wide response MUST be returned each time this resource is
retrieved.
The value is assigned by the server when the server is started. The
server MUST return the value "1.0" for this version of the RESTCONF
protocol. This resource is encoded with the rules for an
"enumeration" data type, using the "version" leaf definition in
Section 7.
4.4. Datastore Resource
The /restconf/data subtree represents the datastore resource type,
which is a collection of configuration and operational data nodes.
A "unified datastore" interface is used to simplify resource editing
for the client. The RESTCONF unified datastore is a conceptual
Bierman, et al. Expires September 23, 2014 [Page 31]

Internet-Draft RESTCONF March 2014
interface to the native configuration datastores that are present on
the device.
The underlying NETCONF datastores (i.e., candidate, running, startup)
can be used to implement the unified datastore, but the server design
is not limited to the exact datastore procedures defined in NETCONF.
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.
4.4.1. Edit Collision Detection
Two "edit collision detection" mechanisms are provided in RESTCONF,
for datastore and data resources.
4.4.1.1. 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.
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.
4.4.1.2. 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.
The server MUST 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 MUST be changed to a new
previously unused value if changes to any configuration data
resources within the datastore are made.
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.]
Bierman, et al. Expires September 23, 2014 [Page 32]

Internet-Draft RESTCONF March 2014
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.
4.5. Data Resource
A data resource represents a YANG data node that is a descendant node
of a datastore resource.
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. If
maintained, the resource timestamp MUST be set to the current time
whenever the resource or any configuration resource within the
resource is altered.
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. If
maintained, the resource entity tag MUST be updated whenever the
resource or any configuration resource within the resource is
altered.
A data resource can be retrieved with the GET method. Data resources
can be accessed via the "/restconf/data" entry point. This sub-tree
is used to retrieve and edit data resources.
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 Section 2 for more details on edit
operations.
The resource definition version for a data resource is identified by
the revision date of the YANG module containing the YANG definition
for the data resource, specified in the /restconf/modules sub-tree.
4.5.1. Encoding YANG Instance Identifiers in the Request URI
In YANG, data nodes are named with an absolute XPath expression,
defined in [XPath] , starting from the document root to the target
resource. In RESTCONF, URL encoded Location header expressions are
used instead.
The YANG "instance-identifier" (i-i) data type is represented in
RESTCONF with the path expression format defined in this section.
Bierman, et al. Expires September 23, 2014 [Page 33]

Internet-Draft RESTCONF March 2014
+-------+-------------------------------------------+
| Name | Comments |
+-------+-------------------------------------------+
| point | Insertion point is always a full i-i |
| path | Request URI path is a full or partial i-i |
+-------+-------------------------------------------+
RESTCONF instance-identifier Type Conversion
The "path" component of the request URI contains the absolute path
expression that identifies the target resource.
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.
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 Section 4.5.1.1. The node name
of each ancestor of the target resource node is encoded in order,
ending with the node name for the target resource.
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 require key values to be present in the request URI.
The key leaf values for a data resource representing a YANG list MUST
be encoded as follows:
o The value of each leaf identified in the "key" statement is
encoded in order.
o All the components in the "key" statement MUST be encoded.
Partial instance identifiers are not supported.
o Each value is encoded using the "key-value" rule in
Section 4.5.1.1, according to the encoding rules for the data type
of the key leaf.
o An empty string can be a valid key value (e.g., "/top/list/key1//
key3").
o The "/" character MUST be URL-encoded (i.e., "%2F").
Bierman, et al. Expires September 23, 2014 [Page 34]

Internet-Draft RESTCONF March 2014
o All whitespace MUST be URL-encoded.
o A "null" value is not allowed since the "empty" data type is not
allowed for key leafs.
o The XML encoding is defined in [RFC6020].
o The JSON encoding is defined in [I-D.lhotka-netmod-json].
o The entire "key-value" MUST be properly URL-encoded, according to
the rules defined in [RFC3986].
o resource URI values returned in Location headers for data
resources MUST identify the module name, even if there are no
conflicting local names when the resource is created. This
ensures the correct resource will be identified even if the server
loads a new module that the old client does not know about.
Examples:
[ lines wrapped for display purposes only ]
/restconf/data/example-jukebox:jukebox/library/
artist/Beatles/album
/restconf/data/example-list:newlist/17
/nextlist%2Ffoo%2Fbar%2Facme-list-ext%3Aext-leaf
/restconf/data/example-list:somelist/the%20key
/restconf/data/example-list:somelist/the%20key/address
4.5.1.1. ABNF For Data Resource Identifiers
The following ABNF syntax is used to construct RESTCONF path
identifiers:
Bierman, et al. Expires September 23, 2014 [Page 35]

Internet-Draft RESTCONF March 2014
api-path = "/" |
("/" 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>
[FIXME: the syntax for the select string is still TBD]
api-select = api-identifier
0*("/" (api-identifier | key-value ))
4.5.2. Defaults Handling
NETCONF has a rather complex model for handling default values for
leafs. RESTCONF attempts to avoid this complexity by restricting the
operations that can be applied to a resource.
If the target of a GET method 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.
If the target of a GET method is a data node that represents a
container or list that has any sub-resources with default values, for
the sub-resources that have not been given value yet, the server MAY
return the default values that are in use by the server.
4.6. Operation Resource
An operation resource represents an protocol operation defined with
the YANG "rpc" statement.
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.
If 2 different YANG modules define the same "rpc" identifier, then
Bierman, et al. Expires September 23, 2014 [Page 36]

Internet-Draft RESTCONF March 2014
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:
POST /restconf/operations/module-A:reset HTTP/1.1
Server example.com
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.
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.
4.6.1. Encoding Operation Input Parameters
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.
Example:
The following YANG definition is used for the examples in this
section.
rpc reboot {
input {
leaf delay {
units seconds;
type uint32;
default 0;
}
leaf message { type string; }
leaf language { type string; }
}
}
The client might send the following POST request message:
Bierman, et al. Expires September 23, 2014 [Page 37]

Internet-Draft RESTCONF March 2014
A notification stream functions according to the NETCONF
Notifications specification [RFC5277]. The "ietf-restconf" YANG
module contains the "stream" list (/restconf/streams/stream) which
specifies the syntax and semantics of a stream resource.
Bierman, et al. Expires September 23, 2014 [Page 40]

Internet-Draft RESTCONF March 20145. Notifications
The RESTCONF protocol supports YANG-defined event notifications. The
solution preserves aspects of NETCONF Event Notifications [RFC5277]
while utilizing the Server-Sent Events [wd-eventsource] transport
strategy.
5.1. Server Support
A RESTCONF server is not required to support RESTCONF notifications.
Clients may determine if a server supports RESTCONF notifications by
using the HTTP operation OPTIONS, HEAD, or GET on the "/restconf/
streams" resource described below. The server does not support
RESTCONF notifications if an HTTP error code is returned (e.g. 404
Not Found).
5.2. Event Streams
A RESTCONF server that supports notifications will populate a stream
resource for each notification delivery service access point. A
RESTCONF client can retrieve the list of supported event streams from
a RESTCONF server using the GET operation on the "/restconf/streams"
resource.
The "/restconf/streams" container definition in the "ietf-restconf"
module defined in Section 7 is used to specify the structure and
syntax of the conceptual sub-resources within the "streams" resource.
For example:
The client might send the following request:
GET /restconf/streams HTTP/1.1
Host: example.com
Accept: application/yang.api+xml
The server might send the following response:
HTTP/1.1 200 OK
Content-Type: application/yang.api+xml
Bierman, et al. Expires September 23, 2014 [Page 41]

Internet-Draft RESTCONF March 2014
A RESTCONF client MAY request the server compress the events using
the HTTP header field "Accept-Encoding". For instance:
GET /restconf/streams/stream/NETCONF/events HTTP/1.1
Host: example.com
Accept: text/event-stream
Cache-Control: no-cache
Connection: keep-alive
Accept-Encoding: gzip, deflate
5.3.1. NETCONF Event Stream
The server SHOULD support the "NETCONF" notification stream defined
in [RFC5277]. For this stream, RESTCONF notification subscription
requests MAY specify parameters indicating the events it wishes to
receive.
+------------+-------------------------+
| Name | Description |
+------------+-------------------------+
| start-time | replay event start time |
| stop-time | replay event stop time |
| filter | boolean content filter |
+------------+-------------------------+
NETCONF Stream Query Parameters
The semantics and syntax for these query parameters are defined in
the "query-parameters" YANG grouping in Section 7. The YANG encoding
MUST be converted to URL-encoded string for use in the request URI.
Refer to Appendix D.3.3 for filter parameter examples.
5.4. Receiving Event Notifications
RESTCONF notifications are encoded according to the definition of the
event stream. The NETCONF stream defined in [RFC5277] is encoded in
XML format.
The structure of the event data is based on the "notification"
element definition in section 4 of [RFC5277]. It MUST conform to the
"notification" YANG container definition in Section 7.
An example SSE notification encoded using XML:
Bierman, et al. Expires September 23, 2014 [Page 43]

Internet-Draft RESTCONF March 2014
data: <notification
data: xmlns="urn:ietf:params:xml:ns:yang:ietf-restconf">
data: <event-time>2013-12-21T00:01:00Z</event-time>
data: <event xmlns="http://example.com/event/1.0">
data: <eventClass>fault</eventClass>
data: <reportingEntity>
data: <card>Ethernet0</card>
data: </reportingEntity>
data: <severity>major</severity>
data: </event>
data: </notification>
Since XML is not whitespace sensitive, the above message can be
encoded onto a single line.
For example: ('\' line wrapping added for formatting only)
data: <notification xmlns="urn:ietf:params:xml:ns:yang:ietf-rest\
conf"><event-time>2013-12-21T00:01:00Z</event-time><event xmlns="\
http://example.com/event/1.0"><eventClass>fault</eventClass><repo\
rtingEntity><card>Ethernet0</card></reportingEntity><severity>maj\
or</severity></event></notification>
The SSE specifications supports the following additional fields:
event, id and retry. A RESTCONF server MAY send the "retry" field
and, if it does, RESTCONF clients SHOULD use it. A RESTCONF server
SHOULD NOT send the "event" or "id" fields, as there are no
meaningful values that could be used for them that would not be
redundant to the contents of the notification itself. RESTCONF
servers that do not send the "id" field also do not need to support
the HTTP header "Last-Event-Id". RESTCONF servers that do send the
"id" field MUST still support the "startTime" query parameter as the
preferred means for a client to specify where to restart the event
stream.
Bierman, et al. Expires September 23, 2014 [Page 44]

Internet-Draft RESTCONF March 2014
for the message and error content that is used in
RESTCONF protocol messages. A conceptual container
representing the RESTCONF API nodes is also defined
for the media type application/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) 2014 IETF Trust and the persons identified as
authors of the code. All rights reserved.
Redistribution and use in source and binary forms, with or
without modification, is permitted pursuant to, and subject
to the license terms contained in, the Simplified BSD License
set forth in Section 4.c of the IETF Trust's Legal Provisions
Relating to IETF Documents
(http://trustee.ietf.org/license-info).
This version of this YANG module is part of RFC XXXX; see
the RFC itself for full legal notices.";
// RFC Ed.: replace XXXX with actual RFC number and remove this
// note.
// RFC Ed.: remove this note
// Note: extracted from draft-ietf-netconf-restconf-00.txt
// RFC Ed.: update the date below with the date of RFC publication
// and remove this note.
revision 2014-03-22 {
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 resource instance.
The document root for all data resources is a
datastore resource container. Each top-level YANG
data nodes supported by the server will be represented
Bierman, et al. Expires September 23, 2014 [Page 50]

Internet-Draft RESTCONF March 2014
as a child node of the document root.
The canonical representation of a data resource identifier
includes the full server specification that is returned
in the Location header when a new data resource is created
with the POST method.
The abbreviated representation does not contain any server
location identification. Instead the identifier will start
with the '/' character to represent the datastore document
root for the data resource instance.
The server MUST accept either representation and SHOULD
return the canonical representation in any response message.";
reference
"RFC XXXX: [sec. 5.3.1.1 ABNF For Data Resource Identifiers]";
}
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 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 {
Bierman, et al. Expires September 23, 2014 [Page 51]

Internet-Draft RESTCONF March 2014
container modules {
description
"Contains a list of module description entries.
These modules are currently loaded into the server.";
grouping common-leafs {
description
"Common parameters for YANG modules and submodules.";
leaf name {
type yang:yang-identifier;
description "The YANG module or submodule name.";
}
leaf revision {
type union {
type revision-identifier;
type string { length 0; }
}
description
"The YANG module or submodule revision date.
An empty string is used if no revision statement
is present in the YANG module or submodule.";
}
leaf schema {
type empty;
description
"Represents the YANG schema resource for this module
or submodule if it is available on the server.
This leaf will only be present if the server has
the schema available for retrieval. A GET
request with a target resource URI that identifies
this leaf will cause the server to return the YANG
schema text for the associated module or submodule.";
}
}
list module {
key "name revision";
description
"Each entry represents one module currently
supported by the server.";
uses common-leafs;
leaf namespace {
type inet:uri;
Bierman, et al. Expires September 23, 2014 [Page 54]

Internet-Draft RESTCONF March 2014
value of the requested data nodes. If 'false', then
the default is 'nonconfig'. If 'true' then the
default is 'config'.";
}
leaf depth {
type union {
type enumeration {
enum unbounded {
description "All sub-resources will be returned.";
}
}
type uint32 {
range "1..max";
}
}
default unbounded;
description
"The 'depth' parameter is used to specify the number
of nest levels returned in a response for a GET method.
The first nest-level consists of the requested data node
itself. Any child nodes which are contained within
a parent node have a depth value that is 1 greater than
its parent.
This parameter is only allowed for GET methods on api,
datastore, and data resources. A 400 Bad Request error
is returned if used for other methods or resource types.
By default, the server will include all sub-resources
within a retrieved resource, which have the same resource
type as the requested resource. Only one level of
sub-resources with a different media type than the target
resource will be returned.";
}
leaf filter {
type yang:xpath1.0;
description
"The 'filter' parameter is used to indicate which subset of
all possible events are of interest. If not present, all
events not precluded by other parameters will be sent.
This parameter is only allowed for GET methods on a
text/event-stream data resource. A 400 Bad Request error
is returned if used for other methods or resource types.
The format of this parameter is an XPath expression, and
Bierman, et al. Expires September 23, 2014 [Page 58]

Internet-Draft RESTCONF March 2014
is evaluated in the following context:
o The set of namespace declarations is the set of
prefix and namespace pairs for all supported YANG
modules, where the prefix is the YANG module name, and
the namespace is as defined by the 'namespace' statement
in the YANG module.
o The function library is the core function library defined
in XPATH.
o The set of variable bindings is empty.
o The context node is the root node
The filter is used as defined in [RFC5277], section 3.6.
If the boolean result of the expression is true when applied
to the conceptual 'notification' document root, then the
notification event is delivered to the client.";
}
leaf insert {
type enumeration {
enum first {
description "Insert the new data as the new first entry.";
}
enum last {
description "Insert the new data as the new last entry.";
}
enum before {
description
"Insert the new data before the insertion point,
specified by the value of the 'point' parameter.";
}
enum after {
description
"Insert the new data after the insertion point,
specified by the value of the 'point' parameter.";
}
}
default last;
description
"The 'insert' parameter is used to specify how a
resource should be inserted within a user-ordered list.
This parameter is only supported for the POST and PUT
methods. It is also only supported if the target
resource is a data resource, and that data represents
a YANG list or leaf-list that is ordered by the user.
Bierman, et al. Expires September 23, 2014 [Page 59]

Internet-Draft RESTCONF March 2014
If the values 'before' or 'after' are used,
then a 'point' query parameter for the insertion
parameter MUST also be present, or a 400 Bad Request
error is returned.";
}
leaf point {
type data-resource-identifier;
description
"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 or leaf-list.
This parameter is only supported for the POST and PUT
methods. It is also only supported if the target
resource is a data resource, and that data represents
a YANG list or leaf-list that is ordered by the user.
If the 'insert' query parameter is not present, or has
a value other than 'before' or 'after', then a 400
Bad Request error is returned.
This parameter contains the instance identifier of the
resource to be used as the insertion point for a
POST or PUT method.";
}
leaf select {
type string {
length "1 .. max";
}
description
"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 an expression
string, using the target resource as the context node.
The encoding for the select parameter is still TBD.
This parameter is only allowed for GET methods on api,
datastore, and data resources. A 400 Bad Request error
is returned if used for other methods or resource types.
If XPath:
The string is an XPath expression that will be evaluated
using the target resource instance as the context node
and the document root. It is expected to return a node-set
result representing the descendants within the context
Bierman, et al. Expires September 23, 2014 [Page 60]

Internet-Draft RESTCONF March 2014
node that should be returned in a GET response.";
}
leaf start-time {
type yang:date-and-time;
description
"The 'start-time' parameter is used to trigger
the notification replay feature and indicate
that the replay should start at the time specified.
If the stream does not support replay, per the
'replay-support' attribute returned by
the /restconf/streams resource, then the server MUST
return the HTTP error code 400 Bad Request.
This parameter is only allowed for GET methods on a
text/event-stream data resource. A 400 Bad Request error
is returned if used for other methods or resource types.
If this parameter is not present, then a replay subscription
is not begin requested. It is not valid to specify start
times that are later than the current time. If the value
specified is earlier than the log can support, the replay
will begin with the earliest available notification";
}
leaf stop-time {
type yang:date-and-time;
description
"The 'stop-time' parameter is used with the
replay feature to indicate the newest notifications of
interest. This parameter MUST be used with and have a
value later than the 'start-time' parameter.
This parameter is only allowed for GET methods on a
text/event-stream data resource. A 400 Bad Request error
is returned if used for other methods or resource types.
If this parameter is not present, the notifications will
continue until the subscription is terminated.
Values in the future are valid.";
}
} // grouping query-parameters
grouping notification {
description
"Contains the notification message wrapper definition.";
Bierman, et al. Expires September 23, 2014 [Page 61]

Internet-Draft RESTCONF March 2014Appendix B. Open Issues
-- RFC Ed.: remove this section before publication.
B.1. message-id
o 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?
Status: open
B.2. select parameter
o 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?
Status: solution proposal pending from Martin
B.3. server support verification
o 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?
Status: closed
Resolution: no concern the methods or headers used by RESTCONF are
not widely supported.
B.4. error media type
o Should the <errors> element returned in error responses be a
separate media type?
Status: closed-update-needed; Consensus is that a new media type for
<errors> is needed.
B.5. additional datastores
o How should additional datastores be supported, which may be added
to the NETCONF/NETMOD framework in the future?
Status: closed
Bierman, et al. Expires September 23, 2014 [Page 69]

Internet-Draft RESTCONF March 2014
Resolution: Exposing the candidate and startup datastores is not
needed. A single unified datastore can probably be used for future
extensions, depending on how the future extension is designed.
B.6. PATCH media type discovery
o How does a client know which PATCH media types are supported by
the server in addition to application/yang.data and application/
yang.patch?
Status: closed-update-pending
Resolution: the Accept-Patch header defined in RFC 5789 needs to be
implemented by the server to advertise the media types supported for
PATCH.
B.7. RESTCONF version
o 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?
Status: open
B.8. YANG to resource mapping
o 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?
Status: closed
Resolution: top-level terminal nodes can be resources. Current
definition of all levels are new sub-resources for server
implementation purposes
o Can a choice be a resource? YANG choices are invisible to
RESTCONF at this time.
Status: closed
Resolution: choices are not resources
B.9. .well-known usageBierman, et al. Expires September 23, 2014 [Page 70]

Internet-Draft RESTCONF March 2014B.10. _self links for HATEOAS support
o Should there be a mode where the client can request that the
resource identifier is returned in a GET request?
Status: closed
Resultion: these links are not needed. RESTCONF is REST-like, not
REST-ful.
B.11. netconf-state monitoring support
o Should long-term RESTCONF operations (i.e. SSE long-poll) be
considered sessions with regards to NETCONF monitoring "session"
list? If so, what text is needed in RESTCONF draft to standardize
the RESTCONF session entries?
Status: closed-update-pending
Resolution:
A new data structure to monitor streams can be added to the netconf-
state sub-tree. The session-id in this new data structure is not
restricted to the NETCONF-only rules for the sessions sub-tree.
B.12. secure transport
o Details to support secure operation over TLS are needed
Status: open
o Security considerations need to be written
Status: open
o Can call-home for RESTCONF be supported
Status: open
B.13. Encoding of key leafs in resource URIs
o The use of a forward slash '/' as the delimiter between key values
in a target resource URI is not not desirable. Only 1 segment per
YANG data node layer should be used.
Status: closed-update-pending
Resolution:
Bierman, et al. Expires September 23, 2014 [Page 72]