draft-ietf-netconf-yang-patch-03.txt | draft-ietf-netconf-yang-patch-04.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: August 3, 2015 Tail-f Systems | Expires: December 6, 2015 Tail-f Systems | |||
K. Watsen | K. Watsen | |||
Juniper Networks | Juniper Networks | |||
January 30, 2015 | June 4, 2015 | |||
YANG Patch Media Type | YANG Patch Media Type | |||
draft-ietf-netconf-yang-patch-03 | draft-ietf-netconf-yang-patch-04 | |||
Abstract | Abstract | |||
This document describes a method for applying patches to NETCONF | This document describes a method for applying patches to NETCONF | |||
datastores using data defined with the YANG data modeling language. | datastores using data defined with the YANG data modeling language. | |||
Status of This Memo | Status of This Memo | |||
This Internet-Draft is submitted in full conformance with the | This Internet-Draft is submitted in full conformance with the | |||
provisions of BCP 78 and BCP 79. | provisions of BCP 78 and BCP 79. | |||
skipping to change at page 1, line 34 | skipping to change at page 1, line 34 | |||
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 August 3, 2015. | This Internet-Draft will expire on December 6, 2015. | |||
Copyright Notice | Copyright Notice | |||
Copyright (c) 2015 IETF Trust and the persons identified as the | Copyright (c) 2015 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 10 | skipping to change at page 2, line 10 | |||
to this document. Code Components extracted from this document must | to this document. Code Components extracted from this document must | |||
include Simplified BSD License text as described in Section 4.e of | include Simplified BSD License text as described in Section 4.e of | |||
the Trust Legal Provisions and are provided without warranty as | the Trust Legal Provisions and are provided without warranty as | |||
described in the Simplified BSD License. | described in the Simplified BSD License. | |||
Table of Contents | Table of Contents | |||
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 | 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 | |||
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 . . . . . . . . . . . . . . . . . . . . . . . . 3 | |||
1.1.3. YANG . . . . . . . . . . . . . . . . . . . . . . . . 4 | 1.1.3. YANG . . . . . . . . . . . . . . . . . . . . . . . . 4 | |||
1.1.4. RESTCONF . . . . . . . . . . . . . . . . . . . . . . 5 | 1.1.4. RESTCONF . . . . . . . . . . . . . . . . . . . . . . 4 | |||
1.1.5. Terms . . . . . . . . . . . . . . . . . . . . . . . . 5 | 1.1.5. YANG Patch . . . . . . . . . . . . . . . . . . . . . 5 | |||
1.1.6. Tree Diagrams . . . . . . . . . . . . . . . . . . . . 5 | 1.1.6. Tree Diagrams . . . . . . . . . . . . . . . . . . . . 5 | |||
2. YANG Patch . . . . . . . . . . . . . . . . . . . . . . . . . 6 | 2. YANG Patch . . . . . . . . . . . . . . . . . . . . . . . . . 5 | |||
2.1. Target Resource . . . . . . . . . . . . . . . . . . . . . 6 | 2.1. Target Resource . . . . . . . . . . . . . . . . . . . . . 6 | |||
2.2. yang-patch Input . . . . . . . . . . . . . . . . . . . . 6 | 2.2. yang-patch Input . . . . . . . . . . . . . . . . . . . . 6 | |||
2.3. yang-patch-status Output . . . . . . . . . . . . . . . . 7 | 2.3. yang-patch-status Output . . . . . . . . . . . . . . . . 7 | |||
2.4. Target Data Node . . . . . . . . . . . . . . . . . . . . 7 | 2.4. Target Data Node . . . . . . . . . . . . . . . . . . . . 7 | |||
2.5. Edit Operations . . . . . . . . . . . . . . . . . . . . . 8 | 2.5. Edit Operations . . . . . . . . . . . . . . . . . . . . . 7 | |||
2.6. Error Handling . . . . . . . . . . . . . . . . . . . . . 8 | 2.6. Error Handling . . . . . . . . . . . . . . . . . . . . . 8 | |||
2.7. yang-patch RESTCONF Capability . . . . . . . . . . . . . 9 | 2.7. yang-patch RESTCONF Capability . . . . . . . . . . . . . 8 | |||
3. YANG Module . . . . . . . . . . . . . . . . . . . . . . . . . 9 | 3. YANG Module . . . . . . . . . . . . . . . . . . . . . . . . . 8 | |||
4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 18 | 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 17 | |||
4.1. YANG Module Registry . . . . . . . . . . . . . . . . . . 18 | 4.1. YANG Module Registry . . . . . . . . . . . . . . . . . . 17 | |||
4.2. application/yang.patch Media Types . . . . . . . . . . . 18 | 4.2. application/yang.patch Media Types . . . . . . . . . . . 18 | |||
4.3. application/yang.patch-status Media Types . . . . . . . . 18 | 4.3. application/yang.patch-status Media Types . . . . . . . . 18 | |||
4.4. RESTCONF Capability URNs . . . . . . . . . . . . . . . . 19 | 4.4. RESTCONF Capability URNs . . . . . . . . . . . . . . . . 19 | |||
5. Security Considerations . . . . . . . . . . . . . . . . . . . 19 | 5. Security Considerations . . . . . . . . . . . . . . . . . . . 19 | |||
6. Normative References . . . . . . . . . . . . . . . . . . . . 20 | 6. Normative References . . . . . . . . . . . . . . . . . . . . 19 | |||
Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 20 | Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 20 | |||
Appendix B. Change Log . . . . . . . . . . . . . . . . . . . . . 20 | Appendix B. Change Log . . . . . . . . . . . . . . . . . . . . . 20 | |||
B.1. 02 to 03 . . . . . . . . . . . . . . . . . . . . . . . . 21 | B.1. 03 to 04 . . . . . . . . . . . . . . . . . . . . . . . . 20 | |||
B.2. 01 to 02 . . . . . . . . . . . . . . . . . . . . . . . . 21 | B.2. 02 to 03 . . . . . . . . . . . . . . . . . . . . . . . . 21 | |||
B.3. 00 to 01 . . . . . . . . . . . . . . . . . . . . . . . . 21 | B.3. 01 to 02 . . . . . . . . . . . . . . . . . . . . . . . . 21 | |||
B.4. bierman:yang-patch-00 to ietf:yang-patch-00 . . . . . . . 22 | B.4. 00 to 01 . . . . . . . . . . . . . . . . . . . . . . . . 21 | |||
B.5. bierman:yang-patch-00 to ietf:yang-patch-00 . . . . . . . 22 | ||||
Appendix C. Open Issues . . . . . . . . . . . . . . . . . . . . 22 | Appendix C. Open Issues . . . . . . . . . . . . . . . . . . . . 22 | |||
Appendix D. Example YANG Module . . . . . . . . . . . . . . . . 22 | Appendix D. Example YANG Module . . . . . . . . . . . . . . . . 22 | |||
D.1. YANG Patch Examples . . . . . . . . . . . . . . . . . . . 23 | D.1. YANG Patch Examples . . . . . . . . . . . . . . . . . . . 23 | |||
D.1.1. Add Resources: Error . . . . . . . . . . . . . . . . 23 | D.1.1. Add Resources: Error . . . . . . . . . . . . . . . . 23 | |||
D.1.2. Add Resources: Success . . . . . . . . . . . . . . . 25 | D.1.2. Add Resources: Success . . . . . . . . . . . . . . . 25 | |||
D.1.3. Move list entry example . . . . . . . . . . . . . . . 27 | D.1.3. Move list entry example . . . . . . . . . . . . . . . 27 | |||
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 28 | Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 28 | |||
1. Introduction | 1. Introduction | |||
There is a need for standard mechanisms to patch NETCONF [RFC6241] | There is a need for standard mechanisms to patch NETCONF [RFC6241] | |||
datastores which contain conceptual data that conforms to schema | datastores which contain conceptual data that conforms to schema | |||
specified with YANG [RFC6020]. An "ordered edit list" approach is | specified with YANG [RFC6020]. An "ordered edit list" approach is | |||
needed to provide client developers with a simpler edit request | needed to provide client developers with a simpler edit request | |||
format that can be more efficient and also allow more precise client | format that can be more efficient and also allow more precise client | |||
control of the transaction procedure than existing mechanisms. | control of the transaction procedure than existing mechanisms. | |||
This document defines a media type for a YANG-based editing mechanism | This document defines a media type for a YANG-based editing mechanism | |||
that can be used with the HTTP PATCH method [RFC5789] or custom | that can be used with the HTTP PATCH method [RFC5789]. YANG Patch is | |||
NETCONF operations (defined with the YANG rpc-stmt). | designed to support the RESTCONF protocol, defined in | |||
[I-D.ietf-netconf-restconf]. | ||||
YANG Patch is designed to support multiple protocols with the same | ||||
mechanisms. The RESTCONF protocol defined in | ||||
[I-D.ietf-netconf-restconf] utilizes YANG Patch with the HTTP PATCH | ||||
method. A new RPC operation can be defined to utilize YANG Patch in | ||||
the NETCONF protocol. Both the RESTCONF and NETCONF protocols are | ||||
designed to utilize the YANG data modeling language to specify | ||||
content schema modules. | ||||
1.1. Terminology | 1.1. Terminology | |||
The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", | The keywords "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", | |||
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and | "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and | |||
"OPTIONAL" in this document are to be interpreted as described in BCP | "OPTIONAL" in this document are to be interpreted as described in BCP | |||
14, [RFC2119]. | 14, [RFC2119]. | |||
1.1.1. NETCONF | 1.1.1. NETCONF | |||
The following terms are defined in [RFC6241]: | The following terms are defined in [RFC6241]: | |||
o candidate configuration datastore | ||||
o client | o client | |||
o configuration data | o configuration data | |||
o datastore | o datastore | |||
o configuration datastore | o configuration datastore | |||
o protocol operation | o protocol operation | |||
o running configuration datastore | o running configuration datastore | |||
o server | o server | |||
o startup configuration datastore | ||||
o state data | o state data | |||
o user | o user | |||
1.1.2. HTTP | 1.1.2. HTTP | |||
The following terms are defined in [RFC2616]: | The following terms are defined in [RFC2616]: | |||
o entity tag | o entity tag | |||
skipping to change at page 5, line 11 | skipping to change at page 4, line 46 | |||
o ordered-by system | o ordered-by system | |||
o ordered-by user | o ordered-by user | |||
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 data resource | o data resource | |||
o datasource resource | o datastore resource | |||
o patch | o patch | |||
o RESTCONF capability | o RESTCONF capability | |||
o target resource | o target resource | |||
1.1.5. Terms | 1.1.5. YANG Patch | |||
The following terms are used within this document: | The following terms are used within this document: | |||
o YANG Patch: a conceptual edit request using the "yang-patch" YANG | o YANG Patch: a conceptual edit request using the "yang-patch" YANG | |||
container, defined in Section 3. In HTTP, refers to a PATCH | container, defined in Section 3. In HTTP, refers to a PATCH | |||
method where the media type is "application/yang.patch+xml" or | method where the media type is "application/yang.patch+xml" or | |||
"application/yang.patch+json". | "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" container, defined in Section 3. In | YANG "yang-patch-status" container, defined in Section 3. In | |||
skipping to change at page 6, line 8 | skipping to change at page 5, line 44 | |||
o Parentheses enclose choice and case nodes, and case nodes are also | o Parentheses enclose choice and case nodes, and case nodes are also | |||
marked with a colon (":"). | marked with a colon (":"). | |||
o Ellipsis ("...") stands for contents of subtrees that are not | o Ellipsis ("...") stands for contents of subtrees that are not | |||
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 server. The specific fields are defined with | target datastore by the server. The specific fields are defined in | |||
the 'application/yang.patch' extension definition in the YANG module | the YANG module in Section 3. | |||
Section 3. | ||||
For RESTCONF, the YANG Patch operation is invoked by the client by | For RESTCONF, the YANG Patch operation is invoked by the client by | |||
sending a PATCH method request with the YANG Patch media type. A | sending a PATCH method request with the YANG Patch media type. A | |||
message body representing the YANG Patch input parameters MUST be | message body representing the YANG Patch input parameters MUST be | |||
provided. | provided. | |||
The RESTCONF server MUST return the Accept-Patch header in an OPTIONS | The RESTCONF server MUST return the Accept-Patch header in an OPTIONS | |||
response, as specified in [RFC5789], which includes the media type | response, as specified in [RFC5789], which includes the media type | |||
for YANG Patch. | for YANG Patch. | |||
skipping to change at page 6, line 34 | skipping to change at page 6, line 22 | |||
2.1. Target Resource | 2.1. Target Resource | |||
The YANG Patch operation uses a conceptual root within a NETCONF | The YANG Patch operation uses a conceptual root within a NETCONF | |||
configuration datastore to identity the patch point for the edit | configuration datastore to identity the patch point for the edit | |||
operation. This root can be the datastore itself, or 1 or more data | operation. This root can be the datastore itself, or 1 or more data | |||
nodes within the datastore. | nodes within the datastore. | |||
For RESTCONF, the target resource is derived from the request URI. | For RESTCONF, the target resource is derived from the request URI. | |||
For NETCONF, the target resource MUST be defined as an input | ||||
parameter in the YANG "rpc" statement. | ||||
2.2. yang-patch Input | 2.2. yang-patch Input | |||
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 | ||||
edits. Each edit is identified by an "edit-id" and it has an edit | ||||
operation (create, delete, insert, merge, move, replace, remove) that | ||||
is applied to the target resource. Each edit can be applied to a | ||||
sub-resource "target" within the target resource. If the operation | ||||
is "insert" or "move", then the "where" parameter indicates how the | ||||
node is inserted or moved. For values "before" and "after", the | ||||
"point" parameter specifies the data node insertion point. | ||||
A data element representing the YANG Patch is sent by the client to | A data element representing the YANG Patch is sent by the client to | |||
specify the edit operation request. When used with the HTTP PATCH | specify the edit operation request. When used with the HTTP PATCH | |||
method, this data is identified by the YANG Patch media type. | method, this data is identified by the YANG Patch media type. | |||
YANG Tree Diagram For "yang-patch" Container | YANG Tree Diagram For "yang-patch" Container | |||
+--rw yang-patch | +--rw yang-patch | |||
+--rw patch-id? string | +--rw patch-id? string | |||
+--rw comment? string | +--rw comment? string | |||
+--rw edit [edit-id] | +--rw edit [edit-id] | |||
+--rw edit-id string | +--rw edit-id string | |||
+--rw operation enumeration | +--rw operation enumeration | |||
+--rw target target-resource-offset | +--rw target target-resource-offset | |||
+--rw point? target-resource-offset | +--rw point? target-resource-offset | |||
+--rw where? enumeration | +--rw where? enumeration | |||
+--rw value | +--rw value | |||
skipping to change at page 7, line 20 | skipping to change at page 7, line 10 | |||
+--rw target target-resource-offset | +--rw target target-resource-offset | |||
+--rw point? target-resource-offset | +--rw point? target-resource-offset | |||
+--rw where? enumeration | +--rw where? enumeration | |||
+--rw value | +--rw value | |||
2.3. yang-patch-status Output | 2.3. yang-patch-status Output | |||
A data element representing the YANG Patch Status is returned to the | A data element representing the YANG Patch Status is returned to the | |||
client to report the detailed status of the edit operation. When | client to report the detailed status of the edit operation. When | |||
used with the HTTP PATCH method, this data is identified by the YANG | used with the HTTP PATCH method, this data is identified by the YANG | |||
Patch Status media type, and the syntax specification is defined by | Patch Status media type, and the syntax specification is defined in | |||
the 'application/yang.patch-status' extension statement defined in | ||||
Section 3. | Section 3. | |||
YANG Tree Diagram For "yang-patch-status" Container: | YANG Tree Diagram For "yang-patch-status" Container: | |||
+--rw yang-patch-status | +--rw yang-patch-status | |||
+--rw patch-id? string | +--rw patch-id? string | |||
+--rw (global-status)? | +--rw (global-status)? | |||
| +--:(global-errors) | | +--:(global-errors) | |||
| | +--ro errors | | | +--ro errors | |||
| | | | | | |||
skipping to change at page 8, line 42 | skipping to change at page 8, line 29 | |||
YANG Patch Edit Operations | YANG Patch Edit Operations | |||
2.6. Error Handling | 2.6. Error Handling | |||
If a well-formed, schema-valid YANG Patch message is received, then | If a well-formed, schema-valid YANG Patch message is received, then | |||
the server will process the supplied edits in ascending order. The | the server will process the supplied edits in ascending order. The | |||
following error modes apply to the processing of this edit list: | following error modes apply to the processing of this edit list: | |||
All the specified edits MUST be applied or the target datastore | All the specified edits MUST be applied or the target datastore | |||
contents SHOULD be returned to its original state before the PATCH | contents MUST be returned to its original state before the PATCH | |||
method started. The server MAY fail to restore the contents of the | method started. | |||
target datastore completely and with certainty. It is possible for a | ||||
rollback to fail or an "undo" operation to fail. | ||||
The server will save the running datastore to non-volatile storage if | The server will save the running datastore to non-volatile storage if | |||
it has changed, after the edits have been attempted. | it has changed, after the edits have been successfully completed. | |||
2.7. yang-patch RESTCONF Capability | 2.7. yang-patch RESTCONF Capability | |||
A URI is defined to identify the YANG Patch extension to the base | A URI is defined to identify the YANG Patch extension to the base | |||
RESTCONF protocol. If the server supports the YANG Patch media type, | RESTCONF protocol. If the server supports the YANG Patch media type, | |||
then the "yang-patch" RESTCONF capability defined in Section 4.4 MUST | then the "yang-patch" RESTCONF capability defined in Section 4.4 MUST | |||
be present in the "capability" leaf-list in the | be present in the "capability" leaf-list in the | |||
"ietf-restconf-monitoring" module defined in | "ietf-restconf-monitoring" module defined in | |||
[I-D.ietf-netconf-restconf]. | [I-D.ietf-netconf-restconf]. | |||
skipping to change at page 9, line 26 | skipping to change at page 9, line 8 | |||
The "ietf-yang-patch" module defines conceptual definitions with the | The "ietf-yang-patch" module defines conceptual definitions with the | |||
'restconf-media-type' extension statements, which are not meant to be | 'restconf-media-type' extension statements, which are not meant to be | |||
implemented as datastore contents by a server. | implemented as datastore contents by a server. | |||
The "ietf-restconf" module from [I-D.ietf-netconf-restconf] is used | The "ietf-restconf" module from [I-D.ietf-netconf-restconf] is used | |||
by this module for the 'restconf-media-type' extension definition. | by this module for the 'restconf-media-type' extension definition. | |||
RFC Ed.: update the date below with the date of RFC publication and | RFC Ed.: update the date below with the date of RFC publication and | |||
remove this note. | remove this note. | |||
<CODE BEGINS> file "ietf-yang-patch@2015-01-24.yang" | <CODE BEGINS> file "ietf-yang-patch@2015-04-30.yang" | |||
module ietf-yang-patch { | module 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"; | |||
import ietf-yang-types { prefix yang; } | ||||
import ietf-restconf { | import ietf-restconf { | |||
prefix rc; | prefix rc; | |||
revision-date 2015-01-30; | revision-date 2015-06-04; | |||
} | } | |||
organization | organization | |||
"IETF NETCONF (Network Configuration) Working Group"; | "IETF NETCONF (Network Configuration) Working Group"; | |||
contact | contact | |||
"WG Web: <http://tools.ietf.org/wg/netconf/> | "WG Web: <http://tools.ietf.org/wg/netconf/> | |||
WG List: <mailto:netconf@ietf.org> | WG List: <mailto:netconf@ietf.org> | |||
WG Chair: Mehmet Ersue | WG Chair: Mehmet Ersue | |||
skipping to change at page 10, line 41 | skipping to change at page 10, line 24 | |||
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-03.txt | // Note: extracted from draft-ietf-netconf-yang-patch-03.txt | |||
// RFC Ed.: update the date below with the date of RFC publication | // RFC Ed.: update the date below with the date of RFC publication | |||
// and remove this note. | // and remove this note. | |||
revision 2015-01-30 { | revision 2015-06-04 { | |||
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 yang:xpath1.0; | |||
length "1 .. max"; | ||||
} | ||||
description | description | |||
"Contains a relative Data Resource Identifier formatted string | "Contains an XPath absolute path expression identifying | |||
to identify a specific data sub-resource instance. | a sub-resource within the target resource. | |||
The document root for all data resources is a | The document root for this XPath expression is the | |||
target data resource that is specified in the | target resource that is specified in the | |||
object definition using this data type."; | protocol operation (e.g., the URI for the PATCH request)."; | |||
} | } | |||
rc:restconf-media-type "application/yang.patch" { | rc:restconf-media-type "application/yang.patch" { | |||
uses yang-patch; | uses yang-patch; | |||
} | } | |||
rc:restconf-media-type "application/yang.patch-status" { | rc:restconf-media-type "application/yang.patch-status" { | |||
uses yang-patch-status; | uses yang-patch-status; | |||
} | } | |||
skipping to change at page 11, line 35 | skipping to change at page 11, line 17 | |||
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. | |||
A patch MUST be validated by the server to be a | ||||
well-formed message before any of the patch edits | ||||
are validated or attempted. | ||||
YANG datastore validation (defined in RFC 6020, section | YANG datastore validation (defined in RFC 6020, section | |||
8.3.3) is performed after all edits have been | 8.3.3) is performed before any edits have been applied | |||
individually validated. | to the running datastore. | |||
It is possible for a datastore constraint violation to occur | It is possible for a datastore constraint violation to occur | |||
due to any node in the datastore, including nodes not | due to any node in the datastore, including nodes not | |||
included in the edit list. Any validation errors MUST | included in the edit list. Any validation errors MUST | |||
be reported in the reply message."; | be reported in the reply message."; | |||
reference | reference | |||
"RFC 6020, section 8.3."; | "RFC 6020, section 8.3."; | |||
leaf patch-id { | leaf patch-id { | |||
type string; | type string; | |||
description | description | |||
"An arbitrary string provided by the client to identify | "An arbitrary string provided by the client to identify | |||
the entire patch. This value SHOULD be present in any | the entire patch. This value SHOULD be present in any | |||
audit logging records generated by the server for the | audit logging records generated by the server for the | |||
patch. Error messages returned by the server pertaining | patch. Error messages returned by the server pertaining | |||
to this patch will be identified by this patch-id value."; | to this patch will be identified by this patch-id value."; | |||
} | } | |||
leaf comment { | leaf comment { | |||
type string { | type string; | |||
length "0 .. 1024"; | ||||
} | ||||
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; | |||
skipping to change at page 13, line 21 | skipping to change at page 12, line 45 | |||
} | } | |||
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."; | represent a new data resource. If the 'where' | |||
parameter is set to 'before' or 'after', then | ||||
the 'point' parameter identifies the insertion | ||||
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."; | an existing data resource. If the 'where' parameter | |||
is set to 'before' or 'after', then the 'point' | ||||
parameter identifies the insertion point to move | ||||
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."; | |||
} | } | |||
skipping to change at page 18, line 35 | skipping to change at page 18, line 14 | |||
4.2. application/yang.patch Media Types | 4.2. application/yang.patch Media Types | |||
The MIME media type for a YANG Patch document is application/ | The MIME media type for a YANG Patch document is application/ | |||
yang.patch. | yang.patch. | |||
Type name: application | Type name: application | |||
Subtype name: yang.patch | Subtype name: yang.patch | |||
Required parameters: TBD | Required parameters: none | |||
Optional parameters: TBD | Optional parameters: none | |||
Encoding considerations: TBD | Encoding considerations: 8-bit | |||
Security considerations: TBD | Security considerations: See Section 5 of RFC XXXX | |||
Interoperability considerations: TBD | Interoperability considerations: none | |||
// RFC Ed.: replace XXXX with RFC number and remove this note | // RFC Ed.: replace XXXX with RFC number and remove this note | |||
Published specification: RFC XXXX | Published specification: RFC XXXX | |||
4.3. application/yang.patch-status Media Types | 4.3. application/yang.patch-status Media Types | |||
The MIME media type for a YANG Patch status document is application/ | The MIME media type for a YANG Patch status document is application/ | |||
yang.patch-status. | yang.patch-status. | |||
Type name: application | Type name: application | |||
Subtype name: yang.patch-status | Subtype name: yang.patch-status | |||
Required parameters: TBD | Required parameters: none | |||
Optional parameters: TBD | Optional parameters: none | |||
Encoding considerations: TBD | Encoding considerations: 8-bit | |||
Security considerations: TBD | Security considerations: See Section 5 of RFC XXXX | |||
Interoperability considerations: TBD | Interoperability considerations: none | |||
// RFC Ed.: replace XXXX with RFC number and remove this note | // RFC Ed.: replace XXXX with RFC number and remove this note | |||
Published specification: RFC XXXX | Published specification: RFC XXXX | |||
4.4. RESTCONF Capability URNs | 4.4. RESTCONF Capability URNs | |||
This document registers several capability identifiers in "RESTCONF | This document registers one capability identifier in "RESTCONF | |||
Protocol Capability URNs" registry | Protocol Capability URNs" registry | |||
Index | Index | |||
Capability Identifier | Capability Identifier | |||
------------------------ | ------------------------ | |||
:yang-patch | :yang-patch | |||
urn:ietf:params:restconf:capability:yang-patch:1.0 | urn:ietf:params:restconf:capability:yang-patch:1.0 | |||
5. Security Considerations | 5. Security Considerations | |||
skipping to change at page 20, line 9 | skipping to change at page 19, line 39 | |||
A server implementation SHOULD attempt to prevent system disruption | A server implementation SHOULD attempt to prevent system disruption | |||
due to partial processing of the YANG Patch edit list. It may be | due to partial processing of the YANG Patch edit list. It may be | |||
possible to construct an attack on such a server, which relies on the | possible to construct an attack on such a server, which relies on the | |||
edit processing order mandated by YANG Patch. | edit processing order mandated by YANG Patch. | |||
6. Normative References | 6. Normative References | |||
[I-D.ietf-netconf-restconf] | [I-D.ietf-netconf-restconf] | |||
Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF | Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF | |||
Protocol", draft-ietf-netconf-restconf-04 (work in | Protocol", draft-ietf-netconf-restconf-05 (work in | |||
progress), January 2015. | progress), June 2015. | |||
[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. | |||
[RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., | [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., | |||
Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext | Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext | |||
Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. | Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. | |||
[RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, | [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, | |||
January 2004. | January 2004. | |||
skipping to change at page 21, line 5 | skipping to change at page 20, line 35 | |||
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 | |||
contributions to this document: Rex Fernando. | contributions to this document: Rex Fernando. | |||
Appendix B. Change Log | Appendix B. Change Log | |||
-- RFC Ed.: remove this section before publication. | -- RFC Ed.: remove this section before publication. | |||
B.1. 02 to 03 | The YANG Patch issue tracker can be found here: https://github.com/ | |||
netconf-wg/yang-patch/issues | ||||
B.1. 03 to 04 | ||||
o removed NETCONF specific text | ||||
o changed data-resource-offset typedef from a relative URI to an | ||||
XPath absolute path expression | ||||
o clarified insert operation | ||||
o removed requirement that edits MUST be applied in ascending order | ||||
o change SHOULD keep datastore unchanged on error to MUST (this is | ||||
required by HTTP PATCH) | ||||
o removed length restriction on 'comment' leaf | ||||
o updated YANG tree for example-jukebox library | ||||
B.2. 02 to 03 | ||||
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.2. 01 to 02 | B.3. 01 to 02 | |||
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.3. 00 to 01 | B.4. 00 to 01 | |||
o Added text requiring support for Accept-Patch header, and removed | o Added text requiring support for Accept-Patch header, and removed | |||
'Identification of YANG Patch capabilities' open issue. | 'Identification of YANG Patch capabilities' open issue. | |||
o Removed 'location' leaf from yang-patch-status grouping | o Removed 'location' leaf from yang-patch-status grouping | |||
o Removed open issue 'Protocol independence' because the location | o Removed open issue 'Protocol independence' because the location | |||
leaf was removed. | leaf was removed. | |||
o Removed open issue 'RESTCONF coupling' because there is no concern | o Removed open issue 'RESTCONF coupling' because there is no concern | |||
skipping to change at page 22, line 18 | skipping to change at page 22, line 18 | |||
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.4. bierman:yang-patch-00 to ietf:yang-patch-00 | B.5. 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! | |||
+--rw library | +--rw library | |||
| +--rw artist [name] | | +--rw artist* [name] | |||
| | +--rw name string | | | +--rw name string | |||
| | +--rw album [name] | | | +--rw album* [name] | |||
| | +--rw name string | | | +--rw name string | |||
| | +--rw genre? identityref | | | +--rw genre? identityref | |||
| | +--rw year? uint16 | | | +--rw year? uint16 | |||
| | +--rw admin | | | +--rw admin | |||
| | | +--rw label? string | | | | +--rw label? string | |||
| | | +--rw catalogue-number? string | | | | +--rw catalogue-number? string | |||
| | +--rw song [name] | | | +--rw song* [name] | |||
| | +--rw name string | | | +--rw name string | |||
| | +--rw location string | | | +--rw location string | |||
| | +--rw format? string | | | +--rw format? string | |||
| | +--rw length? uint32 | | | +--rw length? uint32 | |||
| +--ro artist-count? uint32 | | +--ro artist-count? uint32 | |||
| +--ro album-count? uint32 | | +--ro album-count? uint32 | |||
| +--ro song-count? uint32 | | +--ro song-count? uint32 | |||
+--rw playlist [name] | +--rw playlist* [name] | |||
| +--rw name string | | +--rw name string | |||
| +--rw description? string | | +--rw description? string | |||
| +--rw song [index] | | +--rw song* [index] | |||
| +--rw index uint32 | | +--rw index uint32 | |||
| +--rw id instance-identifier | | +--rw id leafref | |||
+--rw player | +--rw player | |||
+--rw gap? decimal64 | +--rw gap? decimal64 | |||
rpcs: | rpcs: | |||
+---x play | +---x play | |||
+--ro input | +--ro input | |||
+--ro playlist string | +--ro playlist string | |||
+--ro song-number uint32 | +--ro song-number uint32 | |||
D.1. YANG Patch Examples | D.1. YANG Patch Examples | |||
This section includes RESTCONF examples. NETCONF examples are TBD. | This section includes RESTCONF examples. Most examples are shown in | |||
Most examples are shown in JSON encoding [RFC7158], and some are | JSON encoding [RFC7158], and some are shown in XML encoding | |||
shown in XML encoding [W3C.REC-xml-20081126]. | [W3C.REC-xml-20081126]. | |||
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. | were not attempted, since the first edit failed. | |||
Request from client: | Request from client: | |||
skipping to change at page 24, line 18 | skipping to change at page 24, line 18 | |||
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.patch-status+json | Accept: application/yang.patch-status+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", | "patch-id" : "add-songs-patch", | |||
"edit" : [ | "edit" : [ | |||
{ | { | |||
"edit-id" : 1, | "edit-id" : "edit1", | |||
"operation" : "create", | "operation" : "create", | |||
"target" : "/song", | "target" : "/song", | |||
"value" : { | "value" : { | |||
"song" : { | "song" : { | |||
"name" : "Bridge Burning", | "name" : "Bridge Burning", | |||
"location" : "/media/bridge_burning.mp3", | "location" : "/media/bridge_burning.mp3", | |||
"format" : "MP3", | "format" : "MP3", | |||
"length" : 288 | "length" : 288 | |||
} | } | |||
} | } | |||
}, | }, | |||
{ | { | |||
"edit-id" : 2, | "edit-id" : "edit2", | |||
"operation" : "create", | "operation" : "create", | |||
"target" : "/song", | "target" : "/song", | |||
"value" : { | "value" : { | |||
"song" : { | "song" : { | |||
"name" : "Rope", | "name" : "Rope", | |||
"location" : "/media/rope.mp3", | "location" : "/media/rope.mp3", | |||
"format" : "MP3", | "format" : "MP3", | |||
"length" : 259 | "length" : 259 | |||
} | } | |||
} | } | |||
}, | }, | |||
{ | { | |||
"edit-id" : 3, | "edit-id" : "edit3", | |||
"operation" : "create", | "operation" : "create", | |||
"target" : "/song", | "target" : "/song", | |||
"value" : { | "value" : { | |||
"song" : { | "song" : { | |||
"name" : "Dear Rosemary", | "name" : "Dear Rosemary", | |||
"location" : "/media/dear_rosemary.mp3", | "location" : "/media/dear_rosemary.mp3", | |||
"format" : "MP3", | "format" : "MP3", | |||
"length" : 269 | "length" : 269 | |||
} | } | |||
skipping to change at page 25, line 26 | skipping to change at page 25, line 26 | |||
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.patch-status+json | Content-Type: application/yang.patch-status+json | |||
{ | { | |||
"ietf-yang-patch:yang-patch-status" : { | "ietf-yang-patch:yang-patch-status" : { | |||
"patch-id" : "add-songs-patch", | "patch-id" : "add-songs-patch", | |||
"edit-status" : { | "edit-status" : { | |||
"edit" : [ | "edit" : [ | |||
{ | { | |||
"edit-id" : 1, | "edit-id" : "edit1", | |||
"errors" : { | "errors" : { | |||
"error" : [ | "error" : [ | |||
{ | { | |||
"error-type": "application", | "error-type": "application", | |||
"error-tag": "data-exists", | "error-tag": "data-exists", | |||
"error-path": "/example-jukebox:jukebox/library | "error-path": "/example-jukebox:jukebox/library | |||
/artist=Foo%20Fighters/album=Wasting%20Light | /artist=Foo%20Fighters/album=Wasting%20Light | |||
/song=Burning%20Light", | /song=Burning%20Light", | |||
"error-message": | "error-message": | |||
"Data already exists, cannot be created" | "Data already exists, cannot be created" | |||
skipping to change at page 26, line 21 | skipping to change at page 26, line 21 | |||
HTTP/1.1 | HTTP/1.1 | |||
Host: example.com | Host: example.com | |||
Accept: application/yang.patch-status+json | Accept: application/yang.patch-status+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" : [ | |||
{ | { | |||
"edit-id" : 1, | "edit-id" : "edit1", | |||
"operation" : "create", | "operation" : "create", | |||
"target" : "/song", | "target" : "/song", | |||
"value" : { | "value" : { | |||
"song" : { | "song" : { | |||
"name" : "Rope", | "name" : "Rope", | |||
"location" : "/media/rope.mp3", | "location" : "/media/rope.mp3", | |||
"format" : "MP3", | "format" : "MP3", | |||
"length" : 259 | "length" : 259 | |||
} | } | |||
} | } | |||
}, | }, | |||
{ | { | |||
"edit-id" : 2, | "edit-id" : "edit2", | |||
"operation" : "create", | "operation" : "create", | |||
"target" : "/song", | "target" : "/song", | |||
"value" : { | "value" : { | |||
"song" : { | "song" : { | |||
"name" : "Dear Rosemary", | "name" : "Dear Rosemary", | |||
"location" : "/media/dear_rosemary.mp3", | "location" : "/media/dear_rosemary.mp3", | |||
"format" : "MP3", | "format" : "MP3", | |||
"length" : 269 | "length" : 269 | |||
} | } | |||
} | } | |||
skipping to change at page 28, line 19 | skipping to change at page 28, line 19 | |||
Host: example.com | Host: example.com | |||
Accept: application/yang.patch-status+json | Accept: application/yang.patch-status+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" : [ | |||
{ | { | |||
"edit-id" : 1, | "edit-id" : "edit1", | |||
"operation" : "move", | "operation" : "move", | |||
"target" : "/song/1", | "target" : "/song/1", | |||
"point" : "/song3", | "point" : "/song3", | |||
"where" : "after" | "where" : "after" | |||
} | } | |||
] | ] | |||
} | } | |||
} | } | |||
Response from server: | Response from server: | |||
End of changes. 66 change blocks. | ||||
104 lines changed or deleted | 117 lines changed or added | |||
This html diff was produced by rfcdiff 1.42. The latest version is available from http://tools.ietf.org/tools/rfcdiff/ |