draft-ietf-netconf-yang-patch-11.txt   draft-ietf-netconf-yang-patch-12.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: February 16, 2017 Tail-f Systems Expires: April 1, 2017 Tail-f Systems
K. Watsen K. Watsen
Juniper Networks Juniper Networks
August 15, 2016 September 28, 2016
YANG Patch Media Type YANG Patch Media Type
draft-ietf-netconf-yang-patch-11 draft-ietf-netconf-yang-patch-12
Abstract Abstract
This document describes a method for applying patches to This document describes a method for applying patches to
configuration datastores using data defined with the YANG data configuration datastores using data defined with the YANG data
modeling language. 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
skipping to change at page 1, line 35 skipping to change at page 1, line 35
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 February 16, 2017. This Internet-Draft will expire on April 1, 2017.
Copyright Notice Copyright Notice
Copyright (c) 2016 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
skipping to change at page 2, line 17 skipping to change at page 2, line 17
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 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 . . . . . . . . . . . . . . . . . . . . . . . . 4 1.1.2. HTTP . . . . . . . . . . . . . . . . . . . . . . . . 4
1.1.3. YANG . . . . . . . . . . . . . . . . . . . . . . . . 4 1.1.3. YANG . . . . . . . . . . . . . . . . . . . . . . . . 4
1.1.4. RESTCONF . . . . . . . . . . . . . . . . . . . . . . 4 1.1.4. RESTCONF . . . . . . . . . . . . . . . . . . . . . . 4
1.1.5. YANG Patch . . . . . . . . . . . . . . . . . . . . . 5 1.1.5. YANG Patch . . . . . . . . . . . . . . . . . . . . . 5
1.1.6. Examples . . . . . . . . . . . . . . . . . . . . . . 5 1.1.6. Examples . . . . . . . . . . . . . . . . . . . . . . 5
1.1.7. Tree Diagrams . . . . . . . . . . . . . . . . . . . . 6 1.1.7. Tree Diagram Notations . . . . . . . . . . . . . . . 6
2. YANG Patch . . . . . . . . . . . . . . . . . . . . . . . . . 6 2. YANG Patch . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.1. Target Resource . . . . . . . . . . . . . . . . . . . . . 7 2.1. Target Resource . . . . . . . . . . . . . . . . . . . . . 7
2.2. yang-patch Input . . . . . . . . . . . . . . . . . . . . 7 2.2. yang-patch Request . . . . . . . . . . . . . . . . . . . 8
2.3. yang-patch-status Output . . . . . . . . . . . . . . . . 8 2.3. yang-patch-status Response . . . . . . . . . . . . . . . 9
2.4. Target Data Node . . . . . . . . . . . . . . . . . . . . 9 2.4. Target Data Node . . . . . . . . . . . . . . . . . . . . 10
2.5. Edit Operations . . . . . . . . . . . . . . . . . . . . . 10 2.5. Edit Operations . . . . . . . . . . . . . . . . . . . . . 11
2.6. Successful Edit Response Handling . . . . . . . . . . . . 10 2.6. Successful Edit Response Handling . . . . . . . . . . . . 11
2.7. Error Handling . . . . . . . . . . . . . . . . . . . . . 10 2.7. Error Handling . . . . . . . . . . . . . . . . . . . . . 11
2.8. yang-patch RESTCONF Capability . . . . . . . . . . . . . 11 2.8. yang-patch RESTCONF Capability . . . . . . . . . . . . . 12
3. YANG Module . . . . . . . . . . . . . . . . . . . . . . . . . 11 3. YANG Module . . . . . . . . . . . . . . . . . . . . . . . . . 12
4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 20 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 21
4.1. YANG Module Registry . . . . . . . . . . . . . . . . . . 20 4.1. YANG Module Registry . . . . . . . . . . . . . . . . . . 21
4.2. Media Types . . . . . . . . . . . . . . . . . . . . . . . 20 4.2. Media Types . . . . . . . . . . . . . . . . . . . . . . . 21
4.2.1. Media Type application/yang-patch-xml . . . . . . . . 20 4.2.1. Media Type application/yang-patch+xml . . . . . . . . 21
4.2.2. Media Type application/yang-patch+json . . . . . . . 22 4.2.2. Media Type application/yang-patch+json . . . . . . . 23
4.3. RESTCONF Capability URNs . . . . . . . . . . . . . . . . 24 4.3. RESTCONF Capability URNs . . . . . . . . . . . . . . . . 24
5. Security Considerations . . . . . . . . . . . . . . . . . . . 24 5. Security Considerations . . . . . . . . . . . . . . . . . . . 25
6. Normative References . . . . . . . . . . . . . . . . . . . . 24 6. Normative References . . . . . . . . . . . . . . . . . . . . 25
Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 26 Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 26
Appendix B. Change Log . . . . . . . . . . . . . . . . . . . . . 26 Appendix B. Change Log . . . . . . . . . . . . . . . . . . . . . 27
B.1. v10 to v11 . . . . . . . . . . . . . . . . . . . . . . . 26 B.1. v11 to v12 . . . . . . . . . . . . . . . . . . . . . . . 27
B.2. v09 to v10 . . . . . . . . . . . . . . . . . . . . . . . 26 B.2. v10 to v11 . . . . . . . . . . . . . . . . . . . . . . . 27
B.3. v08 to v09 . . . . . . . . . . . . . . . . . . . . . . . 27 B.3. v09 to v10 . . . . . . . . . . . . . . . . . . . . . . . 28
B.4. v07 to v08 . . . . . . . . . . . . . . . . . . . . . . . 27 B.4. v08 to v09 . . . . . . . . . . . . . . . . . . . . . . . 28
B.5. v06 to v07 . . . . . . . . . . . . . . . . . . . . . . . 27 B.5. v07 to v08 . . . . . . . . . . . . . . . . . . . . . . . 28
B.6. v05 to v06 . . . . . . . . . . . . . . . . . . . . . . . 28 B.6. v06 to v07 . . . . . . . . . . . . . . . . . . . . . . . 28
B.7. v04 to v05 . . . . . . . . . . . . . . . . . . . . . . . 28 B.7. v05 to v06 . . . . . . . . . . . . . . . . . . . . . . . 29
B.8. v03 to v04 . . . . . . . . . . . . . . . . . . . . . . . 28 B.8. v04 to v05 . . . . . . . . . . . . . . . . . . . . . . . 29
B.9. v02 to v03 . . . . . . . . . . . . . . . . . . . . . . . 28 B.9. v03 to v04 . . . . . . . . . . . . . . . . . . . . . . . 29
B.10. v01 to v02 . . . . . . . . . . . . . . . . . . . . . . . 29 B.10. v02 to v03 . . . . . . . . . . . . . . . . . . . . . . . 29
B.11. v00 to v01 . . . . . . . . . . . . . . . . . . . . . . . 29 B.11. v01 to v02 . . . . . . . . . . . . . . . . . . . . . . . 30
B.12. bierman:yang-patch-00 to ietf:yang-patch-00 . . . . . . . 30 B.12. v00 to v01 . . . . . . . . . . . . . . . . . . . . . . . 30
Appendix C. Open Issues . . . . . . . . . . . . . . . . . . . . 30 B.13. bierman:yang-patch-00 to ietf:yang-patch-00 . . . . . . . 31
Appendix D. Example YANG Module . . . . . . . . . . . . . . . . 30 Appendix C. Open Issues . . . . . . . . . . . . . . . . . . . . 31
D.1. YANG Patch Examples . . . . . . . . . . . . . . . . . . . 31 Appendix D. Example YANG Module . . . . . . . . . . . . . . . . 31
D.1.1. Add Resources: Error . . . . . . . . . . . . . . . . 31 D.1. YANG Patch Examples . . . . . . . . . . . . . . . . . . . 32
D.1.2. Add Resources: Success . . . . . . . . . . . . . . . 34 D.1.1. Add Resources: Error . . . . . . . . . . . . . . . . 32
D.1.3. Insert list entry example . . . . . . . . . . . . . . 36 D.1.2. Add Resources: Success . . . . . . . . . . . . . . . 36
D.1.4. Move list entry example . . . . . . . . . . . . . . . 38 D.1.3. Insert list entry example . . . . . . . . . . . . . . 38
D.1.5. Edit datastore resource example . . . . . . . . . . . 39 D.1.4. Move list entry example . . . . . . . . . . . . . . . 40
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 41 D.1.5. Edit datastore resource example . . . . . . . . . . . 41
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 43
1. Introduction 1. Introduction
There is a need for standard mechanisms to patch datastores defined There is a need for standard mechanisms to patch datastores defined
in [RFC6241], which contain conceptual data that conforms to schema in [RFC6241], which contain conceptual data that conforms to schema
specified with YANG [I-D.ietf-netmod-rfc6020bis]. An "ordered edit specified with YANG [RFC7950]. An "ordered edit list" approach is
list" approach is needed to provide RESTCONF client developers with needed to provide RESTCONF client developers with more precise
more precise RESTCONF client control of the edit procedure than RESTCONF client control of the edit procedure than existing
existing mechanisms found in [I-D.ietf-netconf-restconf]. mechanisms found in [I-D.ietf-netconf-restconf].
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 It may be possible to use YANG Patch with other protocols besides
RESTCONF. This is outside the scope of this document. It may be RESTCONF. This is outside the scope of this document. It may be
possible to use YANG Patch with datastore types other than a possible to use YANG Patch with datastore types other than a
configuration datastore. This is outside the scope of this document. configuration datastore. This is outside the scope of this document.
skipping to change at page 4, line 30 skipping to change at page 4, line 30
The following terms are defined in [RFC7231]: The following terms are defined in [RFC7231]:
o method o method
o request o request
o resource o resource
1.1.3. YANG 1.1.3. YANG
The following terms are defined in [I-D.ietf-netmod-rfc6020bis]: The following terms are defined in [RFC7950]:
o container o container
o data node o data node
o leaf o leaf
o leaf-list o leaf-list
o list o list
o RPC operation (now called protocol operation) o RPC operation (now called protocol operation)
1.1.4. RESTCONF 1.1.4. RESTCONF
The following terms are defined in [I-D.ietf-netconf-restconf]: The following terms are defined in [I-D.ietf-netconf-restconf]:
o application/yang-data o application/yang-data+xml
o application/yang-data+json o application/yang-data+json
o data resource o data resource
o datastore resource o datastore resource
o patch o patch
o RESTCONF capability o RESTCONF capability
skipping to change at page 5, line 27 skipping to change at page 5, line 27
The following terms are used within this document: The following terms are used within this document:
o RESTCONF client: a client which implements the RESTCONF protocol. o RESTCONF client: a client which implements the RESTCONF protocol.
o RESTCONF server: a server which implements the RESTCONF protocol. o RESTCONF server: a server which implements the RESTCONF protocol.
o YANG Patch: a conceptual edit request using the "yang-patch" YANG o YANG Patch: a conceptual edit request using the "yang-patch" YANG
Patch template, defined in Section 3. In HTTP, refers to a PATCH Patch template, defined in Section 3. In HTTP, refers to a PATCH
method where a representation uses either the media type method where a representation uses either the media type
"application/yang-patch-xml" or "application/yang-patch+json". "application/yang-patch+xml" or "application/yang-patch+json".
o YANG Patch Status: a conceptual edit status response using the o YANG Patch Status: a conceptual edit status response using the
YANG "yang-patch-status" YANG data template, defined in Section 3. YANG "yang-patch-status" YANG data template, defined in Section 3.
In HTTP, refers to a response message for a PATCH method, where it In HTTP, refers to a response message for a PATCH method, where it
has a representation with either the media type "application/ has a representation with either the media type "application/
yang-data" or "application/yang-data+json". yang-data+xml" or "application/yang-data+json".
o YANG Patch template: this is similar to a YANG data template, o YANG Patch template: this is similar to a YANG data template,
except it has a representation with the media type "application/ except it has a representation with the media type "application/
yang-patch-xml" or "application/yang-patch+json". yang-patch+xml" or "application/yang-patch+json".
1.1.6. Examples 1.1.6. Examples
Some protocol message lines within examples throughout the document Some protocol message lines within examples throughout the document
are split into multiple lines for display purposes only. When a line are split into multiple lines for display purposes only. When a line
ends with backslash ('\') as the last character, the line is wrapped ends with backslash ('\') as the last character, the line is wrapped
for display purposes. It is to be considered to be joined to the for display purposes. It is to be considered to be joined to the
next line by deleting the backslash, the following line break, and next line by deleting the backslash, the following line break, and
the leading whitespace of the next line. the leading whitespace of the next line.
1.1.7. Tree Diagrams 1.1.7. Tree Diagram Notations
A simplified graphical representation of the data model is used in A simplified graphical representation of the data model is used in
this document. The meaning of the symbols in these diagrams is as this document. The meaning of the symbols in these diagrams is as
follows: follows:
o Brackets "[" and "]" enclose list keys. o Brackets "[" and "]" enclose list keys.
o Abbreviations before data node names: "rw" means configuration o Abbreviations before data node names: "rw" means configuration
data (read-write), "ro" state data (read-only), and "x" operation data (read-write), "ro" state data (read-only), and "x" operation
resource (executable) resource (executable)
skipping to change at page 6, line 34 skipping to change at page 6, line 34
shown. shown.
2. YANG Patch 2. YANG Patch
A "YANG Patch" is an ordered list of edits that are applied to the A "YANG Patch" is an ordered list of edits that are applied to the
target datastore by the RESTCONF server. The specific fields are target datastore by the RESTCONF server. The specific fields are
defined in the YANG module in Section 3. defined in the YANG module in Section 3.
The YANG Patch operation is invoked by the RESTCONF client by sending The YANG Patch operation is invoked by the RESTCONF client by sending
a PATCH method request with a representation using either the a PATCH method request with a representation using either the
"application/yang-patch-xml" or "application/yang-patch+json" media "application/yang-patch+xml" or "application/yang-patch+json" media
type. A message-body representing the YANG Patch input parameters type. A message-body representing the YANG Patch input parameters
MUST be provided. MUST be provided.
YANG Patch has some features that are not possible with the PATCH YANG Patch has some features that are not possible with the PATCH
method in RESTCONF: method in RESTCONF:
o YANG Patch allows multiple sub-resources to be edited at within o YANG Patch allows multiple sub-resources to be edited at within
the same PATCH method. the same PATCH method.
o YANG Patch allows more precise edit operations than RESTCONF. o YANG Patch allows more precise edit operations than RESTCONF.
skipping to change at page 7, line 15 skipping to change at page 7, line 15
The YANG Patch "patch-id" may be useful for debugging, and SHOULD be The YANG Patch "patch-id" may be useful for debugging, and SHOULD be
present in any audit audit logging records generated by the RESTCONF present in any audit audit logging records generated by the RESTCONF
server for a patch. server for a patch.
The RESTCONF server MUST return the Accept-Patch header field in an The RESTCONF server MUST return the Accept-Patch header field in an
OPTIONS response, as specified in [RFC5789], which includes the media OPTIONS response, as specified in [RFC5789], which includes the media
type for YANG Patch. type for YANG Patch.
Note that YANG Patch can only edit data resources. The PATCH method Note that YANG Patch can only edit data resources. The PATCH method
cannot be used to replace the datastore resource. Although the cannot be used to replace the datastore resource. Although the
"ietf-yang-patch" YANG module is written using YANG 1.1 "ietf-yang-patch" YANG module is written using YANG version 1.1
[I-D.ietf-netmod-rfc6020bis], an implementation of YANG Patch can be [RFC7950], an implementation of YANG Patch can be used with content
used with content defined in YANG 1.0 [RFC6020] as well. defined in YANG version 1 [RFC6020] as well.
Example: Example:
Accept-Patch: application/yang-patch-xml,application/yang-patch+json Accept-Patch: application/yang-patch+xml,application/yang-patch+json
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" [RFC7951]. If any meta-
[I-D.ietf-netmod-yang-json]. If any meta-data needs to be sent in a data needs to be sent in a JSON message, it is encoded according to
JSON message, it is encoded according to "Defining and Using Metadata "Defining and Using Metadata with YANG" [RFC7952].
with YANG" [I-D.ietf-netmod-yang-metadata].
2.1. Target Resource 2.1. Target Resource
The YANG Patch operation uses the RESTCONF target resource URI to The YANG Patch operation uses the RESTCONF target resource URI to
identify the resource that will be patched. This can be the identify the resource that will be patched. This can be the
datastore resource itself, i.e., "{+restconf}/data", to edit top- datastore resource itself, i.e., "{+restconf}/data", to edit top-
level configuration data resources, or it can be a configuration data level configuration data resources, or it can be a configuration data
resource within the datastore resource, e.g., {+restconf/data/ietf- resource within the datastore resource, e.g., "{+restconf}/data/
interfaces:interfaces", to edit sub-resources within a top-level ietf-interfaces:interfaces", to edit sub-resources within a top-level
configuration data resource. configuration data resource.
The target resource MUST identify exactly one resource instance. If
more than one resource instance is identified, then the request MUST
NOT be processed, and a "400 Bad Request" error response MUST be sent
by the server. If the target resource does not identify any existing
resource instance then the request MUST NOT be processed, and a "404
Not Found" error response MUST be sent by the server.
Each edit with a YANG Patch identifies a target data node for the Each edit with a YANG Patch identifies a target data node for the
associated edit. This is described in Section 2.4. associated edit. This is described in Section 2.4.
2.2. yang-patch Input 2.2. yang-patch Request
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.
The merge, replace, create, delete, and remove edit operations have
the exact same meaning as defined for the "operation" attribute in
section 7.2 of [RFC6241].
Each edit within a YANG Patch MUST identify exactly one data resource
instance. If an edit represents more than one resource instance,
then the request MUST NOT be processed, and a "400 Bad Request" error
response MUST be sent by the server. If the edit does not identify
any existing resource instance, and the operation for the edit is not
"create", then the request MUST NOT be processed, and a "404 Not
Found" error response MUST be sent by the server. A
"yang-patch-status" response MUST be sent by the server identifying
the edit(s) that are not valid.
YANG Patch does not provide any access to specific datastores. It is
am implementation detail how a server processes an edit if it is co-
located with a NETCONF server that does provide access to individual
datastores. A complete datastore cannot be replaced in the same
manner as provided by the "copy-config" operation defined in section
7.3 of [RFC6241]. Only the specified nodes in a YANG Patch are
affected.
A message-body representing the YANG Patch is sent by the RESTCONF A message-body representing the YANG Patch is sent by the RESTCONF
client to specify the edit operation request. When used with the client to specify the edit operation request. When used with the
HTTP PATCH method, this data is identified by the YANG Patch media HTTP PATCH method, this data is identified by the YANG Patch media
type. type.
YANG tree diagram for "yang-patch" Container YANG tree diagram for "yang-patch" Container
+---- yang-patch +---- yang-patch
+---- patch-id? string +---- patch-id string
+---- comment? string +---- comment? string
+---- edit* [edit-id] +---- edit* [edit-id]
+---- edit-id? string +---- edit-id? string
+---- operation enumeration +---- operation enumeration
+---- target target-resource-offset +---- target target-resource-offset
+---- point? target-resource-offset +---- point? target-resource-offset
+---- where? enumeration +---- where? enumeration
+---- value? +---- value?
2.3. yang-patch-status Output 2.3. yang-patch-status Response
A message-body representing the YANG Patch Status is returned to the A message-body representing the YANG Patch Status is returned to the
RESTCONF client to report the detailed status of the edit operation. RESTCONF client to report the detailed status of the edit operation.
When used with the HTTP PATCH method, this data is identified by the When used with the HTTP PATCH method, this data is identified by the
YANG Patch Status media type, and the syntax specification is defined YANG Patch Status media type, and the syntax specification is defined
in Section 3. in Section 3.
YANG tree diagram for "yang-patch-status" Container: YANG tree diagram for "yang-patch-status" Container:
+---- yang-patch-status +---- yang-patch-status
skipping to change at page 11, line 29 skipping to change at page 12, line 29
The "ietf-yang-patch" module defines conceptual definitions with the The "ietf-yang-patch" module defines conceptual definitions with the
'yang-data' extension statements, which are not meant to be 'yang-data' extension statements, which are not meant to be
implemented as datastore contents by a RESTCONF server. implemented as datastore contents by a RESTCONF 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 'yang-data' extension definition. by this module for the 'yang-data' 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@2016-08-15.yang" <CODE BEGINS> file "ietf-yang-patch@2016-09-26.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-restconf { prefix rc; } import ietf-restconf { prefix rc; }
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>
Author: Andy Bierman Author: Andy Bierman
<mailto:andy@yumaworks.com> <mailto:andy@yumaworks.com>
Author: Martin Bjorklund Author: Martin Bjorklund
<mailto:mbj@tail-f.com> <mailto:mbj@tail-f.com>
Author: Kent Watsen Author: Kent Watsen
<mailto:kwatsen@juniper.net>"; <mailto:kwatsen@juniper.net>";
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) 2016 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-11.txt // Note: extracted from draft-ietf-netconf-yang-patch-12.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 2016-08-15 { revision 2016-09-26 {
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 string; type string;
description description
"Contains a data resource identifier string representing "Contains a data resource identifier string representing
a sub-resource within the target resource. a sub-resource within the target resource.
The document root for this expression is the The document root for this expression is the
target resource that is specified in the target resource that is specified in the
protocol operation (e.g., the URI for the PATCH request). protocol operation (e.g., the URI for the PATCH request).
This string is encoded according the same rules as This string is encoded according the same rules as
a data resource identifier in a RESTCONF Request URI."; a data resource identifier in a RESTCONF Request URI.";
// RFC Ed.: replace "draft-ietf-netconf-restconf" below // RFC Ed.: replace "draft-ietf-netconf-restconf" below
// with RFC XXXX, where XXXX is the number of the RESTCONF RFC, // with RFC XXXX, where XXXX is the number of the RESTCONF RFC,
// and remove this note. // and remove this note.
reference reference
"draft-ietf-netconf-restconf, section 3.5.3"; "draft-ietf-netconf-restconf, section 3.5.3";
} }
rc:yang-data "yang-patch" { rc:yang-data "yang-patch" {
uses yang-patch; uses yang-patch;
} }
rc:yang-data "yang-patch-status" { rc:yang-data "yang-patch-status" {
uses yang-patch-status; uses yang-patch-status;
} }
grouping yang-patch { grouping yang-patch {
description description
"A grouping that contains a YANG container "A grouping that contains a YANG container
representing the syntax and semantics of a representing the syntax and semantics of a
YANG Patch edit request message."; YANG Patch edit request message.";
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 is performed before any edits YANG datastore validation is performed before any edits
have been applied to the running datastore. have been applied 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
"draft-ietf-netmod-rfc6020bis, section 8.3."; "draft-ietf-netmod-rfc6020bis, section 8.3.";
leaf patch-id { leaf patch-id {
type string; type string;
description mandatory true;
"An arbitrary string provided by the client to identify description
the entire patch. Error messages returned by the server "An arbitrary string provided by the client to identify
pertaining to this patch will be identified by this the entire patch. Error messages returned by the server
patch-id value."; pertaining to this patch will be identified by this
} patch-id value.";
}
leaf comment { leaf comment {
type string; type string;
description description
"An arbitrary string provided by the client to describe "An arbitrary string provided by the client to describe
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."; patch.";
} }
list edit { list edit {
key edit-id; key edit-id;
ordered-by user; ordered-by user;
description description
"Represents one edit within the YANG Patch "Represents one edit within the YANG Patch
request message. The edit list is applied request message. The edit list is applied
in the following manner: in the following manner:
- The first edit is conceptually applied to a copy - The first edit is conceptually applied to a copy
of the existing target datastore, e.g., the of the existing target datastore, e.g., the
running configuration datastore. running configuration datastore.
- Each ascending edit is conceptually applied to - Each ascending edit is conceptually applied to
the result of the previous edit(s). the result of the previous edit(s).
- After all edits have been successfully processed, - After all edits have been successfully processed,
the result is validated according to YANG constraints. the result is validated according to YANG constraints.
- If successful, the server will attempt to apply - If successful, the server will attempt to apply
the result to the target datastore. "; the result to the target datastore. ";
leaf edit-id { leaf edit-id {
type string; type string;
description description
"Arbitrary string index for the edit. "Arbitrary string index for the edit.
Error messages returned by the server pertaining Error messages returned by the server pertaining
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
supplied value, only if it does not already value, only if it does not already exist. The
exist.get' leaf identifies the data node to be 'target' leaf identifies the data node to be created,
created, not the parent data node."; 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
represent a new data resource. If the 'where' represent a new data resource. If the 'where'
parameter is set to 'before' or 'after', then parameter is set to 'before' or 'after', then
the 'point' parameter identifies the insertion the 'point' parameter identifies the insertion
point for the target node."; point for the target node.";
} }
enum merge { enum merge {
description description
"The supplied value is merged with the target data "The supplied value is merged with the target data
node."; node.";
} }
enum move { enum move {
description description
"Move the target node. Reorder a user-ordered "Move the target node. Reorder a user-ordered
list or leaf-list. The target node must represent list or leaf-list. The target node must represent
an existing data resource. If the 'where' parameter an existing data resource. If the 'where' parameter
is set to 'before' or 'after', then the 'point' is set to 'before' or 'after', then the 'point'
parameter identifies the insertion point to move parameter identifies the insertion point to move
the target node."; the target node.";
} }
enum replace { enum replace {
description description
"The supplied value is used to replace the target "The supplied value is used to replace the target
data node."; data node.";
} }
enum remove { enum remove {
description description
"Delete the target node if it currently exists."; "Delete the target node if it currently exists.";
} }
} }
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 node for the edit "Identifies the target data node for the edit
operation. If the target has the value '/', then operation. If the target has the value '/', then
the target data node is the target resource. the target data node is the target resource.
The target node MUST identify a data resource, The target node MUST identify a data resource,
not the datastore 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;
description description
"The absolute URL path for the data node that is being "The absolute URL path for the data node that is being
used as the insertion point or move point for the used as the insertion point or move point for the
target of this edit entry."; target of this edit entry.";
} }
leaf where { leaf where {
when "../operation = 'insert' or ../operation = 'move'" { when "../operation = 'insert' or ../operation = 'move'" {
description description
"Where leaf only applies for insert or move "Where leaf only applies for insert or move
operations."; operations.";
} }
type enumeration { type enumeration {
enum before { enum before {
description description
"Insert or move a data node before the data resource "Insert or move a data node before the data resource
identified by the 'point' parameter."; identified by the 'point' parameter.";
} }
enum after { enum after {
description description
"Insert or move a data node after the data resource "Insert or move a data node after the data resource
identified by the 'point' parameter."; identified by the 'point' parameter.";
} }
enum first { enum first {
description description
"Insert or move a data node so it becomes ordered "Insert or move a data node so it becomes ordered
as the first entry."; as the first entry.";
} }
enum last { enum last {
description description
"Insert or move a data node so it becomes ordered "Insert or move a data node so it becomes ordered
as the last entry."; as the last entry.";
} }
} }
default last; default last;
description description
"Identifies where a data resource will be inserted or "Identifies where a data resource will be inserted or
moved. YANG only allows these operations for moved. YANG only allows these operations for
list and leaf-list data nodes that are ordered-by list and leaf-list data nodes that are ordered-by
user."; user.";
} }
anydata value { anydata value {
when "../operation = 'create' " when "../operation = 'create' "
+ "or ../operation = 'merge' " + "or ../operation = 'merge' "
+ "or ../operation = 'replace' " + "or ../operation = 'replace' "
+ "or ../operation = 'insert'" { + "or ../operation = 'insert'" {
description description
"Value node only used for create, merge, "Value node only used for create, merge,
replace, and insert operations"; replace, and insert operations";
} }
description description
"Value used for this edit operation. The anydata 'value' "Value used for this edit operation. The anydata 'value'
contains the target resource associated with the contains the target resource associated with the
'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 contains 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>
"; ";
} }
} }
} }
} // grouping yang-patch } // grouping yang-patch
grouping yang-patch-status { grouping yang-patch-status {
description description
"A grouping that contains a YANG container "A grouping that contains a YANG container
representing the syntax and semantics of representing the syntax and semantics of
YANG Patch status response message."; YANG Patch status response message.";
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 If there was no patch-id present in the request
then this field will not be present."; 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;
description description
"This container will be present if global "This container will be present if global
errors that are unrelated to a specific edit errors that are unrelated to a specific edit
occurred."; occurred.";
} }
leaf ok { leaf ok {
type empty; type empty;
description description
"This leaf will be present if the request succeeded "This leaf will be present if the request succeeded
and there are no errors reported in the edit-status and there are no errors reported in the edit-status
container."; container.";
} }
} }
container edit-status { container edit-status {
description description
"This container will be present if there are "This container will be present if there are
edit-specific status responses to report. edit-specific status responses to report.
If all edits succeeded and the 'global-status' If all edits succeeded and the 'global-status'
returned is 'ok', then a server MAY omit this returned is 'ok', then a server MAY omit this
container"; container";
list edit { list edit {
key edit-id; key edit-id;
description description
"Represents a list of status responses, "Represents a list of status responses,
corresponding to edits in the YANG Patch corresponding to edits in the YANG Patch
request message. If an edit entry was request message. If an edit entry was
skipped or not reached by the server, skipped or not reached by the server,
then this list will not contain a corresponding then this list will not contain a corresponding
entry for that edit."; entry for that edit.";
leaf edit-id { leaf edit-id {
type string; type string;
description
"Response status is for the edit list entry
with this edit-id value.";
}
choice edit-status-choice {
description description
"A choice between different types of status "Response status is for the edit list entry
responses for each edit entry."; with this edit-id value.";
leaf ok { }
type empty; choice edit-status-choice {
description description
"This edit entry was invoked without any "A choice between different types of status
errors detected by the server associated responses for each edit entry.";
with this edit."; leaf ok {
} type empty;
case errors { description
uses rc:errors; "This edit entry was invoked without any
description errors detected by the server associated
"The server detected errors associated with the with this edit.";
edit identified by the same edit-id value."; }
} case errors {
} uses rc:errors;
} description
} "The server detected errors associated with the
} edit identified by the same edit-id value.";
} // 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 as a namespace in the IETF XML This document registers one URI as a namespace in the IETF XML
registry [RFC3688]. Following the format in RFC 3688, the following registry [RFC3688]. Following the format in RFC 3688, the following
registration is requested to be made. registration is requested to be made.
skipping to change at page 20, line 28 skipping to change at page 21, line 28
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
4.2. Media Types 4.2. Media Types
4.2.1. Media Type application/yang-patch-xml 4.2.1. Media Type application/yang-patch+xml
Type name: application Type name: application
Subtype name: yang-patch Subtype name: yang-patch
Required parameters: None Required parameters: None
Optional parameters: None Optional parameters: None
// RFC Ed.: replace draft-ietf-netmod-rfc6020bis with
// the actual RFC reference for YANG 1.1, and remove this note.
// RFC Ed.: replace 'XXXX' with the real RFC number, // RFC Ed.: replace 'XXXX' with the real RFC number,
// and remove this note // and remove this note
Encoding considerations: 8-bit Encoding considerations: 8-bit
Each conceptual YANG data node is encoded according to the Each conceptual YANG data node is encoded according to the
XML Encoding Rules and Canonical Format for the specific XML Encoding Rules and Canonical Format for the specific
YANG data node type defined in [draft-ietf-netmod-rfc6020bis]. YANG data node type defined in [RFC7950].
In addition, the "yang-patch" YANG Patch template found In addition, the "yang-patch" YANG Patch template found
in [RFCXXXX] defines the structure of a YANG Patch request. in [RFCXXXX] defines the structure of a YANG Patch request.
// RFC Ed.: replace 'NN' in Section NN of [RFCXXXX] with the // RFC Ed.: replace 'NN' in Section NN of [RFCXXXX] with the
// section number for Security Considerations // section number for Security Considerations
// Replace 'XXXX' in Section NN of [RFCXXXX] with the actual // Replace 'XXXX' in Section NN of [RFCXXXX] with the actual
// RFC number, and remove this note. // RFC number, and remove this note.
Security considerations: Security considerations related Security considerations: Security considerations related
to the generation and consumption of RESTCONF messages to the generation and consumption of RESTCONF messages
skipping to change at page 21, line 30 skipping to change at page 22, line 28
// RFC Ed.: replace XXXX with actual RFC number and remove this // RFC Ed.: replace XXXX with actual RFC number and remove this
// note. // note.
Published specification: RFC XXXX Published specification: RFC XXXX
Applications that use this media type: Instance document Applications that use this media type: Instance document
data parsers used within a protocol or automation tool data parsers used within a protocol or automation tool
that utilize the YANG Patch data structure. that utilize the YANG Patch data structure.
Fragment identifier considerations: The fragment field in the Fragment identifier considerations: Fragment identifiers
request URI has no defined purpose. for this type are not defined.
Additional information: Additional information:
Deprecated alias names for this type: N/A Deprecated alias names for this type: N/A
Magic number(s): N/A Magic number(s): N/A
File extension(s): .xml File extension(s): .xml
Macintosh file type code(s): "TEXT" Macintosh file type code(s): "TEXT"
// RFC Ed.: replace XXXX with actual RFC number and remove this // RFC Ed.: replace XXXX with actual RFC number and remove this
// note. // note.
skipping to change at page 25, line 5 skipping to change at page 25, line 46
on such a RESTCONF server, which attempts to consume all available on such a RESTCONF server, which attempts to consume all available
memory or other resource types. memory or other resource types.
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-13 (work in Protocol", draft-ietf-netconf-restconf-13 (work in
progress), April 2016. progress), April 2016.
[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]
Lhotka, L., "JSON Encoding of Data Modeled with YANG",
draft-ietf-netmod-yang-json-10 (work in progress), March
2016.
[I-D.ietf-netmod-yang-metadata]
Lhotka, L., "Defining and Using Metadata with YANG",
draft-ietf-netmod-yang-metadata-07 (work in progress),
March 2016.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, March 1997. Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688,
DOI 10.17487/RFC3688, January 2004, DOI 10.17487/RFC3688, January 2004,
<http://www.rfc-editor.org/info/rfc3688>. <http://www.rfc-editor.org/info/rfc3688>.
[RFC5789] Dusseault, L. and J. Snell, "PATCH Method for HTTP", [RFC5789] Dusseault, L. and J. Snell, "PATCH Method for HTTP",
RFC 5789, March 2010. RFC 5789, March 2010.
skipping to change at page 26, line 5 skipping to change at page 26, line 28
2014, <http://www.rfc-editor.org/info/rfc7159>. 2014, <http://www.rfc-editor.org/info/rfc7159>.
[RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer
Protocol (HTTP/1.1): Message Syntax and Routing", Protocol (HTTP/1.1): Message Syntax and Routing",
RFC 7230, DOI 10.17487/RFC7230, June 2014, RFC 7230, DOI 10.17487/RFC7230, June 2014,
<http://www.rfc-editor.org/info/rfc7230>. <http://www.rfc-editor.org/info/rfc7230>.
[RFC7231] Fielding, R. and J. Reschke, "Hypertext Transfer Protocol [RFC7231] Fielding, R. and J. Reschke, "Hypertext Transfer Protocol
(HTTP/1.1): Semantics and Content", RFC 7231, June 2014. (HTTP/1.1): Semantics and Content", RFC 7231, June 2014.
[RFC7950] Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language",
RFC 7950, DOI 10.17487/RFC7950, August 2016,
<http://www.rfc-editor.org/info/rfc7950>.
[RFC7951] Lhotka, L., "JSON Encoding of Data Modeled with YANG",
RFC 7951, DOI 10.17487/RFC7951, August 2016,
<http://www.rfc-editor.org/info/rfc7951>.
[RFC7952] Lhotka, L., "Defining and Using Metadata with YANG",
RFC 7952, DOI 10.17487/RFC7952, August 2016,
<http://www.rfc-editor.org/info/rfc7952>.
[W3C.REC-xml-20081126] [W3C.REC-xml-20081126]
Yergeau, F., Maler, E., Paoli, J., Sperberg-McQueen, C., Yergeau, F., Maler, E., Paoli, J., Sperberg-McQueen, C.,
and T. Bray, "Extensible Markup Language (XML) 1.0 (Fifth and T. Bray, "Extensible Markup Language (XML) 1.0 (Fifth
Edition)", World Wide Web Consortium Recommendation REC- Edition)", World Wide Web Consortium Recommendation REC-
xml-20081126, November 2008, xml-20081126, November 2008,
<http://www.w3.org/TR/2008/REC-xml-20081126>. <http://www.w3.org/TR/2008/REC-xml-20081126>.
Appendix A. Acknowledgements Appendix A. Acknowledgements
The authors would like to thank the following people for their The authors would like to thank the following people for their
skipping to change at page 26, line 31 skipping to change at page 27, line 19
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. v10 to v11 B.1. v11 to v12
o clarify target resource must exist
o fix errors in some examples
o change application/yang-patch-xml to application/yang-patch+xml
o clarified some section titles
o clarified error responses for multiple edit instances
o made patch-id field mandatory
o referenced NETCONF operation attribute
B.2. v10 to v11
o change application/yang-patch to application/yang-patch-xml o change application/yang-patch to application/yang-patch-xml
o change server to RESTCONF server and remove NETCONF server term o change server to RESTCONF server and remove NETCONF server term
o change client to RESTCONF client and remove NETCONF client term o change client to RESTCONF client and remove NETCONF client term
o clarified that YANG 1.0 content can be used in a YANG Patch o clarified that YANG 1.0 content can be used in a YANG Patch
implementation implementation
o clarified more terminology o clarified more terminology
o fixed missing keys in edit exmaples o fixed missing keys in edit examples
o added insert list example o added insert list example
B.2. v09 to v10 B.3. v09 to v10
o change yang-patch+xml to yang-patch o change yang-patch+xml to yang-patch
o clarify application/yang-patch+json media type o clarify application/yang-patch+json media type
o add edit datastore example o add edit datastore example
o change data-resource-offset typedef so it is consistent for XML o change data-resource-offset typedef so it is consistent for XML
and JSON and JSON
B.3. v08 to v09 B.4. v08 to v09
o change RFC 7158 reference to RFC 7159 reference o change RFC 7158 reference to RFC 7159 reference
o change RFC 2616 reference to RFC 7230 reference o change RFC 2616 reference to RFC 7230 reference
o remove unused HTTP terms o remove unused HTTP terms
o remove import-by-revision of ietf-restconf; not needed o remove import-by-revision of ietf-restconf; not needed
o change application/yang.patch media type to application/yang-patch o change application/yang.patch media type to application/yang-patch
o remove application/yang.patch-status media type; use application/ o remove application/yang.patch-status media type; use application/
yang-data instead yang-data instead
B.4. v07 to v08 B.5. v07 to v08
o clarified target datastore and target data node terms o clarified target datastore and target data node terms
o clarified that target leaf can be single forward slash '/' o clarified that target leaf can be single forward slash '/'
o added Successful edit response handling section o added Successful edit response handling section
o clarified that YANG Patch draft is for RESTCONF protocol only but o clarified that YANG Patch draft is for RESTCONF protocol only but
may be defined for other protocols outside this document may be defined for other protocols outside this document
o clarified that YANG Patch draft is for configuration datastores o clarified that YANG Patch draft is for configuration datastores
only but may be defined for other datastore types outside this only but may be defined for other datastore types outside this
document document
o fixed typos o fixed typos
B.5. v06 to v07 B.6. 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.6. v05 to v06 B.7. 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.7. v04 to v05 B.8. v04 to v05
o updated reference to RESTCONF o updated reference to RESTCONF
B.8. v03 to v04 B.9. 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)
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.9. v02 to v03 B.10. 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.10. v01 to v02 B.11. 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.11. v00 to v01 B.12. v00 to v01
o Added text requiring support for Accept-Patch header field, and o Added text requiring support for Accept-Patch header field, and
removed 'Identification of YANG Patch capabilities' open issue. removed '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 30, line 5 skipping to change at page 31, line 7
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.12. bierman:yang-patch-00 to ietf:yang-patch-00 B.13. 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 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!
skipping to change at page 32, line 5 skipping to change at page 33, line 7
D.1.1. Add Resources: Error D.1.1. Add Resources: Error
The following example shows several songs being added to an existing The following example shows several songs being added to an existing
album. Each edit contains one song. The first song already exists, album. Each edit contains one song. The first song already exists,
so an error will be reported for that edit. The rest of the edits so an error will be reported for that edit. The rest of the edits
were not attempted, since the first edit failed. The XML encoding is were not attempted, since the first edit failed. The XML encoding is
used in this example. used in this example.
Request from the RESTCONF client: Request from the RESTCONF client:
PATCH /restconf/data/example-jukebox:jukebox/ PATCH /restconf/data/example-jukebox:jukebox/\
library/artist=Foo%20Fighters/album=Wasting%20Light HTTP/1.1 library/artist=Foo%20Fighters/album=Wasting%20Light HTTP/1.1
Host: example.com Host: example.com
Accept: application/yang-data Accept: application/yang-data+xml
Content-Type: application/yang-patch-xml Content-Type: application/yang-patch+xml
<yang-patch xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-patch"> <yang-patch xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-patch">
<patch-id>add-songs-patch</patch-id> <patch-id>add-songs-patch</patch-id>
<edit> <edit>
<edit-id>edit1</edit-id> <edit-id>edit1</edit-id>
<operation>create</operation> <operation>create</operation>
<target>/song=Bridge%20Burning</target> <target>/song=Bridge%20Burning</target>
<value> <value>
<song xmlns="http://example.com/ns/example-jukebox"> <song xmlns="http://example.com/ns/example-jukebox">
<name>Bridge Burning</name> <name>Bridge Burning</name>
<location>/media/bridge_burning.mp3</location> <location>/media/bridge_burning.mp3</location>
skipping to change at page 33, line 11 skipping to change at page 35, line 9
</value> </value>
</edit> </edit>
</yang-patch> </yang-patch>
XML Response from the RESTCONF server: XML Response from the RESTCONF server:
HTTP/1.1 409 Conflict HTTP/1.1 409 Conflict
Date: Mon, 23 Apr 2012 13:01:20 GMT Date: Mon, 23 Apr 2012 13:01:20 GMT
Server: example-server Server: example-server
Last-Modified: Mon, 23 Apr 2012 13:01:20 GMT Last-Modified: Mon, 23 Apr 2012 13:01:20 GMT
Content-Type: application/yang-data Content-Type: application/yang-data+xml
<yang-patch-status <yang-patch-status
xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-patch"> xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-patch">
<patch-id>add-songs-patch</patch-id> <patch-id>add-songs-patch</patch-id>
<edit-status> <edit-status>
<edit> <edit>
<edit-id>edit1</edit-id> <edit-id>edit1</edit-id>
<errors> <errors>
<error> <error>
<error-type>application</error-type> <error-type>application</error-type>
skipping to change at page 35, line 5 skipping to change at page 37, line 5
The following example shows several songs being added to an existing The following example shows several songs being added to an existing
album. album.
o Each of 2 edits contains one song. o Each of 2 edits contains one song.
o Both edits succeed and new sub-resources are created o Both edits succeed and new sub-resources are created
Request from the RESTCONF client: Request from the RESTCONF client:
PATCH /restconf/data/example-jukebox:jukebox/ PATCH /restconf/data/example-jukebox:jukebox/\
library/artist=Foo%20Fighters/album=Wasting%20Light library/artist=Foo%20Fighters/album=Wasting%20Light \
HTTP/1.1 HTTP/1.1
Host: example.com Host: example.com
Accept: application/yang-data+json Accept: application/yang-data+json
Content-Type: application/yang-patch+json Content-Type: application/yang-patch+json
{ {
"ietf-yang-patch:yang-patch" : { "ietf-yang-patch:yang-patch" : {
"patch-id" : "add-songs-patch-2", "patch-id" : "add-songs-patch-2",
"edit" : [ "edit" : [
{ {
skipping to change at page 36, line 5 skipping to change at page 38, line 5
"length" : 269 "length" : 269
} }
} }
} }
] ]
} }
} }
Response from the RESTCONF server: Response from the RESTCONF server:
HTTP/1.1 200 Success HTTP/1.1 200 OK
Date: Mon, 23 Apr 2012 13:01:20 GMT Date: Mon, 23 Apr 2012 13:01:20 GMT
Server: example-server Server: example-server
Last-Modified: Mon, 23 Apr 2012 13:01:20 GMT Last-Modified: Mon, 23 Apr 2012 13:01:20 GMT
Content-Type: application/yang-data+json Content-Type: application/yang-data+json
{ {
"ietf-yang-patch:yang-patch-status" : { "ietf-yang-patch:yang-patch-status" : {
"patch-id" : "add-songs-patch-2", "patch-id" : "add-songs-patch-2",
"ok" : [null] "ok" : [null]
} }
skipping to change at page 37, line 7 skipping to change at page 39, line 7
D.1.3. Insert list entry example D.1.3. Insert list entry example
The following example shows a song being inserted within an existing The following example shows a song being inserted within an existing
playlist. Song "6" in playlist "Foo-One" is being inserted after playlist. Song "6" in playlist "Foo-One" is being inserted after
song "5" in the playlist. The operation succeeds, so a non-error song "5" in the playlist. The operation succeeds, so a non-error
reply example can be shown. reply example can be shown.
Request from the RESTCONF client: Request from the RESTCONF client:
PATCH /restconf/data/example-jukebox:jukebox/ PATCH /restconf/data/example-jukebox:jukebox/\
playlist=Foo-One HTTP/1.1 playlist=Foo-One HTTP/1.1
Host: example.com Host: example.com
Accept: application/yang-data+json Accept: application/yang-data+json
Content-Type: application/yang-patch+json Content-Type: application/yang-patch+json
{ {
"ietf-yang-patch:yang-patch" : { "ietf-yang-patch:yang-patch" : {
"patch-id" : "move-song-patch", "patch-id" : "move-song-patch",
"comment" : "Insert song 6 after song 5", "comment" : "Insert song 6 after song 5",
"edit" : [ "edit" : [
{ {
skipping to change at page 37, line 39 skipping to change at page 39, line 39
"length" : 236 "length" : 236
} }
} }
} }
] ]
} }
} }
Response from the RESTCONF server: Response from the RESTCONF server:
HTTP/1.1 400 OK HTTP/1.1 200 OK
Date: Mon, 23 Apr 2012 13:01:20 GMT Date: Mon, 23 Apr 2012 13:01:20 GMT
Server: example-server Server: example-server
Last-Modified: Mon, 23 Apr 2012 13:01:20 GMT Last-Modified: Mon, 23 Apr 2012 13:01:20 GMT
Content-Type: application/yang-data+json Content-Type: application/yang-data+json
{ {
"ietf-restconf:yang-patch-status" : { "ietf-yang-patch:yang-patch-status" : {
"patch-id" : "move-song-patch", "patch-id" : "move-song-patch",
"ok" : [null] "ok" : [null]
} }
} }
D.1.4. Move list entry example D.1.4. Move list entry example
The following example shows a song being moved within an existing The following example shows a song being moved within an existing
playlist. Song "1" in playlist "Foo-One" is being moved after song playlist. Song "1" in playlist "Foo-One" is being moved after song
"3" in the playlist. Note that no "value" parameter is needed for a "3" in the playlist. Note that no "value" parameter is needed for a
"move" operation. The operation succeeds, so a non-error reply "move" operation. The operation succeeds, so a non-error reply
example can be shown. example can be shown.
Request from the RESTCONF client: Request from the RESTCONF client:
PATCH /restconf/data/example-jukebox:jukebox/ PATCH /restconf/data/example-jukebox:jukebox/\
playlist=Foo-One HTTP/1.1 playlist=Foo-One HTTP/1.1
Host: example.com Host: example.com
Accept: application/yang-data+json Accept: application/yang-data+json
Content-Type: application/yang-patch+json Content-Type: application/yang-patch+json
{ {
"ietf-yang-patch:yang-patch" : { "ietf-yang-patch:yang-patch" : {
"patch-id" : "move-song-patch", "patch-id" : "move-song-patch",
"comment" : "Move song 1 after song 3", "comment" : "Move song 1 after song 3",
"edit" : [ "edit" : [
{ {
skipping to change at page 38, line 39 skipping to change at page 40, line 39
"target" : "/song=1", "target" : "/song=1",
"point" : "/song=3", "point" : "/song=3",
"where" : "after" "where" : "after"
} }
] ]
} }
} }
Response from the RESTCONF server: Response from the RESTCONF server:
HTTP/1.1 400 OK HTTP/1.1 200 OK
Date: Mon, 23 Apr 2012 13:01:20 GMT Date: Mon, 23 Apr 2012 13:01:20 GMT
Server: example-server Server: example-server
Last-Modified: Mon, 23 Apr 2012 13:01:20 GMT Last-Modified: Mon, 23 Apr 2012 13:01:20 GMT
Content-Type: application/yang-data+json Content-Type: application/yang-data+json
{ {
"ietf-restconf:yang-patch-status" : { "ietf-restconf:yang-patch-status" : {
"patch-id" : "move-song-patch", "patch-id" : "move-song-patch",
"ok" : [null] "ok" : [null]
} }
skipping to change at page 40, line 5 skipping to change at page 42, line 5
The following example shows how 3 top-level data nodes from different The following example shows how 3 top-level data nodes from different
modules can be edited at the same time. modules can be edited at the same time.
Example module "foo" defines leaf X. Example module "bar" defines Example module "foo" defines leaf X. Example module "bar" defines
container Y, with child leafs A and B. Example module "baz" defines container Y, with child leafs A and B. Example module "baz" defines
list Z, with key C and child leafs D and E. list Z, with key C and child leafs D and E.
Request from the RESTCONF client: Request from the RESTCONF client:
PATCH /restconf/data HTTP/1.1 PATCH /restconf/data HTTP/1.1
Host: example.com Host: example.com
Accept: application/yang-data+json Accept: application/yang-data+json
Content-Type: application/yang-patch+json Content-Type: application/yang-patch+json
{ {
"ietf-yang-patch:yang-patch" : { "ietf-yang-patch:yang-patch" : {
"patch-id" : "datastore-patch-1", "patch-id" : "datastore-patch-1",
"comment" : "Edit 3 top-level data nodes at once", "comment" : "Edit 3 top-level data nodes at once",
"edit" : [ "edit" : [
{ {
skipping to change at page 41, line 5 skipping to change at page 43, line 5
"E" : false "E" : false
} }
} }
} }
] ]
} }
} }
Response from the RESTCONF server: Response from the RESTCONF server:
HTTP/1.1 400 OK HTTP/1.1 200 OK
Date: Mon, 23 Apr 2012 13:02:20 GMT Date: Mon, 23 Apr 2012 13:02:20 GMT
Server: example-server Server: example-server
Last-Modified: Mon, 23 Apr 2012 13:01:20 GMT Last-Modified: Mon, 23 Apr 2012 13:01:20 GMT
Content-Type: application/yang-data+json Content-Type: application/yang-data+json
{ {
"ietf-restconf:yang-patch-status" : { "ietf-yang-patch:yang-patch-status" : {
"patch-id" : "datastore-patch-1", "patch-id" : "datastore-patch-1",
"ok" : [null] "ok" : [null]
} }
} }
Authors' Addresses Authors' Addresses
Andy Bierman Andy Bierman
YumaWorks YumaWorks
 End of changes. 117 change blocks. 
474 lines changed or deleted 511 lines changed or added

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