<?xml version="1.0" encoding="US-ASCII"?>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt"?>
<!DOCTYPE rfc SYSTEM 'rfc2629.dtd'>

<?rfc compact="yes"?>
<?rfc subcompact="no"?>
<?rfc toc="yes"?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes"?>


<rfc number="8527" ipr="trust200902" updates="8040"  category="std"
    submissionType="IETF" consensus="yes" >
    <front>

    <title abbrev="RESTCONF Extensions for the NMDA">RESTCONF Extensions to Support the Network&nbsp;Management&nbsp;Datastore&nbsp;Architecture</title>

    <author initials="M" surname="Bjorklund" fullname='Martin Bjorklund' >
      <organization>Tail-f Systems</organization>
      <address>
        <email>mbj@tail-f.com</email>
      </address>
    </author>
    <author initials="J" surname="Schoenwaelder" fullname='Juergen Schoenwaelder' >
      <organization>Jacobs University</organization>
      <address>
        <email>j.schoenwaelder@jacobs-university.de</email>
      </address>
    </author>
    <author initials="P" surname="Shafer" fullname='Phil Shafer' >
      <organization>Juniper Networks</organization>
      <address>
        <email>phil@juniper.net</email>
      </address>
    </author>
    <author initials="K" surname="Watsen" fullname='Kent Watsen' >
      <organization>Watsen Networks</organization>
      <address>
        <email>kent+ietf@watsen.net</email>
      </address>
    </author>
    <author initials="R" surname="Wilton" fullname='Robert Wilton' >
      <organization>Cisco Systems</organization>
      <address>
        <email>rwilton@cisco.com</email>
      </address>
    </author>
	<date month="February" year="2019" />

    <abstract>
	<t>
This document extends the RESTCONF protocol defined in RFC 8040 in
order to support the Network Management Datastore Architecture (NMDA)
defined in RFC 8342.
	</t>
	<t>
This document updates RFC 8040 by introducing new datastore
resources, adding a new query parameter, and requiring the usage of
the YANG library (described in RFC 8525) by RESTCONF servers implementing
the NMDA.
	</t>

</abstract>
</front>
<middle>
<section title="Introduction" anchor="introduction">
    <t>
This document extends the RESTCONF protocol defined in <xref target="RFC8040"/> in
order to support the Network Management Datastore Architecture (NMDA)
defined in <xref target="RFC8342"/>.
    </t>
    <t>
This document updates <xref target="RFC8040"/> in order to enable RESTCONF clients
to discover which datastores are supported by the RESTCONF server,
determine which modules are supported in each datastore,
and interact with all the datastores supported by the
NMDA.  Specifically, the update introduces new datastore resources,
adds a new query parameter, and requires the usage of
the YANG library <xref target="RFC8525"/> by RESTCONF servers implementing
the NMDA.
    </t>
    <t>
The solution presented in this document is backwards compatible with
<xref target="RFC8040"/>.  This is achieved by only adding new resources and
leaving the semantics of the existing resources unchanged.
    </t>
<section title="Terminology" anchor="terminology">
    <t>
This document uses the terminology defined by the NMDA
<xref target="RFC8342"/>.
    </t>

        <t>
    The key words "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&nbsp;14 <xref target="RFC2119"/> <xref target="RFC8174"/> 
    when, and only when, they appear in all capitals, as shown here.
        </t>


</section>
</section>
<section title="Datastore and YANG Library Requirements" anchor="datastore-and-yang-library-requirements">

    <t>
An NMDA-compliant RESTCONF server MUST support the operational state
datastore and MUST implement at least revision 2019-01-04 of the
&quot;ietf&nbhy;yang&nbhy;library&quot; module defined in <xref target="RFC8525"/>.
    </t>
    <t>
Such a server identifies that it supports the NMDA both by
implementing the {+restconf}/ds/ietf-datastores:operational resource
and by implementing at least revision 2019-01-04 of the
&quot;ietf&nbhy;yang&nbhy;library&quot; module.
    </t>
    <t>
A RESTCONF client can test if a server supports the NMDA by using
either the HEAD or GET methods on
{+restconf}/ds/ietf-datastores:operational.
    </t>
    <t>
A RESTCONF client can discover which datastores and YANG modules the
server supports by reading the YANG library information from the
operational state datastore.
    </t>
</section>
<section title="RESTCONF Extensions" anchor="restconf-extensions">
    <t>
This section describes the RESTCONF extensions needed to support the
NMDA.
    </t>
<section title="New Datastore Resources" anchor="new-ds-resources">
    <t>
