draft-ietf-netconf-yang-patch-02.txt | draft-ietf-netconf-yang-patch-03.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: July 6, 2015 Tail-f Systems | Expires: August 3, 2015 Tail-f Systems | |||
K. Watsen | K. Watsen | |||
Juniper Networks | Juniper Networks | |||
R. Fernando | January 30, 2015 | |||
Cisco | ||||
January 2, 2015 | ||||
YANG Patch Media Type | YANG Patch Media Type | |||
draft-ietf-netconf-yang-patch-02 | draft-ietf-netconf-yang-patch-03 | |||
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 36 | 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 July 6, 2015. | This Internet-Draft will expire on August 3, 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 14 | skipping to change at page 2, line 12 | |||
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 . . . . . . . . . . . . . . . . . . . . . . . . 4 | |||
1.1.3. YANG . . . . . . . . . . . . . . . . . . . . . . . . 4 | 1.1.3. YANG . . . . . . . . . . . . . . . . . . . . . . . . 4 | |||
1.1.4. Terms . . . . . . . . . . . . . . . . . . . . . . . . 5 | 1.1.4. RESTCONF . . . . . . . . . . . . . . . . . . . . . . 5 | |||
1.1.5. Tree Diagrams . . . . . . . . . . . . . . . . . . . . 5 | 1.1.5. Terms . . . . . . . . . . . . . . . . . . . . . . . . 5 | |||
2. YANG Patch . . . . . . . . . . . . . . . . . . . . . . . . . 5 | 1.1.6. Tree Diagrams . . . . . . . . . . . . . . . . . . . . 5 | |||
2. YANG Patch . . . . . . . . . . . . . . . . . . . . . . . . . 6 | ||||
2.1. Target Resource . . . . . . . . . . . . . . . . . . . . . 6 | 2.1. Target Resource . . . . . . . . . . . . . . . . . . . . . 6 | |||
2.2. yang-patch Input . . . . . . . . . . . . . . . . . . . . 6 | 2.2. yang-patch Input . . . . . . . . . . . . . . . . . . . . 6 | |||
2.3. yang-patch-status Output . . . . . . . . . . . . . . . . 6 | 2.3. yang-patch-status Output . . . . . . . . . . . . . . . . 7 | |||
2.4. Target Data Node . . . . . . . . . . . . . . . . . . . . 7 | 2.4. Target Data Node . . . . . . . . . . . . . . . . . . . . 7 | |||
2.5. Edit Operations . . . . . . . . . . . . . . . . . . . . . 7 | 2.5. Edit Operations . . . . . . . . . . . . . . . . . . . . . 8 | |||
2.6. Error Handling . . . . . . . . . . . . . . . . . . . . . 8 | 2.6. Error Handling . . . . . . . . . . . . . . . . . . . . . 8 | |||
3. YANG Module . . . . . . . . . . . . . . . . . . . . . . . . . 8 | 2.7. yang-patch RESTCONF Capability . . . . . . . . . . . . . 9 | |||
4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 17 | 3. YANG Module . . . . . . . . . . . . . . . . . . . . . . . . . 9 | |||
4.1. YANG Module Registry . . . . . . . . . . . . . . . . . . 17 | 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 18 | |||
4.2. application/yang.patch Media Types . . . . . . . . . . . 17 | 4.1. YANG Module Registry . . . . . . . . . . . . . . . . . . 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 | |||
5. Security Considerations . . . . . . . . . . . . . . . . . . . 18 | 4.4. RESTCONF Capability URNs . . . . . . . . . . . . . . . . 19 | |||
6. Normative References . . . . . . . . . . . . . . . . . . . . 18 | 5. Security Considerations . . . . . . . . . . . . . . . . . . . 19 | |||
Appendix A. Change Log . . . . . . . . . . . . . . . . . . . . . 19 | 6. Normative References . . . . . . . . . . . . . . . . . . . . 20 | |||
A.1. 01 to 02 . . . . . . . . . . . . . . . . . . . . . . . . 19 | Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 20 | |||
A.2. 00 to 01 . . . . . . . . . . . . . . . . . . . . . . . . 20 | Appendix B. Change Log . . . . . . . . . . . . . . . . . . . . . 20 | |||
A.3. bierman:yang-patch-00 to ietf:yang-patch-00 . . . . . . . 21 | B.1. 02 to 03 . . . . . . . . . . . . . . . . . . . . . . . . 21 | |||
Appendix B. Open Issues . . . . . . . . . . . . . . . . . . . . 21 | B.2. 01 to 02 . . . . . . . . . . . . . . . . . . . . . . . . 21 | |||
Appendix C. Example YANG Module . . . . . . . . . . . . . . . . 21 | B.3. 00 to 01 . . . . . . . . . . . . . . . . . . . . . . . . 21 | |||
C.1. YANG Patch Examples . . . . . . . . . . . . . . . . . . . 22 | B.4. bierman:yang-patch-00 to ietf:yang-patch-00 . . . . . . . 22 | |||
C.1.1. Add Resources: Error . . . . . . . . . . . . . . . . 22 | Appendix C. Open Issues . . . . . . . . . . . . . . . . . . . . 22 | |||
C.1.2. Add Resources: Success . . . . . . . . . . . . . . . 24 | Appendix D. Example YANG Module . . . . . . . . . . . . . . . . 22 | |||
C.1.3. Move list entry example . . . . . . . . . . . . . . . 25 | D.1. YANG Patch Examples . . . . . . . . . . . . . . . . . . . 23 | |||
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 26 | D.1.1. Add Resources: Error . . . . . . . . . . . . . . . . 23 | |||
D.1.2. Add Resources: Success . . . . . . . . . . . . . . . 25 | ||||
D.1.3. Move list entry example . . . . . . . . . . . . . . . 27 | ||||
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] or custom | |||
NETCONF operations (defined with the YANG rpc-stmt). | NETCONF operations (defined with the YANG rpc-stmt). | |||
YANG Patch is designed to support multiple protocols with the same | YANG Patch is designed to support multiple protocols with the same | |||
mechanisms. The RESTCONF [RESTCONF] protocol utilizes YANG Patch | mechanisms. The RESTCONF protocol defined in | |||
with the HTTP PATCH method. A new RPC operation can be defined to | [I-D.ietf-netconf-restconf] utilizes YANG Patch with the HTTP PATCH | |||
utilize YANG Patch in the NETCONF protocol. Both the RESTCONF and | method. A new RPC operation can be defined to utilize YANG Patch in | |||
NETCONF protocols are designed to utilize the YANG data modeling | the NETCONF protocol. Both the RESTCONF and NETCONF protocols are | |||
language to specify content schema modules. | 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 | |||
skipping to change at page 5, line 5 | skipping to change at page 5, line 5 | |||
o presence container (or P-container) | o presence container (or P-container) | |||
o RPC operation (now called protocol operation) | o RPC operation (now called protocol operation) | |||
o non-presence container (or NP-container) | o non-presence container (or NP-container) | |||
o ordered-by system | o ordered-by system | |||
o ordered-by user | o ordered-by user | |||
1.1.4. Terms | 1.1.4. RESTCONF | |||
The following terms are defined in [I-D.ietf-netconf-restconf]: | ||||
o data resource | ||||
o datasource resource | ||||
o patch | ||||
o RESTCONF capability | ||||
o target resource | ||||
1.1.5. Terms | ||||
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 | |||
HTTP, refers to a response message for a PATCH method, where the | HTTP, refers to a response message for a PATCH method, where the | |||
message body is identified by the media type "application/ | message body is identified by the media type "application/ | |||
yang.patch-status+xml" or "application/yang.patch-status+json". | yang.patch-status+xml" or "application/yang.patch-status+json". | |||
1.1.5. Tree Diagrams | 1.1.6. Tree Diagrams | |||
A simplified graphical representation of the data model is used in | A simplified graphical representation of the data model is used in | |||
this document. The meaning of the symbols in these diagrams is as | this document. The meaning of the symbols in these diagrams is as | |||
follows: | follows: | |||
o Brackets "[" and "]" enclose list keys. | o Brackets "[" and "]" enclose list keys. | |||
o Abbreviations before data node names: "rw" means configuration | o Abbreviations before data node names: "rw" means configuration | |||
(read-write) and "ro" state data (read-only). | (read-write) and "ro" state data (read-only). | |||
skipping to change at page 5, line 44 | skipping to change at page 6, line 9 | |||
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 with | |||
the 'yang-patch' container definition in the YANG module Section 3. | the 'application/yang.patch' extension definition in the YANG module | |||
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. Example: | for YANG Patch. | |||
Accept-Patch: application/yang.patch, application/yang.data | Example: | |||
For NETCONF, a YANG "rpc" statement needs to be defined. The | Accept-Patch: application/yang.patch | |||
"yang-patch" grouping MUST be included in the input parameters and | ||||
the "yang-patch-status" grouping MUST be included in the output | ||||
parameters. | ||||
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. | |||
skipping to change at page 6, line 52 | skipping to change at page 7, line 20 | |||
+--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. | Patch Status media type, and the syntax specification is defined by | |||
the 'application/yang.patch-status' extension statement defined in | ||||
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 | |||
| | | | | | |||
| +--:(ok) | | +--:(ok) | |||
skipping to change at page 8, line 25 | skipping to change at page 8, line 38 | |||
| 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 or no | | | remove | remove a data resource if it already exists or no | | |||
| | error | | | | error | | |||
+-----------+-------------------------------------------------------+ | +-----------+-------------------------------------------------------+ | |||
YANG Patch Edit Operations | YANG Patch Edit Operations | |||
2.6. Error Handling | 2.6. 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 | |||
then the server will process the supplied edits in ascending order. | the server will process the supplied edits in ascending order. The | |||
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 SHOULD be returned to its original state before the PATCH | |||
method started. The server MAY fail to restore the contents of the | method started. The server MAY fail to restore the contents of the | |||
target datastore completely and with certainty. It is possible for a | target datastore completely and with certainty. It is possible for a | |||
rollback to fail or an "undo" operation to fail. | 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 attempted. | |||
3. YANG Module | 2.7. yang-patch RESTCONF Capability | |||
The "ietf-yang-patch" module defines conceptual definitions within | A URI is defined to identify the YANG Patch extension to the base | |||
groupings, which are not meant to be implemented as datastore | RESTCONF protocol. If the server supports the YANG Patch media type, | |||
contents by a server. | then the "yang-patch" RESTCONF capability defined in Section 4.4 MUST | |||
be present in the "capability" leaf-list in the | ||||
"ietf-restconf-monitoring" module defined in | ||||
[I-D.ietf-netconf-restconf]. | ||||
The "ietf-yang-types" and "ietf-inet_types" modules from [RFC6991] | 3. YANG Module | |||
are used by this module for some type definitions. | ||||
The "ietf-restconf" module from [RESTCONF] is used by this module for | The "ietf-yang-patch" module defines conceptual definitions with the | |||
a grouping definition. | 'restconf-media-type' extension statements, which are not meant to be | |||
implemented as datastore contents by a server. | ||||
The "ietf-restconf" module from [I-D.ietf-netconf-restconf] is used | ||||
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-02.yang" | <CODE BEGINS> file "ietf-yang-patch@2015-01-24.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-restconf { prefix rc; } | import ietf-restconf { | |||
prefix rc; | ||||
revision-date 2015-01-30; | ||||
} | ||||
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: Bert Wijnen | ||||
<mailto:bertietf@bwijnen.net> | ||||
WG Chair: Mehmet Ersue | WG Chair: Mehmet Ersue | |||
<mailto:mehmet.ersue@nsn.com> | <mailto:mehmet.ersue@nsn.com> | |||
WG Chair: Mahesh Jethanandani | ||||
<mailto:mjethanandani@gmail.com> | ||||
Editor: Andy Bierman | Editor: Andy Bierman | |||
<mailto:andy@yumaworks.com> | <mailto:andy@yumaworks.com> | |||
Editor: Martin Bjorklund | Editor: Martin Bjorklund | |||
<mailto:mbj@tail-f.com> | <mailto:mbj@tail-f.com> | |||
Editor: Kent Watsen | Editor: Kent Watsen | |||
<mailto:kwatsen@juniper.net> | <mailto:kwatsen@juniper.net>"; | |||
Editor: Rex Fernando | ||||
<mailto:rex@cisco.com>"; | ||||
description | description | |||
"This module contains conceptual YANG specifications | "This module contains conceptual YANG specifications | |||
for the YANG Patch and YANG Patch Status data structures. | for the YANG Patch and YANG Patch Status data structures. | |||
Note that the YANG definitions within this module do not | Note that the YANG definitions within this module do not | |||
represent configuration data of any kind. | represent configuration data of any kind. | |||
The YANG grouping statements provide a normative syntax | The YANG grouping statements provide a normative syntax | |||
for XML and JSON message encoding purposes. | for XML and JSON message encoding purposes. | |||
Copyright (c) 2014 IETF Trust and the persons identified as | Copyright (c) 2015 IETF Trust and the persons identified as | |||
authors of the code. All rights reserved. | authors of the code. All rights reserved. | |||
Redistribution and use in source and binary forms, with or | Redistribution and use in source and binary forms, with or | |||
without modification, is permitted pursuant to, and subject | without modification, is permitted pursuant to, and subject | |||
to the license terms contained in, the Simplified BSD License | to the license terms contained in, the Simplified BSD License | |||
set forth in Section 4.c of the IETF Trust's Legal Provisions | set forth in Section 4.c of the IETF Trust's Legal Provisions | |||
Relating to IETF Documents | Relating to IETF Documents | |||
(http://trustee.ietf.org/license-info). | (http://trustee.ietf.org/license-info). | |||
This version of this YANG module is part of RFC XXXX; see | This version of this YANG module is part of RFC XXXX; see | |||
the RFC itself for full legal notices."; | the RFC itself for full legal notices."; | |||
// RFC Ed.: replace XXXX with actual RFC number and remove this | // RFC Ed.: replace XXXX with actual RFC number and remove this | |||
// note. | // note. | |||
// RFC Ed.: remove this note | // RFC Ed.: remove this note | |||
// Note: extracted from draft-ietf-netconf-yang-patch-02.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-02 { | revision 2015-01-30 { | |||
description | description | |||
"Initial revision."; | "Initial revision."; | |||
reference | reference | |||
"RFC XXXX: YANG Patch"; | "RFC XXXX: YANG Patch Media Type."; | |||
} | } | |||
typedef target-resource-offset { | typedef target-resource-offset { | |||
type string { | type string { | |||
length "1 .. max"; | length "1 .. max"; | |||
} | } | |||
description | description | |||
"Contains a relative Data Resource Identifier formatted string | "Contains a relative Data Resource Identifier formatted string | |||
to identify a specific data sub-resource instance. | to identify a specific data sub-resource instance. | |||
The document root for all data resources is a | The document root for all data resources is a | |||
target data resource that is specified in the | target data resource that is specified in the | |||
object definition using this data type."; | object definition using this data type."; | |||
} | } | |||
rc:restconf-media-type "application/yang.patch" { | ||||
uses yang-patch; | ||||
} | ||||
rc:restconf-media-type "application/yang.patch-status" { | ||||
uses yang-patch-status; | ||||
} | ||||
grouping yang-patch { | grouping yang-patch { | |||
description | description | |||
"A grouping that contains a YANG container | "A grouping that contains a YANG container | |||
representing the syntax and semantics of a | representing the syntax and semantics of a | |||
YANG Patch edit request message."; | YANG Patch edit request message."; | |||
container yang-patch { | container yang-patch { | |||
description | description | |||
"Represents a conceptual sequence of datastore edits, | "Represents a conceptual sequence of datastore edits, | |||
skipping to change at page 18, line 44 | skipping to change at page 19, line 22 | |||
Encoding considerations: TBD | Encoding considerations: TBD | |||
Security considerations: TBD | Security considerations: TBD | |||
Interoperability considerations: TBD | Interoperability considerations: TBD | |||
// 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 | ||||
This document registers several capability identifiers in "RESTCONF | ||||
Protocol Capability URNs" registry | ||||
Index | ||||
Capability Identifier | ||||
------------------------ | ||||
:yang-patch | ||||
urn:ietf:params:restconf:capability:yang-patch:1.0 | ||||
5. Security Considerations | 5. Security Considerations | |||
TBD | The YANG Patch media type does not introduce any significant new | |||
security threats, beyond what is described in | ||||
[I-D.ietf-netconf-restconf]. This document defines edit processing | ||||
instructions for a variant of the PATCH method, as used within the | ||||
RESTCONF protocol. | ||||
It is important for server implementations to carefully validate all | ||||
the edit request parameters in some manner. If the entire YANG Patch | ||||
request cannot be completed, then no configuration changes to the | ||||
system are done. | ||||
A server implementation SHOULD attempt to prevent system disruption | ||||
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 | ||||
edit processing order mandated by YANG Patch. | ||||
6. Normative References | 6. Normative References | |||
[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-03 (work in | Protocol", draft-ietf-netconf-restconf-04 (work in | |||
progress), October 2014. | progress), January 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 19, line 31 | skipping to change at page 20, line 33 | |||
5789, March 2010. | 5789, March 2010. | |||
[RFC6020] Bjorklund, M., "YANG - A Data Modeling Language for the | [RFC6020] Bjorklund, M., "YANG - A Data Modeling Language for the | |||
Network Configuration Protocol (NETCONF)", RFC 6020, | Network Configuration Protocol (NETCONF)", RFC 6020, | |||
October 2010. | October 2010. | |||
[RFC6241] Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed., | [RFC6241] Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed., | |||
and A. Bierman, Ed., "Network Configuration Protocol | and A. Bierman, Ed., "Network Configuration Protocol | |||
(NETCONF)", RFC 6241, June 2011. | (NETCONF)", RFC 6241, June 2011. | |||
[RFC6991] Schoenwaelder, J., "Common YANG Data Types", RFC 6991, | ||||
July 2013. | ||||
[RFC7158] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data | [RFC7158] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data | |||
Interchange Format", RFC 7158, March 2013. | Interchange Format", RFC 7158, March 2013. | |||
[W3C.REC-xml-20081126] | [W3C.REC-xml-20081126] | |||
Yergeau, F., Maler, E., Paoli, J., Sperberg-McQueen, C., | Yergeau, F., Maler, E., Paoli, J., Sperberg-McQueen, C., | |||
and T. Bray, "Extensible Markup Language (XML) 1.0 (Fifth | and T. Bray, "Extensible Markup Language (XML) 1.0 (Fifth | |||
Edition)", World Wide Web Consortium Recommendation REC- | Edition)", World Wide Web Consortium Recommendation REC- | |||
xml-20081126, November 2008, | xml-20081126, November 2008, | |||
<http://www.w3.org/TR/2008/REC-xml-20081126>. | <http://www.w3.org/TR/2008/REC-xml-20081126>. | |||
Appendix A. Change Log | Appendix A. Acknowledgements | |||
The authors would like to thank the following people for their | ||||
contributions to this document: Rex Fernando. | ||||
Appendix B. Change Log | ||||
-- RFC Ed.: remove this section before publication. | -- RFC Ed.: remove this section before publication. | |||
A.1. 01 to 02 | B.1. 02 to 03 | |||
o added usage of restconf-media-type extension to map the yang-patch | ||||
and yang-patch-status groupings to media types | ||||
o added yang-patch RESTCONF capability URI | ||||
o Added sub-section for terms used from RESTCONF | ||||
o filled in security considerations section | ||||
B.2. 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 | |||
A.2. 00 to 01 | B.3. 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 21, line 5 | 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. | |||
A.3. bierman:yang-patch-00 to ietf:yang-patch-00 | B.4. bierman:yang-patch-00 to ietf:yang-patch-00 | |||
o Created open issues section | o Created open issues section | |||
Appendix B. 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 C. 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 [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 | |||
skipping to change at page 22, line 12 | skipping to change at page 23, line 40 | |||
+--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 | |||
C.1. YANG Patch Examples | D.1. YANG Patch Examples | |||
This section includes RESTCONF examples. NETCONF examples are TBD. | This section includes RESTCONF examples. NETCONF examples are TBD. | |||
Most examples are shown in JSON encoding [RFC7158], and some are | Most examples are shown in JSON encoding [RFC7158], and some are | |||
shown in XML encoding [W3C.REC-xml-20081126]. | shown in XML encoding [W3C.REC-xml-20081126]. | |||
C.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: | |||
PATCH /restconf/data/example-jukebox:jukebox/ | PATCH /restconf/data/example-jukebox:jukebox/ | |||
library/artist=Foo%20Fighters/album=Wasting%20Light HTTP/1.1 | library/artist=Foo%20Fighters/album=Wasting%20Light HTTP/1.1 | |||
skipping to change at page 24, line 17 | skipping to change at page 25, line 46 | |||
"Data already exists, cannot be created" | "Data already exists, cannot be created" | |||
} | } | |||
] | ] | |||
} | } | |||
} | } | |||
] | ] | |||
} | } | |||
} | } | |||
} | } | |||
C.1.2. Add Resources: Success | D.1.2. Add Resources: Success | |||
The following example shows several songs being added to an existing | The following example shows several songs being added to an existing | |||
album. | album. | |||
o Each of 2 edits contains one song. | o Each of 2 edits contains one song. | |||
o Both edits succeed and new sub-resources are created | o Both edits succeed and new sub-resources are created | |||
Request from client: | Request from client: | |||
skipping to change at page 25, line 36 | skipping to change at page 27, line 16 | |||
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-2", | "patch-id" : "add-songs-patch-2", | |||
"ok" : [null] | "ok" : [null] | |||
} | } | |||
} | } | |||
C.1.3. Move list entry example | D.1.3. Move list entry example | |||
The following example shows a song being moved within an existing | The following example shows a song being moved within an existing | |||
playlist. Song "1" in playlist "Foo-One" is being moved after song | playlist. Song "1" in playlist "Foo-One" is being moved after song | |||
"3" in the playlist. The operation succeeds, so a non-error reply | "3" in the playlist. The operation succeeds, so a non-error reply | |||
example can be shown. | example can be shown. | |||
Request from client: | Request from client: | |||
PATCH /restconf/data/example-jukebox:jukebox/ | PATCH /restconf/data/example-jukebox:jukebox/ | |||
playlist=Foo-One HTTP/1.1 | playlist=Foo-One HTTP/1.1 | |||
skipping to change at page 27, line 13 | skipping to change at line 1287 | |||
Email: andy@yumaworks.com | Email: andy@yumaworks.com | |||
Martin Bjorklund | Martin Bjorklund | |||
Tail-f Systems | Tail-f Systems | |||
Email: mbj@tail-f.com | Email: mbj@tail-f.com | |||
Kent Watsen | Kent Watsen | |||
Juniper Networks | Juniper Networks | |||
Email: kwatsen@juniper.net | Email: kwatsen@juniper.net | |||
Rex Fernando | ||||
Cisco | ||||
Email: rex@cisco.com | ||||
End of changes. 50 change blocks. | ||||
84 lines changed or deleted | 157 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/ |