draft-ietf-netconf-yang-patch-12.txt   draft-ietf-netconf-yang-patch-13.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: April 1, 2017 Tail-f Systems Expires: May 13, 2017 Tail-f Systems
K. Watsen K. Watsen
Juniper Networks Juniper Networks
September 28, 2016 November 9, 2016
YANG Patch Media Type YANG Patch Media Type
draft-ietf-netconf-yang-patch-12 draft-ietf-netconf-yang-patch-13
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 April 1, 2017. This Internet-Draft will expire on May 13, 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 14 skipping to change at page 2, line 14
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 . . . . . . . . . . . . . . . . . . . . . . . . 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 . . . . . . . . . . . . . . . . . . . . . . 5
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 Diagram Notations . . . . . . . . . . . . . . . 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 Request . . . . . . . . . . . . . . . . . . . 8 2.2. yang-patch Request . . . . . . . . . . . . . . . . . . . 8
2.3. yang-patch-status Response . . . . . . . . . . . . . . . 9 2.3. yang-patch-status Response . . . . . . . . . . . . . . . 9
2.4. Target Data Node . . . . . . . . . . . . . . . . . . . . 10 2.4. Target Data Node . . . . . . . . . . . . . . . . . . . . 10
2.5. Edit Operations . . . . . . . . . . . . . . . . . . . . . 11 2.5. Edit Operations . . . . . . . . . . . . . . . . . . . . . 11
2.6. Successful Edit Response Handling . . . . . . . . . . . . 11 2.6. Successful Edit Response Handling . . . . . . . . . . . . 11
2.7. Error Handling . . . . . . . . . . . . . . . . . . . . . 11 2.7. Error Handling . . . . . . . . . . . . . . . . . . . . . 11
2.8. yang-patch RESTCONF Capability . . . . . . . . . . . . . 12 2.8. yang-patch RESTCONF Capability . . . . . . . . . . . . . 12
3. YANG Module . . . . . . . . . . . . . . . . . . . . . . . . . 12 3. YANG Module . . . . . . . . . . . . . . . . . . . . . . . . . 12
4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 21 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 21
4.1. YANG Module Registry . . . . . . . . . . . . . . . . . . 21 4.1. YANG Module Registry . . . . . . . . . . . . . . . . . . 21
4.2. Media Types . . . . . . . . . . . . . . . . . . . . . . . 21 4.2. Media Types . . . . . . . . . . . . . . . . . . . . . . . 21
4.2.1. Media Type application/yang-patch+xml . . . . . . . . 21 4.2.1. Media Type application/yang-patch+xml . . . . . . . . 21
4.2.2. Media Type application/yang-patch+json . . . . . . . 23 4.2.2. Media Type application/yang-patch+json . . . . . . . 23
4.3. RESTCONF Capability URNs . . . . . . . . . . . . . . . . 24 4.3. RESTCONF Capability URNs . . . . . . . . . . . . . . . . 25
5. Security Considerations . . . . . . . . . . . . . . . . . . . 25 5. Security Considerations . . . . . . . . . . . . . . . . . . . 25
6. Normative References . . . . . . . . . . . . . . . . . . . . 25 6. Normative References . . . . . . . . . . . . . . . . . . . . 26
Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 26 Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 27
Appendix B. Change Log . . . . . . . . . . . . . . . . . . . . . 27 Appendix B. Change Log . . . . . . . . . . . . . . . . . . . . . 27
B.1. v11 to v12 . . . . . . . . . . . . . . . . . . . . . . . 27 B.1. v12 to v13 . . . . . . . . . . . . . . . . . . . . . . . 27
B.2. v10 to v11 . . . . . . . . . . . . . . . . . . . . . . . 27 B.2. v11 to v12 . . . . . . . . . . . . . . . . . . . . . . . 27
B.3. v09 to v10 . . . . . . . . . . . . . . . . . . . . . . . 28 B.3. v10 to v11 . . . . . . . . . . . . . . . . . . . . . . . 28
B.4. v08 to v09 . . . . . . . . . . . . . . . . . . . . . . . 28 B.4. v09 to v10 . . . . . . . . . . . . . . . . . . . . . . . 28
B.5. v07 to v08 . . . . . . . . . . . . . . . . . . . . . . . 28 B.5. v08 to v09 . . . . . . . . . . . . . . . . . . . . . . . 28
B.6. v06 to v07 . . . . . . . . . . . . . . . . . . . . . . . 28 B.6. v07 to v08 . . . . . . . . . . . . . . . . . . . . . . . 29
B.7. v05 to v06 . . . . . . . . . . . . . . . . . . . . . . . 29 B.7. v06 to v07 . . . . . . . . . . . . . . . . . . . . . . . 29
B.8. v04 to v05 . . . . . . . . . . . . . . . . . . . . . . . 29 B.8. v05 to v06 . . . . . . . . . . . . . . . . . . . . . . . 29
B.9. v03 to v04 . . . . . . . . . . . . . . . . . . . . . . . 29 B.9. v04 to v05 . . . . . . . . . . . . . . . . . . . . . . . 29
B.10. v02 to v03 . . . . . . . . . . . . . . . . . . . . . . . 29 B.10. v03 to v04 . . . . . . . . . . . . . . . . . . . . . . . 30
B.11. v01 to v02 . . . . . . . . . . . . . . . . . . . . . . . 30 B.11. v02 to v03 . . . . . . . . . . . . . . . . . . . . . . . 30
B.12. v00 to v01 . . . . . . . . . . . . . . . . . . . . . . . 30 B.12. v01 to v02 . . . . . . . . . . . . . . . . . . . . . . . 30
B.13. bierman:yang-patch-00 to ietf:yang-patch-00 . . . . . . . 31 B.13. v00 to v01 . . . . . . . . . . . . . . . . . . . . . . . 30
B.14. bierman:yang-patch-00 to ietf:yang-patch-00 . . . . . . . 31
Appendix C. Open Issues . . . . . . . . . . . . . . . . . . . . 31 Appendix C. Open Issues . . . . . . . . . . . . . . . . . . . . 31
Appendix D. Example YANG Module . . . . . . . . . . . . . . . . 31 Appendix D. Example YANG Module . . . . . . . . . . . . . . . . 31
D.1. YANG Patch Examples . . . . . . . . . . . . . . . . . . . 32 D.1. YANG Patch Examples . . . . . . . . . . . . . . . . . . . 32
D.1.1. Add Resources: Error . . . . . . . . . . . . . . . . 32 D.1.1. Add Resources: Error . . . . . . . . . . . . . . . . 32
D.1.2. Add Resources: Success . . . . . . . . . . . . . . . 36 D.1.2. Add Resources: Success . . . . . . . . . . . . . . . 36
D.1.3. Insert list entry example . . . . . . . . . . . . . . 38 D.1.3. Insert list entry example . . . . . . . . . . . . . . 38
D.1.4. Move list entry example . . . . . . . . . . . . . . . 40 D.1.4. Move list entry example . . . . . . . . . . . . . . . 40
D.1.5. Edit datastore resource example . . . . . . . . . . . 41 D.1.5. Edit datastore resource example . . . . . . . . . . . 41
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 43 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 43
skipping to change at page 3, line 25 skipping to change at page 3, line 27
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 [RFC7950]. An "ordered edit list" approach is specified with YANG [RFC7950]. An "ordered edit list" approach is
needed to provide RESTCONF client developers with more precise needed to provide RESTCONF client developers with more precise
RESTCONF client control of the edit procedure than existing RESTCONF client control of the edit procedure than 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]. This document only specifies the use of
the YANG Patch media type with the RESTCONF protocol.
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. For any
possible to use YANG Patch with datastore types other than a protocol which supports the YANG Patch media type, if the entire
configuration datastore. This is outside the scope of this document. patch document cannot be successfully applied, then the server MUST
NOT apply any of the changes. 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 key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
"OPTIONAL" in this document are to be interpreted as described in BCP document are to be interpreted as described in [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]:
o configuration data o configuration data
o datastore o datastore
o configuration datastore o configuration datastore
skipping to change at page 6, line 35 skipping to change at page 6, line 38
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. This message-body representing the YANG Patch input parameters
MUST be provided. MUST be present.
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 within the
the same PATCH method. same PATCH method.
o YANG Patch allows more precise edit operations than RESTCONF. o YANG Patch allows more precise edit operations than RESTCONF.
There are 7 operations supported (create, delete, insert, merge, There are 7 operations supported (create, delete, insert, merge,
move, replace, remove). move, replace, remove).
o YANG Patch uses an edit list with an explicit processing order. o YANG Patch uses an edit list with an explicit processing order.
The edits are processed in client-specified order, and error The edits are processed in client-specified order, and error
processing can be precise even when multiple errors occur in the processing can be precise even when multiple errors occur in the
same patch request. same patch request.
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. This is needed by a client to determine the
message encoding formats supported by the server (e.g., XML, JSON, or
both). An example is shown in Figure 1.
Accept-Patch: application/yang-patch+xml,application/yang-patch+json
Figure 1: Example Accept-Patch header
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 version 1.1 "ietf-yang-patch" YANG module is written using YANG version 1.1
[RFC7950], an implementation of YANG Patch can be used with content [RFC7950], an implementation of YANG Patch can be used with content
defined in YANG version 1 [RFC6020] as well. defined in YANG version 1 [RFC6020] as well.
Example:
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" [RFC7951]. If any meta- "JSON Encoding of Data Modeled with YANG" [RFC7951]. If any meta-
data needs to be sent in a JSON message, it is encoded according to data needs to be sent in a JSON message, it is encoded according to
"Defining and Using Metadata with YANG" [RFC7952]. "Defining and Using Metadata with YANG" [RFC7952].
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
skipping to change at page 8, line 32 skipping to change at page 8, line 35
instance. If an edit represents more than one resource instance, instance. If an edit represents more than one resource instance,
then the request MUST NOT be processed, and a "400 Bad Request" error 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 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 any existing resource instance, and the operation for the edit is not
"create", then the request MUST NOT be processed, and a "404 Not "create", then the request MUST NOT be processed, and a "404 Not
Found" error response MUST be sent by the server. A Found" error response MUST be sent by the server. A
"yang-patch-status" response MUST be sent by the server identifying "yang-patch-status" response MUST be sent by the server identifying
the edit(s) that are not valid. the edit(s) that are not valid.
YANG Patch does not provide any access to specific datastores. It is 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- an implementation detail how a server processes an edit if it is co-
located with a NETCONF server that does provide access to individual located with a NETCONF server that does provide access to individual
datastores. A complete datastore cannot be replaced in the same datastores. A complete datastore cannot be replaced in the same
manner as provided by the "copy-config" operation defined in section manner as provided by the "copy-config" operation defined in section
7.3 of [RFC6241]. Only the specified nodes in a YANG Patch are 7.3 of [RFC6241]. Only the specified nodes in a YANG Patch are
affected. 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 Response 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
+---- patch-id? string +---- patch-id string
+---- (global-status)? +---- (global-status)?
| +--:(global-errors) | +--:(global-errors)
| | +---- errors | | +---- errors
| | +---- error* | | +---- error*
| | +---- error-type enumeration | | +---- error-type enumeration
| | +---- error-tag string | | +---- error-tag string
| | +---- error-app-tag? string | | +---- error-app-tag? string
| | +---- error-path? instance-identifier | | +---- error-path? instance-identifier
| | +---- error-message? string | | +---- error-message? string
| | +---- error-info? | | +---- error-info?
| +--:(ok) | +--:(ok)
| +---- ok? empty | +---- ok? empty
+---- edit-status +---- edit-status
+---- edit* [edit-id] +---- edit* [edit-id]
+---- edit-id? string +---- edit-id string
+---- (edit-status-choice)? +---- (edit-status-choice)?
+--:(ok) +--:(ok)
| +---- ok? empty | +---- ok? empty
+--:(errors) +--:(errors)
+---- errors +---- errors
+---- error* +---- error*
+---- error-type enumeration +---- error-type enumeration
+---- error-tag string +---- error-tag string
+---- error-app-tag? string +---- error-app-tag? string
+---- error-path? instance-identifier +---- error-path? instance-identifier
skipping to change at page 11, line 32 skipping to change at page 11, line 32
| | create if it does not already exist | | | 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 value | | replace | replace the target data resource with the edit value |
| remove | remove a data resource if it already exists | | remove | remove a data resource if it already exists |
+-----------+-------------------------------------------------------+ +-----------+-------------------------------------------------------+
YANG Patch Edit Operations YANG Patch Edit Operations
2.6. Successful Edit Response Handling 2.6. Successful Edit Response Handling
If a YANG Patch is completed without errors, the RESTCONF server If a YANG Patch is completed without errors, the RESTCONF server MUST
SHOULD return a "yang-patch-status" message. return a "yang-patch-status" message with a global-status choice set
to 'ok'.
The RESTCONF server will save the running datastore to non-volatile The RESTCONF server will save the running datastore to non-volatile
storage if it supports non-volatile storage, and if the running storage if it supports non-volatile storage, and if the running
datastore contents have changed, as specified in datastore contents have changed, as specified in
[I-D.ietf-netconf-restconf]. [I-D.ietf-netconf-restconf].
Refer to Appendix D.1.2 for a example of a successful YANG Patch Refer to Appendix D.1.2 for a example of a successful YANG Patch
response. response.
2.7. Error Handling 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 RESTCONF server will process the supplied edits in ascending the RESTCONF server will process the supplied edits in ascending
order. The following error modes apply to the processing of this order. The following error modes apply to the processing of this
edit list: edit list:
If a YANG Patch is completed with errors, the RESTCONF server SHOULD If a YANG Patch is completed with errors, the RESTCONF server SHOULD
return a "yang-patch-status" message. return a "yang-patch-status" message. It is possible (e.g., within a
distributed implementation), that an invalid request will be rejected
before the YANG patch edits are processed. In this case, the server
MUST send the appropriate HTTP error response instead.
Refer to Appendix D.1.1 for a example of an error YANG Patch Refer to Appendix D.1.1 for a example of an error YANG Patch
response. response.
2.8. yang-patch RESTCONF Capability 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 RESTCONF server supports the YANG Patch RESTCONF protocol. If the RESTCONF server supports the YANG Patch
media type, then the "yang-patch" RESTCONF capability defined in media type, then the "yang-patch" RESTCONF capability defined in
Section 4.3 MUST be present in the "capability" leaf-list in the Section 4.3 MUST be present in the "capability" leaf-list in the
skipping to change at page 12, line 29 skipping to change at page 12, line 35
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-09-26.yang" <CODE BEGINS> file "ietf-yang-patch@2016-11-09.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";
skipping to change at page 13, line 31 skipping to change at page 13, line 37
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-12.txt // Note: extracted from draft-ietf-netconf-yang-patch-13.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-09-26 { revision 2016-11-09 {
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
skipping to change at page 14, line 46 skipping to change at page 15, line 4
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."; "RFC 7950, section 8.3.";
leaf patch-id { leaf patch-id {
type string; type string;
mandatory true; mandatory true;
description description
"An arbitrary string provided by the client to identify "An arbitrary string provided by the client to identify
the entire patch. Error messages returned by the server the entire patch. Error messages returned by the server
pertaining to this patch will be identified by this pertaining to this patch will be identified by this
patch-id value."; patch-id value. A client SHOULD attempt to generate
unique patch-id values to distinguish between transactions
from multiple clients in any audit logs maintained
by the server.";
} }
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.";
} }
skipping to change at page 21, line 32 skipping to change at page 21, line 43
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+xml
Required parameters: None Required parameters: None
Optional parameters: None Optional parameters: None
// 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
skipping to change at page 22, line 28 skipping to change at page 22, line 38
// 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: Fragment identifiers Fragment identifier considerations: Same as for application/xml
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): None
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.
Person & email address to contact for further information: See Person & email address to contact for further information: See
Authors' Addresses section of [RFCXXXX]. Authors' Addresses section of [RFCXXXX].
Intended usage: COMMON Intended usage: COMMON
skipping to change at page 24, line 25 skipping to change at page 24, line 34
that utilize the YANG Patch data structure. that utilize the YANG Patch data structure.
Fragment identifier considerations: The syntax and semantics Fragment identifier considerations: The syntax and semantics
of fragment identifiers are the same as specified for the of fragment identifiers are the same as specified for the
"application/json" media type. "application/json" media type.
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): .json File extension(s): None
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.
Person & email address to contact for further information: See Person & email address to contact for further information: See
Authors' Addresses section of [RFCXXXX]. Authors' Addresses section of [RFCXXXX].
Intended usage: COMMON Intended usage: COMMON
skipping to change at page 25, line 22 skipping to change at page 25, line 33
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 It may be possible to use YANG Patch with other protocols besides
RESTCONF, which is outside the scope of this document. RESTCONF, which is outside the scope of this document.
It is important for RESTCONF server implementations to carefully For RESTCONF, both the client and server MUST be authenticated,
validate all the edit request parameters in some manner. If the according to section 2 of [I-D.ietf-netconf-restconf]. It is
entire YANG Patch request cannot be completed, then no configuration important for RESTCONF server implementations to carefully validate
changes to the system are done. A PATCH request MUST be applied all the edit request parameters in some manner. If the entire YANG
atomically, as specified in section 2 of [RFC5789]. Patch request cannot be completed, then no configuration changes to
the system are done. A PATCH request MUST be applied atomically, as
specified in section 2 of [RFC5789].
A RESTCONF server implementation SHOULD attempt to prevent system A RESTCONF server implementation SHOULD attempt to prevent system
disruption due to partial processing of the YANG Patch edit list. It disruption due to incremental processing of the YANG Patch edit list.
may be possible to construct an attack on such a RESTCONF server, It may be possible to construct an attack on such a RESTCONF server,
which relies on the edit processing order mandated by YANG Patch. which relies on the edit processing order mandated by YANG Patch. A
server SHOULD apply only the fully validated configuration to the
underlying system. For example, an edit list which deleted an
interface and then recreated it could cause system disruption if the
edit list was incrementally applied.
A RESTCONF server implementation SHOULD attempt to prevent system A RESTCONF server implementation SHOULD attempt to prevent system
disruption due to excessive resource consumption required to fulfill disruption due to excessive resource consumption required to fulfill
YANG Patch edit requests. It may be possible to construct an attack YANG Patch edit requests. It may be possible to construct an attack
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-18 (work in
progress), April 2016. progress), October 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 27, line 19 skipping to change at page 27, line 35
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. v11 to v12 B.1. v12 to v13
o clarifications based on IESG reviews
B.2. v11 to v12
o clarify target resource must exist o clarify target resource must exist
o fix errors in some examples o fix errors in some examples
o change application/yang-patch-xml to application/yang-patch+xml o change application/yang-patch-xml to application/yang-patch+xml
o clarified some section titles o clarified some section titles
o clarified error responses for multiple edit instances o clarified error responses for multiple edit instances
skipping to change at page 27, line 32 skipping to change at page 28, line 4
o fix errors in some examples o fix errors in some examples
o change application/yang-patch-xml to application/yang-patch+xml o change application/yang-patch-xml to application/yang-patch+xml
o clarified some section titles o clarified some section titles
o clarified error responses for multiple edit instances o clarified error responses for multiple edit instances
o made patch-id field mandatory o made patch-id field mandatory
o referenced NETCONF operation attribute o referenced NETCONF operation attribute
B.2. v10 to v11 B.3. 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 examples o fixed missing keys in edit examples
o added insert list example o added insert list example
B.3. v09 to v10 B.4. 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.4. v08 to v09 B.5. 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.5. v07 to v08 B.6. 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.6. v06 to v07 B.7. 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.7. v05 to v06 B.8. 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.8. v04 to v05 B.9. v04 to v05
o updated reference to RESTCONF o updated reference to RESTCONF
B.9. v03 to v04 B.10. 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.10. v02 to v03 B.11. 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.11. v01 to v02 B.12. 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.12. v00 to v01 B.13. 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
about a normative reference to RESTCONF. There may need to be a about a normative reference to RESTCONF. There may need to be a
YANG 1.1 mechanism to allow protocol template usage (instead of YANG 1.1 mechanism to allow protocol template usage (instead of
grouping wrapper). grouping wrapper).
o Removed open issue 'Is the delete operation needed'. It was o Removed open issue 'Is the delete operation needed'. It was
decided that both delete and remove should remain as operations decided that both delete and remove should remain as operations
skipping to change at page 31, line 7 skipping to change at page 31, line 35
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.13. bierman:yang-patch-00 to ietf:yang-patch-00 B.14. 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!
 End of changes. 51 change blocks. 
81 lines changed or deleted 104 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/