This document defines a set of new resources representing datastores
as defined in <xref target="RFC8342"/>.  These resources
are available using the following resource path template:
    </t>
	<figure>
    <artwork><![CDATA[
  {+restconf}/ds/<datastore>
    ]]></artwork>
	</figure>
    <t>
The &lt;datastore&gt; path component is encoded as an &quot;identityref&quot;
according to the JSON encoding rules for identities, defined in
Section 6.8 of <xref target="RFC7951"/>.  The namespace-qualified form MUST be used.
Such an identity MUST be derived from the &quot;datastore&quot; identity defined
in the &quot;ietf&nbhy;datastores&quot; YANG module <xref target="RFC8342"/>.
    </t>
    <t>
Specifically:
    </t>
<t>
 <list style="symbols">
 <t>
The resource {+restconf}/ds/ietf-datastores:operational
refers to the operational state datastore.
 </t>
 <t>
The resource {+restconf}/ds/ietf-datastores:running refers to the
running configuration datastore.
 </t>
 <t>
The resource {+restconf}/ds/ietf-datastores:intended refers to the
intended configuration datastore.
 </t>
 </list>
</t>
    <t>
An NMDA-compliant server MUST implement
{+restconf}/ds/ietf-datastores:operational.  Other datastore resources
MAY be implemented.
    </t>
    <t>
YANG actions can only be invoked in
{+restconf}/ds/ietf-datastores:operational.
    </t>
    <t>
 As an example, if a server implements a datastore called "ds&nbhy;ephemeral",
 defined in a module called "example-ds-ephemeral", then the server would
 implement the resource {+restconf}/ds/example-ds-ephemeral:ds-ephemeral.
    </t>
</section>
<section title="Protocol Operations" anchor="protocol-operations">
    <t>
The protocol operations available for the new datastore resources
(see <xref target="new-ds-resources"/>) are the same as the protocol operations
defined in <xref target="RFC8040"/> for the {+restconf}/data resource with the
following exceptions:
    </t>
<t>
 <list style="symbols">
 <t>
Dynamic configuration datastores are excluded, as each dynamic
configuration datastore definition needs to be reviewed for what
protocol operations it supports.
 </t>
 <t>
Some datastores are read-only by nature (e.g., &lt;intended&gt;);
hence, any attempt to modify these datastores will fail.  A server
MUST return a response with a &quot;405 Method Not Allowed&quot; status-line
and an error-tag value of &quot;operation&nbhy;not&nbhy;supported&quot;.
 </t>
 <t>
The semantics of the &quot;with&nbhy;defaults&quot; query parameter (Section
4.8.9 of <xref target="RFC8040"/>) differ when interacting with the operational state
datastore.  The semantics are described in <xref target="with-defaults"/>.
 </t>
 <t>
<xref target="RFC8040"/>, Section 3.5.4, paragraph 3 does not apply when
interacting with any resource under {+restconf}/ds.
 </t>
 </list>
</t>
<section title="The &quot;with-defaults&quot; Query Parameter on the Operational State Datastore" anchor="with-defaults">
    <t>
Support for the &quot;with&nbhy;defaults&quot; query parameter (Section 4.8.9
of <xref target="RFC8040"/>) is
OPTIONAL when interacting with
{+restconf}/ds/ietf-datastores:operational.  The associated capability
to indicate a server&apos;s support is identified with the URI:
    </t>
	<figure>
    <artwork><![CDATA[
  urn:ietf:params:restconf:capability:with-operational-defaults:1.0
    ]]></artwork></figure>
    <t>
For servers that support it, the behavior of the &quot;with&nbhy;defaults&quot; query
parameter on the operational state datastore is defined as follows:
    </t>
<t>
 <list style="symbols">
 <t>
If no &quot;with&nbhy;defaults&quot; query parameter is specified, or if it is set
to &quot;explicit&quot;, &quot;report&nbhy;all&quot;, or &quot;report&nbhy;all&nbhy;tagged&quot;, then the &quot;in
use&quot; values, as defined in Section 5.3 of <xref target="RFC8342"/>, are
returned from the operational state datastore, even
if a node happens to have a default statement in the YANG module
and this default value is being used by the server.  If the
&quot;with&nbhy;defaults&quot; parameter is set to &quot;report&nbhy;all&nbhy;tagged&quot;, any values
that match the schema default are tagged with additional metadata,
as described in Section 4.8.9 of <xref target="RFC8040"/>.
 </t>
 <t>
If the &quot;with&nbhy;defaults&quot; query parameter is set to &quot;trim&quot;, all &quot;in
use&quot; values are returned, except that the output is filtered to
exclude any values that match the default defined in the YANG
schema.
 </t>
 </list>
