draft-ietf-netconf-yang-patch-07.txt   draft-ietf-netconf-yang-patch-08.txt 
Network Working Group A. Bierman Network Working Group A. Bierman
Internet-Draft YumaWorks Internet-Draft YumaWorks
Intended status: Standards Track M. Bjorklund Intended status: Standards Track M. Bjorklund
Expires: June 17, 2016 Tail-f Systems Expires: September 17, 2016 Tail-f Systems
K. Watsen K. Watsen
Juniper Networks Juniper Networks
December 15, 2015 March 16, 2016
YANG Patch Media Type YANG Patch Media Type
draft-ietf-netconf-yang-patch-07 draft-ietf-netconf-yang-patch-08
Abstract Abstract
This document describes a method for applying patches to NETCONF This document describes a method for applying patches to
datastores using data defined with the YANG data modeling language. configuration datastores using data defined with the YANG data
modeling language.
Status of This Memo Status of This Memo
This Internet-Draft is submitted in full conformance with the This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79. provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/. Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on June 17, 2016. This Internet-Draft will expire on September 17, 2016.
Copyright Notice Copyright Notice
Copyright (c) 2015 IETF Trust and the persons identified as the Copyright (c) 2016 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of (http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3 1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3
1.1.1. NETCONF . . . . . . . . . . . . . . . . . . . . . . . 3 1.1.1. NETCONF . . . . . . . . . . . . . . . . . . . . . . . 3
1.1.2. HTTP . . . . . . . . . . . . . . . . . . . . . . . . 3 1.1.2. HTTP . . . . . . . . . . . . . . . . . . . . . . . . 4
1.1.3. YANG . . . . . . . . . . . . . . . . . . . . . . . . 4 1.1.3. YANG . . . . . . . . . . . . . . . . . . . . . . . . 4
1.1.4. RESTCONF . . . . . . . . . . . . . . . . . . . . . . 4 1.1.4. RESTCONF . . . . . . . . . . . . . . . . . . . . . . 5
1.1.5. YANG Patch . . . . . . . . . . . . . . . . . . . . . 5 1.1.5. YANG Patch . . . . . . . . . . . . . . . . . . . . . 5
1.1.6. Tree Diagrams . . . . . . . . . . . . . . . . . . . . 5 1.1.6. Tree Diagrams . . . . . . . . . . . . . . . . . . . . 5
2. YANG Patch . . . . . . . . . . . . . . . . . . . . . . . . . 5 2. YANG Patch . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.1. Target Resource . . . . . . . . . . . . . . . . . . . . . 6 2.1. Target Resource . . . . . . . . . . . . . . . . . . . . . 6
2.2. yang-patch Input . . . . . . . . . . . . . . . . . . . . 6 2.2. yang-patch Input . . . . . . . . . . . . . . . . . . . . 6
2.3. yang-patch-status Output . . . . . . . . . . . . . . . . 7 2.3. yang-patch-status Output . . . . . . . . . . . . . . . . 7
2.4. Target Data Node . . . . . . . . . . . . . . . . . . . . 7 2.4. Target Data Node . . . . . . . . . . . . . . . . . . . . 8
2.5. Edit Operations . . . . . . . . . . . . . . . . . . . . . 8 2.5. Edit Operations . . . . . . . . . . . . . . . . . . . . . 8
2.6. Error Handling . . . . . . . . . . . . . . . . . . . . . 8 2.6. Successful Edit Response Handling . . . . . . . . . . . . 9
2.7. yang-patch RESTCONF Capability . . . . . . . . . . . . . 9 2.7. Error Handling . . . . . . . . . . . . . . . . . . . . . 9
2.8. yang-patch RESTCONF Capability . . . . . . . . . . . . . 9
3. YANG Module . . . . . . . . . . . . . . . . . . . . . . . . . 9 3. YANG Module . . . . . . . . . . . . . . . . . . . . . . . . . 9
4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 17 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 18
4.1. YANG Module Registry . . . . . . . . . . . . . . . . . . 18 4.1. YANG Module Registry . . . . . . . . . . . . . . . . . . 18
4.2. application/yang.patch Media Types . . . . . . . . . . . 18 4.2. application/yang.patch Media Types . . . . . . . . . . . 19
4.3. application/yang.patch-status Media Types . . . . . . . . 18 4.3. application/yang.patch-status Media Types . . . . . . . . 19
4.4. RESTCONF Capability URNs . . . . . . . . . . . . . . . . 19 4.4. RESTCONF Capability URNs . . . . . . . . . . . . . . . . 20
5. Security Considerations . . . . . . . . . . . . . . . . . . . 19 5. Security Considerations . . . . . . . . . . . . . . . . . . . 20
6. Normative References . . . . . . . . . . . . . . . . . . . . 19 6. Normative References . . . . . . . . . . . . . . . . . . . . 20
Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 20 Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 21
Appendix B. Change Log . . . . . . . . . . . . . . . . . . . . . 21 Appendix B. Change Log . . . . . . . . . . . . . . . . . . . . . 22
B.1. v06 to v07 . . . . . . . . . . . . . . . . . . . . . . . 21 B.1. v07 to v08 . . . . . . . . . . . . . . . . . . . . . . . 22
B.2. v05 to v06 . . . . . . . . . . . . . . . . . . . . . . . 21 B.2. v06 to v07 . . . . . . . . . . . . . . . . . . . . . . . 22
B.3. v04 to v05 . . . . . . . . . . . . . . . . . . . . . . . 21 B.3. v05 to v06 . . . . . . . . . . . . . . . . . . . . . . . 22
B.4. v03 to v04 . . . . . . . . . . . . . . . . . . . . . . . 21 B.4. v04 to v05 . . . . . . . . . . . . . . . . . . . . . . . 23
B.5. v02 to v03 . . . . . . . . . . . . . . . . . . . . . . . 22 B.5. v03 to v04 . . . . . . . . . . . . . . . . . . . . . . . 23
B.6. v01 to v02 . . . . . . . . . . . . . . . . . . . . . . . 22 B.6. v02 to v03 . . . . . . . . . . . . . . . . . . . . . . . 23
B.7. v00 to v01 . . . . . . . . . . . . . . . . . . . . . . . 22 B.7. v01 to v02 . . . . . . . . . . . . . . . . . . . . . . . 23
B.8. bierman:yang-patch-00 to ietf:yang-patch-00 . . . . . . . 23 B.8. v00 to v01 . . . . . . . . . . . . . . . . . . . . . . . 24
Appendix C. Open Issues . . . . . . . . . . . . . . . . . . . . 23 B.9. bierman:yang-patch-00 to ietf:yang-patch-00 . . . . . . . 24
Appendix D. Example YANG Module . . . . . . . . . . . . . . . . 23
D.1. YANG Patch Examples . . . . . . . . . . . . . . . . . . . 24 Appendix C. Open Issues . . . . . . . . . . . . . . . . . . . . 25
D.1.1. Add Resources: Error . . . . . . . . . . . . . . . . 24 Appendix D. Example YANG Module . . . . . . . . . . . . . . . . 25
D.1.2. Add Resources: Success . . . . . . . . . . . . . . . 27 D.1. YANG Patch Examples . . . . . . . . . . . . . . . . . . . 26
D.1.3. Move list entry example . . . . . . . . . . . . . . . 29 D.1.1. Add Resources: Error . . . . . . . . . . . . . . . . 26
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 29 D.1.2. Add Resources: Success . . . . . . . . . . . . . . . 29
D.1.3. Move list entry example . . . . . . . . . . . . . . . 30
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 31
1. Introduction 1. Introduction
There is a need for standard mechanisms to patch NETCONF [RFC6241] There is a need for standard mechanisms to patch datastores defined
datastores which contain conceptual data that conforms to schema in [RFC6241], which contain conceptual data that conforms to schema
specified with YANG [RFC6020]. An "ordered edit list" approach is specified with YANG [I-D.ietf-netmod-rfc6020bis]. An "ordered edit
needed to provide client developers with a simpler edit request list" approach is needed to provide client developers with more
format that can be more efficient and also allow more precise client precise client control of the edit procedure than existing
control of the transaction procedure than existing mechanisms. mechanisms.
This document defines a media type for a YANG-based editing mechanism This document defines a media type for a YANG-based editing mechanism
that can be used with the HTTP PATCH method [RFC5789]. YANG Patch is that can be used with the HTTP PATCH method [RFC5789]. YANG Patch is
designed to support the RESTCONF protocol, defined in designed to support the RESTCONF protocol, defined in
[I-D.ietf-netconf-restconf]. [I-D.ietf-netconf-restconf].
It may be possible to use YANG Patch with other protocols besides
RESTCONF. This is outside the scope of this document. It may be
possible to use YANG Patch with datastore types other than a
configuration datastore. This is outside the scope of this document.
1.1. Terminology 1.1. Terminology
The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in BCP "OPTIONAL" in this document are to be interpreted as described in BCP
14, [RFC2119]. 14, [RFC2119].
1.1.1. NETCONF 1.1.1. NETCONF
The following terms are defined in [RFC6241]: The following terms are defined in [RFC6241]:
skipping to change at page 4, line 18 skipping to change at page 4, line 36
o path o path
o query o query
o request URI o request URI
o response body o response body
1.1.3. YANG 1.1.3. YANG
The following terms are defined in [RFC6020]: The following terms are defined in [I-D.ietf-netmod-rfc6020bis]:
o container o container
o data node o data node
o key leaf o key leaf
o leaf o leaf
o leaf-list o leaf-list
skipping to change at page 6, line 14 skipping to change at page 6, line 29
For RESTCONF, the YANG Patch operation is invoked by the client by For RESTCONF, the YANG Patch operation is invoked by the client by
sending a PATCH method request with the YANG Patch media type. A sending a PATCH method request with the YANG Patch media type. A
message body representing the YANG Patch input parameters MUST be message body representing the YANG Patch input parameters MUST be
provided. provided.
The RESTCONF server MUST return the Accept-Patch header in an OPTIONS The RESTCONF server MUST return the Accept-Patch header in an OPTIONS
response, as specified in [RFC5789], which includes the media type response, as specified in [RFC5789], which includes the media type
for YANG Patch. for YANG Patch.
Example:
Accept-Patch: application/yang.patch
A YANG Patch can be encoded in XML format according to A YANG Patch can be encoded in XML format according to
[W3C.REC-xml-20081126]. It can also be encoded in JSON, according to [W3C.REC-xml-20081126]. It can also be encoded in JSON, according to
"JSON Encoding of Data Modeled with YANG" "JSON Encoding of Data Modeled with YANG"
[I-D.ietf-netmod-yang-json]. If any meta-data needs to be sent in a [I-D.ietf-netmod-yang-json]. If any meta-data needs to be sent in a
JSON message, it is encoded according to "Defining and Using Metadata JSON message, it is encoded according to "Defining and Using Metadata
with YANG" [I-D.ietf-netmod-yang-metadata]. with YANG" [I-D.ietf-netmod-yang-metadata].
Example:
Accept-Patch: application/yang.patch
2.1. Target Resource 2.1. Target Resource
The YANG Patch operation uses a conceptual root within a NETCONF The YANG Patch operation uses the RESTCONF target resource URI to
configuration datastore to identity the patch point for the edit identify the resource that will be patched. This can be the
operation. This root can be the datastore itself, or 1 or more data datastore resource itself, i.e., "{+restconf}/data", or it can be a
nodes within the datastore. configuration data resource within the datastore resource, e.g.,
{+restconf/data/ietf-interfaces:interfaces".
For RESTCONF, the target resource is derived from the request URI. Each edit with a YANG Patch identifies a target data node for the
associated edit. This is described in Section 2.4.
2.2. yang-patch Input 2.2. yang-patch Input
A YANG patch is optionally identified by a unique "patch-id" and it A YANG patch is optionally identified by a unique "patch-id" and it
may have an optional comment. A patch is an ordered collection of may have an optional comment. A patch is an ordered collection of
edits. Each edit is identified by an "edit-id" and it has an edit edits. Each edit is identified by an "edit-id" and it has an edit
operation (create, delete, insert, merge, move, replace, remove) that operation (create, delete, insert, merge, move, replace, remove) that
is applied to the target resource. Each edit can be applied to a is applied to the target resource. Each edit can be applied to a
sub-resource "target" within the target resource. If the operation sub-resource "target" within the target resource. If the operation
is "insert" or "move", then the "where" parameter indicates how the is "insert" or "move", then the "where" parameter indicates how the
node is inserted or moved. For values "before" and "after", the node is inserted or moved. For values "before" and "after", the
"point" parameter specifies the data node insertion point. "point" parameter specifies the data node insertion point.
skipping to change at page 7, line 49 skipping to change at page 8, line 17
+--:(errors) +--:(errors)
+--ro errors +--ro errors
2.4. Target Data Node 2.4. Target Data Node
The target data node for each edit operation is determined by the The target data node for each edit operation is determined by the
value of the target resource in the request and the "target" leaf value of the target resource in the request and the "target" leaf
within each "edit" entry. within each "edit" entry.
If the target resource specified in the request URI identifies a If the target resource specified in the request URI identifies a
datastore resource, then the path string in the "target" leaf is an datastore resource, then the path string in the "target" leaf is
absolute path expression. The first node specified in the "target" treated as an absolute path expression identifying the target data
leaf is a top-level data node defined within a YANG module. node for the corresponding edit. The first node specified in the
"target" leaf is a top-level data node defined within a YANG module.
The "target" leaf MUST NOT contain a single forward slash "/", since
this would identify the datastore resource, not a data resource.
If the target resource specified in the request URI identifies a data If the target resource specified in the request URI identifies a
resource, then the path string in the "target" leaf is a relative configuration data resource, then the path string in the "target"
path expression. The first node specified in the "target" leaf is a leaf is treated as a relative path expression. The first node
child node of the data node associated with the target resource. specified in the "target" leaf is a child configuration data node of
the data node associated with the target resource. If the "target"
leaf contains a single forward slash "/", then the target data node
is the target resource data node.
2.5. Edit Operations 2.5. Edit Operations
Each YANG patch edit specifies one edit operation on the target data Each YANG patch edit specifies one edit operation on the target data
node. The set of operations is aligned with the NETCONF edit node. The set of operations is aligned with the NETCONF edit
operations, but also includes some new operations. operations, but also includes some new operations.
+---------------+---------------------------------------------------+ +---------------+---------------------------------------------------+
| Operation | Description | | Operation | Description |
+---------------+---------------------------------------------------+ +---------------+---------------------------------------------------+
skipping to change at page 8, line 35 skipping to change at page 9, line 9
| | resource; create if it does not already exist | | | resource; create if it does not already exist |
| move | re-order the target data resource | | move | re-order the target data resource |
| replace | replace the target data resource with the edit | | replace | replace the target data resource with the edit |
| | value | | | value |
| remove | remove a data resource if it already exists or no | | remove | remove a data resource if it already exists or no |
| | error | | | error |
+---------------+---------------------------------------------------+ +---------------+---------------------------------------------------+
YANG Patch Edit Operations YANG Patch Edit Operations
2.6. Error Handling 2.6. Successful Edit Response Handling
If a YANG Patch is completed without errors, the server MUST return a
"200 OK" status-line, and a response message-body containing a
"yang-patch-status" message.
The server will save the running datastore to non-volatile storage if
it supports non-volatile storage, and if the running datastore
contents have changed. This will be done in an implementation-
specific manner.
Refer to Appendix D.1.2 for a example of a successful YANG Patch
response.
2.7. Error Handling
If a well-formed, schema-valid YANG Patch message is received, then If a well-formed, schema-valid YANG Patch message is received, then
the server will process the supplied edits in ascending order. The the server will process the supplied edits in ascending order. The
following error modes apply to the processing of this edit list: following error modes apply to the processing of this edit list:
All the specified edits MUST be applied or the target datastore All the specified edits MUST be applied or the target datastore
contents MUST be returned to its original state before the PATCH contents MUST be returned to its original state before the PATCH
method started. method started.
The server will save the running datastore to non-volatile storage if If a YANG Patch is completed with errors, the server MUST return a
it has changed, after the edits have been successfully completed. "200 OK" status-line, and a response message-body containing a
"yang-patch-status" message.
2.7. yang-patch RESTCONF Capability Refer to Appendix D.1.1 for a example of an error YANG Patch
response.
2.8. yang-patch RESTCONF Capability
A URI is defined to identify the YANG Patch extension to the base A URI is defined to identify the YANG Patch extension to the base
RESTCONF protocol. If the server supports the YANG Patch media type, RESTCONF protocol. If the server supports the YANG Patch media type,
then the "yang-patch" RESTCONF capability defined in Section 4.4 MUST then the "yang-patch" RESTCONF capability defined in Section 4.4 MUST
be present in the "capability" leaf-list in the be present in the "capability" leaf-list in the
"ietf-restconf-monitoring" module defined in "ietf-restconf-monitoring" module defined in
[I-D.ietf-netconf-restconf]. [I-D.ietf-netconf-restconf].
3. YANG Module 3. YANG Module
The "ietf-yang-patch" module defines conceptual definitions with the The "ietf-yang-patch" module defines conceptual definitions with the
'restconf-media-type' extension statements, which are not meant to be 'restconf-media-type' extension statements, which are not meant to be
implemented as datastore contents by a server. implemented as datastore contents by a server.
The "ietf-restconf" module from [I-D.ietf-netconf-restconf] is used The "ietf-restconf" module from [I-D.ietf-netconf-restconf] is used
by this module for the 'restconf-media-type' extension definition. by this module for the 'restconf-media-type' extension definition.
RFC Ed.: update the date below with the date of RFC publication and RFC Ed.: update the date below with the date of RFC publication and
remove this note. remove this note.
skipping to change at page 9, line 26 skipping to change at page 10, line 14
The "ietf-yang-patch" module defines conceptual definitions with the The "ietf-yang-patch" module defines conceptual definitions with the
'restconf-media-type' extension statements, which are not meant to be 'restconf-media-type' extension statements, which are not meant to be
implemented as datastore contents by a server. implemented as datastore contents by a server.
The "ietf-restconf" module from [I-D.ietf-netconf-restconf] is used The "ietf-restconf" module from [I-D.ietf-netconf-restconf] is used
by this module for the 'restconf-media-type' extension definition. by this module for the 'restconf-media-type' extension definition.
RFC Ed.: update the date below with the date of RFC publication and RFC Ed.: update the date below with the date of RFC publication and
remove this note. remove this note.
<CODE BEGINS> file "ietf-yang-patch@2015-04-30.yang" <CODE BEGINS> file "ietf-yang-patch@2016-03-16.yang"
module ietf-yang-patch { module ietf-yang-patch {
yang-version 1.1; yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-yang-patch"; namespace "urn:ietf:params:xml:ns:yang:ietf-yang-patch";
prefix "ypatch"; prefix "ypatch";
import ietf-yang-types { prefix yang; } import ietf-yang-types { prefix yang; }
import ietf-restconf { import ietf-restconf {
prefix rc; prefix rc;
revision-date 2015-10-18; revision-date 2016-03-16;
} }
organization organization
"IETF NETCONF (Network Configuration) Working Group"; "IETF NETCONF (Network Configuration) Working Group";
contact contact
"WG Web: <http://tools.ietf.org/wg/netconf/> "WG Web: <http://tools.ietf.org/wg/netconf/>
WG List: <mailto:netconf@ietf.org> WG List: <mailto:netconf@ietf.org>
WG Chair: Mehmet Ersue WG Chair: Mehmet Ersue
skipping to change at page 10, line 23 skipping to change at page 11, line 11
description description
"This module contains conceptual YANG specifications "This module contains conceptual YANG specifications
for the YANG Patch and YANG Patch Status data structures. for the YANG Patch and YANG Patch Status data structures.
Note that the YANG definitions within this module do not Note that the YANG definitions within this module do not
represent configuration data of any kind. represent configuration data of any kind.
The YANG grouping statements provide a normative syntax The YANG grouping statements provide a normative syntax
for XML and JSON message encoding purposes. for XML and JSON message encoding purposes.
Copyright (c) 2015 IETF Trust and the persons identified as Copyright (c) 2016 IETF Trust and the persons identified as
authors of the code. All rights reserved. authors of the code. All rights reserved.
Redistribution and use in source and binary forms, with or Redistribution and use in source and binary forms, with or
without modification, is permitted pursuant to, and subject without modification, is permitted pursuant to, and subject
to the license terms contained in, the Simplified BSD License to the license terms contained in, the Simplified BSD License
set forth in Section 4.c of the IETF Trust's Legal Provisions set forth in Section 4.c of the IETF Trust's Legal Provisions
Relating to IETF Documents Relating to IETF Documents
(http://trustee.ietf.org/license-info). (http://trustee.ietf.org/license-info).
This version of this YANG module is part of RFC XXXX; see This version of this YANG module is part of RFC XXXX; see
the RFC itself for full legal notices."; the RFC itself for full legal notices.";
// RFC Ed.: replace XXXX with actual RFC number and remove this // RFC Ed.: replace XXXX with actual RFC number and remove this
// note. // note.
// RFC Ed.: remove this note // RFC Ed.: remove this note
// Note: extracted from draft-ietf-netconf-yang-patch-07.txt // Note: extracted from draft-ietf-netconf-yang-patch-08.txt
// RFC Ed.: update the date below with the date of RFC publication // RFC Ed.: update the date below with the date of RFC publication
// and remove this note. // and remove this note.
revision 2015-12-15 { revision 2016-03-16 {
description description
"Initial revision."; "Initial revision.";
reference reference
"RFC XXXX: YANG Patch Media Type."; "RFC XXXX: YANG Patch Media Type.";
} }
typedef target-resource-offset { typedef target-resource-offset {
type yang:xpath1.0; type yang:xpath1.0;
description description
"Contains an XPath absolute path expression identifying "Contains an XPath absolute path expression identifying
skipping to change at page 11, line 36 skipping to change at page 12, line 24
container yang-patch { container yang-patch {
description description
"Represents a conceptual sequence of datastore edits, "Represents a conceptual sequence of datastore edits,
called a patch. Each patch is given a client-assigned called a patch. Each patch is given a client-assigned
patch identifier. Each edit MUST be applied patch identifier. Each edit MUST be applied
in ascending order, and all edits MUST be applied. in ascending order, and all edits MUST be applied.
If any errors occur, then the target datastore MUST NOT If any errors occur, then the target datastore MUST NOT
be changed by the patch operation. be changed by the patch operation.
YANG datastore validation (defined in RFC 6020, section YANG datastore validation is performed before any edits
8.3.3) is performed before any edits have been applied have been applied to the running datastore.
to the running datastore.
It is possible for a datastore constraint violation to occur It is possible for a datastore constraint violation to occur
due to any node in the datastore, including nodes not due to any node in the datastore, including nodes not
included in the edit list. Any validation errors MUST included in the edit list. Any validation errors MUST
be reported in the reply message."; be reported in the reply message.";
reference reference
"RFC 6020, section 8.3."; "draft-ietf-netmod-rfc6020bis, section 8.3.";
leaf patch-id { leaf patch-id {
type string; type string;
description description
"An arbitrary string provided by the client to identify "An arbitrary string provided by the client to identify
the entire patch. This value SHOULD be present in any the entire patch. This value SHOULD be present in any
audit logging records generated by the server for the audit logging records generated by the server for the
patch. Error messages returned by the server pertaining patch. Error messages returned by the server pertaining
to this patch will be identified by this patch-id value."; to this patch will be identified by this patch-id value.";
} }
skipping to change at page 13, line 5 skipping to change at page 13, line 41
to a specific edit will be identified by this to a specific edit will be identified by this
value."; value.";
} }
leaf operation { leaf operation {
type enumeration { type enumeration {
enum create { enum create {
description description
"The target data node is created using the "The target data node is created using the
supplied value, only if it does not already supplied value, only if it does not already
exist."; exist.get' leaf identifies the data node to be
created, not the parent data node.";
} }
enum delete { enum delete {
description description
"Delete the target node, only if the data resource "Delete the target node, only if the data resource
currently exists, otherwise return an error."; currently exists, otherwise return an error.";
} }
enum insert { enum insert {
description description
"Insert the supplied value into a user-ordered "Insert the supplied value into a user-ordered
list or leaf-list entry. The target node must list or leaf-list entry. The target node must
skipping to change at page 14, line 7 skipping to change at page 14, line 43
mandatory true; mandatory true;
description description
"The datastore operation requested for the associated "The datastore operation requested for the associated
edit entry"; edit entry";
} }
leaf target { leaf target {
type target-resource-offset; type target-resource-offset;
mandatory true; mandatory true;
description description
"Identifies the target data resource for the edit "Identifies the target data node for the edit
operation."; operation. If the target has the value '/', then
the target data node is the target resource.
The target node MUST identify a data resource,
not the datastore resource.";
} }
leaf point { leaf point {
when "(../operation = 'insert' or ../operation = 'move') " when "(../operation = 'insert' or ../operation = 'move') "
+ "and (../where = 'before' or ../where = 'after')" { + "and (../where = 'before' or ../where = 'after')" {
description description
"Point leaf only applies for insert or move "Point leaf only applies for insert or move
operations, before or after an existing entry."; operations, before or after an existing entry.";
} }
type target-resource-offset; type target-resource-offset;
skipping to change at page 15, line 36 skipping to change at page 16, line 26
'target' leaf. 'target' leaf.
For example, suppose the target node is a YANG container For example, suppose the target node is a YANG container
named foo: named foo:
container foo { container foo {
leaf a { type string; } leaf a { type string; }
leaf b { type int32; } leaf b { type int32; }
} }
The 'value' node will contain one instance of foo: The 'value' node contains one instance of foo:
<value> <value>
<foo xmlns='example-foo-namespace'> <foo xmlns='example-foo-namespace'>
<a>some value</a> <a>some value</a>
<b>42</b> <b>42</b>
</foo> </foo>
</value> </value>
"; ";
} }
} }
skipping to change at page 16, line 18 skipping to change at page 17, line 10
container yang-patch-status { container yang-patch-status {
description description
"A container representing the response message "A container representing the response message
sent by the server after a YANG Patch edit sent by the server after a YANG Patch edit
request message has been processed."; request message has been processed.";
leaf patch-id { leaf patch-id {
type string; type string;
description description
"The patch-id value used in the request"; "The patch-id value used in the request.
If there was no patch-id present in the request
then this field will not be present.";
} }
choice global-status { choice global-status {
description description
"Report global errors or complete success. "Report global errors or complete success.
If there is no case selected then errors If there is no case selected then errors
are reported in the edit-status container."; are reported in the edit-status container.";
case global-errors { case global-errors {
uses rc:errors; uses rc:errors;
skipping to change at page 18, line 4 skipping to change at page 18, line 41
} }
} }
} }
} // grouping yang-patch-status } // grouping yang-patch-status
} }
<CODE ENDS> <CODE ENDS>
4. IANA Considerations 4. IANA Considerations
4.1. YANG Module Registry 4.1. YANG Module Registry
This document registers one URI in the IETF XML registry [RFC3688]. This document registers one URI in the IETF XML registry [RFC3688].
Following the format in RFC 3688, the following registration is Following the format in RFC 3688, the following registration is
requested to be made. requested to be made.
URI: urn:ietf:params:xml:ns:yang:ietf-yang-patch URI: urn:ietf:params:xml:ns:yang:ietf-yang-patch
Registrant Contact: The NETMOD WG of the IETF. Registrant Contact: The NETCONF WG of the IETF.
XML: N/A, the requested URI is an XML namespace. XML: N/A, the requested URI is an XML namespace.
This document registers one YANG module in the YANG Module Names This document registers one YANG module in the YANG Module Names
registry [RFC6020]. registry [RFC6020].
name: ietf-yang-patch name: ietf-yang-patch
namespace: urn:ietf:params:xml:ns:yang:ietf-yang-patch namespace: urn:ietf:params:xml:ns:yang:ietf-yang-patch
prefix: ypatch prefix: ypatch
// RFC Ed.: replace XXXX with RFC number and remove this note // RFC Ed.: replace XXXX with RFC number and remove this note
reference: RFC XXXX reference: RFC XXXX
skipping to change at page 19, line 39 skipping to change at page 20, line 29
urn:ietf:params:restconf:capability:yang-patch:1.0 urn:ietf:params:restconf:capability:yang-patch:1.0
5. Security Considerations 5. Security Considerations
The YANG Patch media type does not introduce any significant new The YANG Patch media type does not introduce any significant new
security threats, beyond what is described in security threats, beyond what is described in
[I-D.ietf-netconf-restconf]. This document defines edit processing [I-D.ietf-netconf-restconf]. This document defines edit processing
instructions for a variant of the PATCH method, as used within the instructions for a variant of the PATCH method, as used within the
RESTCONF protocol. RESTCONF protocol.
It may be possible to use YANG Patch with other protocols besides
RESTCONF, which is outside the scope of this document.
It is important for server implementations to carefully validate all It is important for server implementations to carefully validate all
the edit request parameters in some manner. If the entire YANG Patch the edit request parameters in some manner. If the entire YANG Patch
request cannot be completed, then no configuration changes to the request cannot be completed, then no configuration changes to the
system are done. system are done.
A server implementation SHOULD attempt to prevent system disruption A server implementation SHOULD attempt to prevent system disruption
due to partial processing of the YANG Patch edit list. It may be due to partial processing of the YANG Patch edit list. It may be
possible to construct an attack on such a server, which relies on the possible to construct an attack on such a server, which relies on the
edit processing order mandated by YANG Patch. edit processing order mandated by YANG Patch.
6. Normative References 6. Normative References
[I-D.ietf-netconf-restconf] [I-D.ietf-netconf-restconf]
Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF
Protocol", draft-ietf-netconf-restconf-08 (work in Protocol", draft-ietf-netconf-restconf-08 (work in
progress), October 2015. progress), October 2015.
[I-D.ietf-netmod-rfc6020bis]
Bjorklund, M., "The YANG 1.1 Data Modeling Language",
draft-ietf-netmod-rfc6020bis-11 (work in progress),
February 2016.
[I-D.ietf-netmod-yang-json] [I-D.ietf-netmod-yang-json]
Lhotka, L., "JSON Encoding of Data Modeled with YANG", Lhotka, L., "JSON Encoding of Data Modeled with YANG",
draft-ietf-netmod-yang-json-06 (work in progress), October draft-ietf-netmod-yang-json-06 (work in progress), October
2015. 2015.
[I-D.ietf-netmod-yang-metadata] [I-D.ietf-netmod-yang-metadata]
Lhotka, L., "Defining and Using Metadata with YANG", Lhotka, L., "Defining and Using Metadata with YANG",
draft-ietf-netmod-yang-metadata-02 (work in progress), draft-ietf-netmod-yang-metadata-02 (work in progress),
September 2015. September 2015.
skipping to change at page 21, line 21 skipping to change at page 22, line 21
those of the author(s) and do not necessarily reflect the views of those of the author(s) and do not necessarily reflect the views of
The Space & Terrestrial Communications Directorate (S&TCD). The Space & Terrestrial Communications Directorate (S&TCD).
Appendix B. Change Log Appendix B. Change Log
-- RFC Ed.: remove this section before publication. -- RFC Ed.: remove this section before publication.
The YANG Patch issue tracker can be found here: https://github.com/ The YANG Patch issue tracker can be found here: https://github.com/
netconf-wg/yang-patch/issues netconf-wg/yang-patch/issues
B.1. v06 to v07 B.1. v07 to v08
o clarified target datastore and target data node terms
o clarified that target leaf can be single forward slash '/'
o added Successful edit response handling section
o clarified that YANG Patch draft is for RESTCONF protocol only but
may be defined for other protocols outside this document
o clarified that YANG Patch draft is for configuration datastores
only but may be defined for other datastore types outside this
document
o fixed typos
B.2. v06 to v07
o converted YANG module to YANG 1.1 o converted YANG module to YANG 1.1
o changed anyxml value to anydata value o changed anyxml value to anydata value
o updated import revision date for ietf-restconf o updated import revision date for ietf-restconf
o updated revision date for ietf-yang-patch because import-by- o updated revision date for ietf-yang-patch because import-by-
revision date needed to be changed revision date needed to be changed
B.2. v05 to v06 B.3. v05 to v06
o changed errors example so a full request and error response is o changed errors example so a full request and error response is
shown in XML format shown in XML format
o fixed error-path to match instance-identifier encoding for both o fixed error-path to match instance-identifier encoding for both
XML and JSON XML and JSON
o added references for YANG to JSON and YANG Metadata drafts o added references for YANG to JSON and YANG Metadata drafts
o clarified that YANG JSON drafts are used for encoding, not plain o clarified that YANG JSON drafts are used for encoding, not plain
JSON JSON
B.3. v04 to v05 B.4. v04 to v05
o updated reference to RESTCONF o updated reference to RESTCONF
B.4. v03 to v04 B.5. v03 to v04
o removed NETCONF specific text o removed NETCONF specific text
o changed data-resource-offset typedef from a relative URI to an o changed data-resource-offset typedef from a relative URI to an
XPath absolute path expression XPath absolute path expression
o clarified insert operation o clarified insert operation
o removed requirement that edits MUST be applied in ascending order o removed requirement that edits MUST be applied in ascending order
o change SHOULD keep datastore unchanged on error to MUST (this is o change SHOULD keep datastore unchanged on error to MUST (this is
required by HTTP PATCH) required by HTTP PATCH)
skipping to change at page 22, line 18 skipping to change at page 23, line 37
o removed requirement that edits MUST be applied in ascending order o removed requirement that edits MUST be applied in ascending order
o change SHOULD keep datastore unchanged on error to MUST (this is o change SHOULD keep datastore unchanged on error to MUST (this is
required by HTTP PATCH) required by HTTP PATCH)
o removed length restriction on 'comment' leaf o removed length restriction on 'comment' leaf
o updated YANG tree for example-jukebox library o updated YANG tree for example-jukebox library
B.5. v02 to v03 B.6. v02 to v03
o added usage of restconf-media-type extension to map the yang-patch o added usage of restconf-media-type extension to map the yang-patch
and yang-patch-status groupings to media types and yang-patch-status groupings to media types
o added yang-patch RESTCONF capability URI o added yang-patch RESTCONF capability URI
o Added sub-section for terms used from RESTCONF o Added sub-section for terms used from RESTCONF
o filled in security considerations section o filled in security considerations section
B.6. v01 to v02 B.7. v01 to v02
o Reversed order of change log o Reversed order of change log
o Clarified anyxml structure of "value" parameter within a YANG o Clarified anyxml structure of "value" parameter within a YANG
patch request (github issue #1) patch request (github issue #1)
o Updated RESTCONF reference o Updated RESTCONF reference
o Added note to open issues section to check github instead o Added note to open issues section to check github instead
B.7. v00 to v01 B.8. v00 to v01
o Added text requiring support for Accept-Patch header, and removed o Added text requiring support for Accept-Patch header, and removed
'Identification of YANG Patch capabilities' open issue. 'Identification of YANG Patch capabilities' open issue.
o Removed 'location' leaf from yang-patch-status grouping o Removed 'location' leaf from yang-patch-status grouping
o Removed open issue 'Protocol independence' because the location o Removed open issue 'Protocol independence' because the location
leaf was removed. leaf was removed.
o Removed open issue 'RESTCONF coupling' because there is no concern o Removed open issue 'RESTCONF coupling' because there is no concern
skipping to change at page 23, line 30 skipping to change at page 24, line 49
o Removed open issue 'Bulk editing support in yang-patch-status'. o Removed open issue 'Bulk editing support in yang-patch-status'.
The 'location' leaf has been removed so this issue is no longer The 'location' leaf has been removed so this issue is no longer
applicable. applicable.
o Removed open issue 'Edit list mechanism'. Added text to the o Removed open issue 'Edit list mechanism'. Added text to the
'edit' list description-stmt about how the individual edits must 'edit' list description-stmt about how the individual edits must
be processed. There is no concern about duplicate edits which be processed. There is no concern about duplicate edits which
cause intermediate results to be altered by subsequent edits in cause intermediate results to be altered by subsequent edits in
the same edit list. the same edit list.
B.8. bierman:yang-patch-00 to ietf:yang-patch-00 B.9. bierman:yang-patch-00 to ietf:yang-patch-00
o Created open issues section o Created open issues section
Appendix C. Open Issues Appendix C. Open Issues
-- RFC Ed.: remove this section before publication. -- RFC Ed.: remove this section before publication.
Refer to the github issue tracker for any open issues: Refer to the github issue tracker for any open issues:
https://github.com/netconf-wg/yang-patch/issues [1] https://github.com/netconf-wg/yang-patch/issues
Appendix D. Example YANG Module Appendix D. Example YANG Module
The example YANG module used in this document represents a simple The example YANG module used in this document represents a simple
media jukebox interface. The "example-jukebox" YANG module is media jukebox interface. The "example-jukebox" YANG module is
defined in [I-D.ietf-netconf-restconf]. defined in [I-D.ietf-netconf-restconf].
YANG Tree Diagram for "example-jukebox" Module: YANG Tree Diagram for "example-jukebox" Module:
+--rw jukebox! +--rw jukebox!
 End of changes. 54 change blocks. 
92 lines changed or deleted 155 lines changed or added

This html diff was produced by rfcdiff 1.44. The latest version is available from http://tools.ietf.org/tools/rfcdiff/