</t>
    <t>
Servers are not required to support all values in the &quot;with&nbhy;defaults&quot;
query parameter on the operational state datastore.  If a request is
made using a value that is not supported, then the error handling
behavior is as described in Section 4.8.9 of <xref target="RFC8040"/>.
    </t>
</section>
<section title="New &quot;with&nbhy;origin&quot; Query Parameter" anchor="new-with-origin-query-parameter">
    <t>
A new query parameter named &quot;with&nbhy;origin&quot; is added to the GET
operation. If present, it requests that the server includes &quot;origin&quot;
metadata annotations in its response, as detailed in the NMDA.  This
parameter is only valid when querying
{+restconf}/ds/ietf-datastores:operational or any datastores with
identities derived from the &quot;operational&quot; identity. Otherwise, if an
invalid datastore is specified, then the server MUST return a response
with a &quot;400 Bad Request&quot; status-line, using an error-tag value of
&quot;invalid&nbhy;value&quot;.  &quot;origin&quot; metadata annotations are not included
unless a client explicitly requests them.
    </t>
    <t>
Data in the operational state datatstore can come from multiple
sources.  

The server should return the 
&quot;origin&quot; metadata annotation value that most accurately indicates
the source of the operational value, as specified in Section 5.3.4 of
<xref target="RFC8342"/>.
    </t>
    <t>
When encoding the &quot;origin&quot; metadata annotation for a hierarchy of
returned nodes, the annotation can be omitted for a child node when
the value matches that of the parent node, as described in the
&quot;ietf&nbhy;origin&quot; YANG module <xref target="RFC8342"/>.
    </t>
    <t>
Support for the &quot;with&nbhy;origin&quot; query parameter is OPTIONAL.  It is
identified with the URI:
    </t>
	<figure>
    <artwork><![CDATA[
  urn:ietf:params:restconf:capability:with-origin:1.0
    ]]></artwork></figure>
</section>
</section>
</section>
<section title="IANA Considerations" anchor="iana-considerations">
    <t>
This document defines two capability identifier URNs in the &quot;RESTCONF
Capability URNs&quot; registry defined in <xref target="RFC8040"/>:
    </t>
	<figure>
    <artwork><![CDATA[
  Index
  Capability Identifier
  ---------------------

  :with-origin
  urn:ietf:params:restconf:capability:with-origin:1.0

  :with-operational-defaults
  urn:ietf:params:restconf:capability:with-operational-defaults:1.0
   ]]></artwork></figure>
</section>
<section title="Security Considerations" anchor="security-considerations">
    <t>
This document extends the RESTCONF protocol by introducing new
datastore resources. The lowest RESTCONF layer is HTTPS, and the
mandatory-to-implement secure transport is TLS <xref target="RFC8446"/>. The RESTCONF
protocol uses the network configuration access control model
<xref target="RFC8341"/>, which provides the means to restrict
access for particular RESTCONF users to a preconfigured subset of all
available RESTCONF protocol operations and content.
    </t>
    <t>
The security constraints for the base RESTCONF protocol (see Section
12 of <xref target="RFC8040"/>) apply to the new RESTCONF datastore resources defined
in this document.
    </t>
</section>
</middle>
<back>
<references title="Normative References">

<?rfc include="reference.RFC.2119"?>
<?rfc include="reference.RFC.7951"?>
<?rfc include="reference.RFC.8040"?>
<?rfc include="reference.RFC.8174"?>
<?rfc include="reference.RFC.8341"?>
<?rfc include="reference.RFC.8342"?>
<?rfc include="reference.RFC.8446"?>

<!-- ietf-netconf-rfc7895bis -->

<reference anchor="RFC8525" target="https://www.rfc-editor.org/info/rfc8525">
  <front>
    <title>YANG Library</title>
    <author initials="A" surname="Bierman" fullname="Andy Bierman">
      <organization/>
    </author>
    <author initials="M" surname="Bjorklund" fullname="Martin Bjorklund">
      <organization/>
    </author>
    <author initials="J" surname="Schoenwaelder" fullname="Juergen Schoenwaelder">
      <organization/>
    </author>
    <author initials="K" surname="Watsen" fullname="Kent Watsen">
      <organization/>
    </author>
    <author initials="R" surname="Wilton" fullname="Robert Wilton">
      <organization/>
    </author>
    <date month="February" year="2019"/>
  </front>

<seriesInfo name='RFC' value='8525' />
<seriesInfo name='DOI' value='10.17487/RFC8525' />

</reference>

</references>


</back></rfc>
