draft-ietf-netconf-yang-patch-09.txt   draft-ietf-netconf-yang-patch-10.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: December 30, 2016 Tail-f Systems Expires: January 8, 2017 Tail-f Systems
K. Watsen K. Watsen
Juniper Networks Juniper Networks
June 28, 2016 July 7, 2016
YANG Patch Media Type YANG Patch Media Type
draft-ietf-netconf-yang-patch-09 draft-ietf-netconf-yang-patch-10
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 December 30, 2016. This Internet-Draft will expire on January 8, 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 38 skipping to change at page 2, line 38
2.3. yang-patch-status Output . . . . . . . . . . . . . . . . 7 2.3. yang-patch-status Output . . . . . . . . . . . . . . . . 7
2.4. Target Data Node . . . . . . . . . . . . . . . . . . . . 8 2.4. Target Data Node . . . . . . . . . . . . . . . . . . . . 8
2.5. Edit Operations . . . . . . . . . . . . . . . . . . . . . 8 2.5. Edit Operations . . . . . . . . . . . . . . . . . . . . . 8
2.6. Successful Edit Response Handling . . . . . . . . . . . . 9 2.6. Successful Edit Response Handling . . . . . . . . . . . . 9
2.7. Error Handling . . . . . . . . . . . . . . . . . . . . . 9 2.7. Error Handling . . . . . . . . . . . . . . . . . . . . . 9
2.8. yang-patch RESTCONF Capability . . . . . . . . . . . . . 9 2.8. yang-patch RESTCONF Capability . . . . . . . . . . . . . 9
3. YANG Module . . . . . . . . . . . . . . . . . . . . . . . . . 9 3. YANG Module . . . . . . . . . . . . . . . . . . . . . . . . . 9
4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 18 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 18
4.1. YANG Module Registry . . . . . . . . . . . . . . . . . . 18 4.1. YANG Module Registry . . . . . . . . . . . . . . . . . . 18
4.2. Media Types . . . . . . . . . . . . . . . . . . . . . . . 19 4.2. Media Types . . . . . . . . . . . . . . . . . . . . . . . 19
4.2.1. Media Type application/yang-patch+xml . . . . . . . . 19 4.2.1. Media Type application/yang-patch . . . . . . . . . . 19
4.2.2. Media Type application/yang-patch+json . . . . . . . 20 4.2.2. Media Type application/yang-patch+json . . . . . . . 20
4.3. RESTCONF Capability URNs . . . . . . . . . . . . . . . . 22 4.3. RESTCONF Capability URNs . . . . . . . . . . . . . . . . 22
5. Security Considerations . . . . . . . . . . . . . . . . . . . 22 5. Security Considerations . . . . . . . . . . . . . . . . . . . 23
6. Normative References . . . . . . . . . . . . . . . . . . . . 23 6. Normative References . . . . . . . . . . . . . . . . . . . . 23
Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 24 Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 24
Appendix B. Change Log . . . . . . . . . . . . . . . . . . . . . 24 Appendix B. Change Log . . . . . . . . . . . . . . . . . . . . . 25
B.1. v08 to v09 . . . . . . . . . . . . . . . . . . . . . . . 25 B.1. v09 to v10 . . . . . . . . . . . . . . . . . . . . . . . 25
B.2. v07 to v08 . . . . . . . . . . . . . . . . . . . . . . . 25 B.2. v08 to v09 . . . . . . . . . . . . . . . . . . . . . . . 25
B.3. v06 to v07 . . . . . . . . . . . . . . . . . . . . . . . 25 B.3. v07 to v08 . . . . . . . . . . . . . . . . . . . . . . . 25
B.4. v05 to v06 . . . . . . . . . . . . . . . . . . . . . . . 26 B.4. v06 to v07 . . . . . . . . . . . . . . . . . . . . . . . 26
B.5. v04 to v05 . . . . . . . . . . . . . . . . . . . . . . . 26 B.5. v05 to v06 . . . . . . . . . . . . . . . . . . . . . . . 26
B.6. v03 to v04 . . . . . . . . . . . . . . . . . . . . . . . 26 B.6. v04 to v05 . . . . . . . . . . . . . . . . . . . . . . . 26
B.7. v02 to v03 . . . . . . . . . . . . . . . . . . . . . . . 26 B.7. v03 to v04 . . . . . . . . . . . . . . . . . . . . . . . 26
B.8. v01 to v02 . . . . . . . . . . . . . . . . . . . . . . . 26 B.8. v02 to v03 . . . . . . . . . . . . . . . . . . . . . . . 27
B.9. v00 to v01 . . . . . . . . . . . . . . . . . . . . . . . 27 B.9. v01 to v02 . . . . . . . . . . . . . . . . . . . . . . . 27
B.10. bierman:yang-patch-00 to ietf:yang-patch-00 . . . . . . . 28 B.10. v00 to v01 . . . . . . . . . . . . . . . . . . . . . . . 27
B.11. bierman:yang-patch-00 to ietf:yang-patch-00 . . . . . . . 28
Appendix C. Open Issues . . . . . . . . . . . . . . . . . . . . 28 Appendix C. Open Issues . . . . . . . . . . . . . . . . . . . . 28
Appendix D. Example YANG Module . . . . . . . . . . . . . . . . 28 Appendix D. Example YANG Module . . . . . . . . . . . . . . . . 28
D.1. YANG Patch Examples . . . . . . . . . . . . . . . . . . . 29 D.1. YANG Patch Examples . . . . . . . . . . . . . . . . . . . 29
D.1.1. Add Resources: Error . . . . . . . . . . . . . . . . 29 D.1.1. Add Resources: Error . . . . . . . . . . . . . . . . 29
D.1.2. Add Resources: Success . . . . . . . . . . . . . . . 32 D.1.2. Add Resources: Success . . . . . . . . . . . . . . . 32
D.1.3. Move list entry example . . . . . . . . . . . . . . . 33 D.1.3. Move list entry example . . . . . . . . . . . . . . . 33
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 34 D.1.4. Edit datastore resource example . . . . . . . . . . . 34
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 36
1. Introduction 1. Introduction
There is a need for standard mechanisms to patch datastores defined There is a need for standard mechanisms to patch datastores defined
in [RFC6241], which contain conceptual data that conforms to schema in [RFC6241], which contain conceptual data that conforms to schema
specified with YANG [I-D.ietf-netmod-rfc6020bis]. An "ordered edit specified with YANG [I-D.ietf-netmod-rfc6020bis]. An "ordered edit
list" approach is needed to provide client developers with more list" approach is needed to provide client developers with more
precise client control of the edit procedure than existing precise client control of the edit procedure than existing
mechanisms. mechanisms.
skipping to change at page 4, line 49 skipping to change at page 5, line 4
o leaf-list o leaf-list
o list o list
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. RESTCONF 1.1.4. RESTCONF
The following terms are defined in [I-D.ietf-netconf-restconf]: The following terms are defined in [I-D.ietf-netconf-restconf]:
o application/yang-data+xml o application/yang-data
o application/yang-data+json o application/yang-data+json
o data resource o data resource
o datastore resource o datastore resource
o patch o patch
o RESTCONF capability o RESTCONF capability
skipping to change at page 5, line 33 skipping to change at page 5, line 35
o YANG data template o YANG data template
1.1.5. YANG Patch 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
data template, defined in Section 3. In HTTP, refers to a PATCH data template, defined in Section 3. In HTTP, refers to a PATCH
method where a representation uses either the media type method where a representation uses either the media type
"application/yang-patch+xml" or "application/yang-patch+json". "application/yang-patch" or "application/yang-patch+json".
o YANG Patch Status: a conceptual edit status response using the o YANG Patch Status: a conceptual edit status response using the
YANG "yang-patch-status" YANG data template, defined in Section 3. YANG "yang-patch-status" YANG data template, defined in Section 3.
In HTTP, refers to a response message for a PATCH method, where it In HTTP, refers to a response message for a PATCH method, where it
has a representation with either the media type "application/ has a representation with either the media type "application/
yang-data+xml" or "application/yang-data+json". yang-data" or "application/yang-data+json".
1.1.6. 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
skipping to change at page 6, line 22 skipping to change at page 6, line 25
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 in target datastore by the server. The specific fields are defined in
the YANG module in Section 3. the YANG module in 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 a representation using either the sending a PATCH method request with a representation using either the
"application/yang-patch+xml" or "application/yang-patch+json" media "application/yang-patch" or "application/yang-patch+json" media type.
type. A message body representing the YANG Patch input parameters A message body representing the YANG Patch input parameters MUST be
MUST be provided. provided.
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.
Example: Example:
Accept-Patch: application/yang-patch+xml,application/yang-patch+json Accept-Patch: application/yang-patch,application/yang-patch+json
A YANG Patch can be encoded in XML format according to A YANG Patch can be encoded in XML format according to
[W3C.REC-xml-20081126]. It can also be encoded in JSON, according to [W3C.REC-xml-20081126]. It can also be encoded in JSON, according to
"JSON Encoding of Data Modeled with YANG" "JSON Encoding of Data Modeled with YANG"
[I-D.ietf-netmod-yang-json]. If any meta-data needs to be sent in a [I-D.ietf-netmod-yang-json]. If any meta-data needs to be sent in a
JSON message, it is encoded according to "Defining and Using Metadata JSON message, it is encoded according to "Defining and Using Metadata
with YANG" [I-D.ietf-netmod-yang-metadata]. with YANG" [I-D.ietf-netmod-yang-metadata].
2.1. Target Resource 2.1. Target Resource
skipping to change at page 10, line 11 skipping to change at page 10, line 14
The "ietf-yang-patch" module defines conceptual definitions with the The "ietf-yang-patch" module defines conceptual definitions with the
'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 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 '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-06-28.yang" <CODE BEGINS> file "ietf-yang-patch@2016-07-07.yang"
module ietf-yang-patch { module ietf-yang-patch {
yang-version 1.1; yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-yang-patch"; namespace "urn:ietf:params:xml:ns:yang:ietf-yang-patch";
prefix "ypatch"; prefix "ypatch";
import ietf-yang-types { prefix yang; }
import ietf-restconf { prefix rc; } import ietf-restconf { prefix rc; }
organization organization
"IETF NETCONF (Network Configuration) Working Group"; "IETF NETCONF (Network Configuration) Working Group";
contact contact
"WG Web: <http://tools.ietf.org/wg/netconf/> "WG Web: <http://tools.ietf.org/wg/netconf/>
WG List: <mailto:netconf@ietf.org> WG List: <mailto:netconf@ietf.org>
WG Chair: Mehmet Ersue
<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>";
description description
skipping to change at page 11, line 22 skipping to change at page 11, line 17
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-09.txt // Note: extracted from draft-ietf-netconf-yang-patch-10.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-06-28 { revision 2016-07-07 {
description description
"Initial revision."; "Initial revision.";
reference reference
"RFC XXXX: YANG Patch Media Type."; "RFC XXXX: YANG Patch Media Type.";
} }
typedef target-resource-offset { typedef target-resource-offset {
type yang:xpath1.0; type string;
description description
"Contains an XPath absolute path expression identifying "Contains a data resource identifier string representing
a sub-resource within the target resource. a sub-resource within the target resource.
The document root for this XPath expression is the The document root for this expression is the
target resource that is specified in the target resource that is specified in the
protocol operation (e.g., the URI for the PATCH request)."; protocol operation (e.g., the URI for the PATCH request).
This string is encoded according the same rules as
a data resource identifier in a RESTCONF Request URI.";
// RFC Ed.: replace "draft-ietf-netconf-restconf" below
// with RFC XXXX, where XXXX is the number of the RESTCONF RFC,
// and remove this note.
reference
"draft-ietf-netconf-restconf, section 3.5.3";
} }
rc:yang-data "yang-patch" { rc:yang-data "yang-patch" {
uses yang-patch; uses yang-patch;
} }
rc:yang-data "yang-patch-status" { rc:yang-data "yang-patch-status" {
uses yang-patch-status; uses yang-patch-status;
} }
grouping yang-patch { grouping yang-patch {
description description
"A grouping that contains a YANG container "A grouping that contains a YANG container
representing the syntax and semantics of a representing the syntax and semantics of a
YANG Patch edit request message."; YANG Patch edit request message.";
container yang-patch { container yang-patch {
description description
"Represents a conceptual sequence of datastore edits, "Represents a conceptual sequence of datastore edits,
called a patch. Each patch is given a client-assigned called a patch. Each patch is given a client-assigned
patch identifier. Each edit MUST be applied patch identifier. Each edit MUST be applied
skipping to change at page 19, line 9 skipping to change at page 19, line 16
registry [RFC6020]. registry [RFC6020].
name: ietf-yang-patch name: ietf-yang-patch
namespace: urn:ietf:params:xml:ns:yang:ietf-yang-patch namespace: urn:ietf:params:xml:ns:yang:ietf-yang-patch
prefix: ypatch prefix: ypatch
// RFC Ed.: replace XXXX with RFC number and remove this note // RFC Ed.: replace XXXX with RFC number and remove this note
reference: RFC XXXX reference: RFC XXXX
4.2. Media Types 4.2. Media Types
4.2.1. Media Type application/yang-patch+xml 4.2.1. Media Type application/yang-patch
Type name: application Type name: application
Subtype name: yang-patch+xml Subtype name: yang-patch
Required parameters: none Required parameters: None
Optional parameters: none Optional parameters: None
// RFC Ed.: replace draft-ietf-netmod-rfc6020bis with // RFC Ed.: replace draft-ietf-netmod-rfc6020bis with
// the actual RFC reference for YANG 1.1, and remove this note. // the actual RFC reference for YANG 1.1, and remove this note.
// RFC Ed.: replace 'XXXX' with the real RFC number, // RFC Ed.: replace 'XXXX' with the real RFC number,
// and remove this note // and remove this note
Encoding considerations: 8-bit Encoding considerations: 8-bit
Each conceptual YANG data node is encoded according to Each conceptual YANG data node is encoded according to the
XML Encoding Rules and Canonical Format for the specific XML Encoding Rules and Canonical Format for the specific
YANG data node type defined in [draft-ietf-netmod-rfc6020bis]. YANG data node type defined in [draft-ietf-netmod-rfc6020bis].
In addition, the "yang-patch" YANG data template found In addition, the "yang-patch" YANG data template found
in [RFCXXXX] defines the structure of a YANG Patch request. in [RFCXXXX] defines the structure of a YANG Patch request.
// RFC Ed.: replace 'NN' in Section NN of [RFCXXXX] with the // RFC Ed.: replace 'NN' in Section NN of [RFCXXXX] with the
// section number for Security Considerations // section number for Security Considerations
// Replace 'XXXX' in Section NN of [RFCXXXX] with the actual // Replace 'XXXX' in Section NN of [RFCXXXX] with the actual
// RFC number, and remove this note. // RFC number, and remove this note.
skipping to change at page 19, line 48 skipping to change at page 20, line 6
to the generation and consumption of RESTCONF messages to the generation and consumption of RESTCONF messages
are discussed in Section NN of [RFCXXXX]. are discussed in Section NN of [RFCXXXX].
Additional security considerations are specific to the Additional security considerations are specific to the
semantics of particular YANG data models. Each YANG module semantics of particular YANG data models. Each YANG module
is expected to specify security considerations for the is expected to specify security considerations for the
YANG data defined in that module. YANG data defined in that module.
// RFC Ed.: replace XXXX with actual RFC number and remove this // RFC Ed.: replace XXXX with actual RFC number and remove this
// note. // note.
Interoperability considerations: [RFCXXXX] specifies format of Interoperability considerations: [RFCXXXX] specifies the format
conforming messages and the interpretation thereof. of conforming messages and the interpretation thereof.
// 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 utilizes the YANG Patch data structure. that utilize the YANG Patch data structure.
Fragment identifier considerations: The fragment field in the Fragment identifier considerations: The fragment field in the
request URI has no defined purpose. request URI has no defined purpose.
Additional information: Additional information:
Deprecated alias names for this type: n/a Deprecated alias names for this type: N/A
Magic number(s): n/a Magic number(s): N/A
File extension(s): .xml File extension(s): .xml
Macintosh file type code(s): "TEXT" Macintosh file type code(s): "TEXT"
// RFC Ed.: replace XXXX with actual RFC number and remove this // RFC Ed.: replace XXXX with actual RFC number and remove this
// note. // note.
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
(One of COMMON, LIMITED USE, or OBSOLETE.) Restrictions on usage: N/A
Restrictions on usage: n/a
// RFC Ed.: replace XXXX with actual RFC number and remove this // RFC Ed.: replace XXXX with actual RFC number and remove this
// note. // note.
Author: See Authors' Addresses section of [RFCXXXX]. Author: See Authors' Addresses section of [RFCXXXX].
Change controller: Internet Engineering Task Force Change controller: Internet Engineering Task Force
(mailto:iesg&ietf.org). (mailto:iesg&ietf.org).
Provisional registration? (standards tree only): no Provisional registration? (standards tree only): no
skipping to change at page 20, line 47 skipping to change at page 21, line 4
Author: See Authors' Addresses section of [RFCXXXX]. Author: See Authors' Addresses section of [RFCXXXX].
Change controller: Internet Engineering Task Force Change controller: Internet Engineering Task Force
(mailto:iesg&ietf.org). (mailto:iesg&ietf.org).
Provisional registration? (standards tree only): no Provisional registration? (standards tree only): no
4.2.2. Media Type application/yang-patch+json 4.2.2. Media Type application/yang-patch+json
Type name: application Type name: application
Subtype name: yang-patch+json Subtype name: yang-patch+json
Required parameters: none Required parameters: None
Optional parameters: none
Optional parameters: None
// RFC Ed.: replace draft-ietf-netmod-yang-json with // RFC Ed.: replace draft-ietf-netmod-yang-json with
// the actual RFC reference for JSON Encoding of YANG Data, // the actual RFC reference for JSON Encoding of YANG Data,
// and remove this note. // and remove this note.
// RFC Ed.: replace draft-ietf-netmod-yang-metadata with // RFC Ed.: replace draft-ietf-netmod-yang-metadata with
// the actual RFC reference for JSON Encoding of YANG Data, // the actual RFC reference for JSON Encoding of YANG Data,
// and remove this note. // and remove this note.
// RFC Ed.: replace 'XXXX' with the real RFC number, // RFC Ed.: replace 'XXXX' with the real RFC number,
skipping to change at page 21, line 40 skipping to change at page 21, line 44
to the generation and consumption of RESTCONF messages to the generation and consumption of RESTCONF messages
are discussed in Section NN of [RFCXXXX]. are discussed in Section NN of [RFCXXXX].
Additional security considerations are specific to the Additional security considerations are specific to the
semantics of particular YANG data models. Each YANG module semantics of particular YANG data models. Each YANG module
is expected to specify security considerations for the is expected to specify security considerations for the
YANG data defined in that module. YANG data defined in that module.
// RFC Ed.: replace XXXX with actual RFC number and remove this // RFC Ed.: replace XXXX with actual RFC number and remove this
// note. // note.
Interoperability considerations: [RFCXXXX] specifies format of Interoperability considerations: [RFCXXXX] specifies the format
conforming messages and the interpretation thereof. of conforming messages and the interpretation thereof.
// 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 utilizes the YANG Patch data structure. that utilize the YANG Patch data structure.
Fragment identifier considerations: The fragment field in the Fragment identifier considerations: The syntax and semantics
request URI has no defined purpose. of fragment identifiers are the same as specified for the
"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): .json
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
(One of COMMON, LIMITED USE, or OBSOLETE.) Restrictions on usage: N/A
Restrictions on usage: n/a
// RFC Ed.: replace XXXX with actual RFC number and remove this // RFC Ed.: replace XXXX with actual RFC number and remove this
// note. // note.
Author: See Authors' Addresses section of [RFCXXXX]. Author: See Authors' Addresses section of [RFCXXXX].
Change controller: Internet Engineering Task Force Change controller: Internet Engineering Task Force
(mailto:iesg&ietf.org). (mailto:iesg&ietf.org).
Provisional registration? (standards tree only): no Provisional registration? (standards tree only): no
skipping to change at page 25, line 5 skipping to change at page 25, line 12
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. v08 to v09 B.1. v09 to v10
o change yang-patch+xml to yang-patch
o clarify application/yang-patch+json media type
o add edit datastore example
o change data-resource-offset typedef so it is consistent for XML
and JSON
B.2. 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.2. v07 to v08 B.3. 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.3. v06 to v07 B.4. 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.4. v05 to v06 B.5. 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.5. v04 to v05 B.6. v04 to v05
o updated reference to RESTCONF o updated reference to RESTCONF
B.6. v03 to v04 B.7. 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.7. v02 to v03 B.8. 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.8. v01 to v02 B.9. 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.9. v00 to v01 B.10. v00 to v01
o Added text requiring support for Accept-Patch header field, and o Added text requiring support for Accept-Patch header field, and
removed 'Identification of YANG Patch capabilities' open issue. removed 'Identification of YANG Patch capabilities' open issue.
o Removed 'location' leaf from yang-patch-status grouping o Removed 'location' leaf from yang-patch-status grouping
o Removed open issue 'Protocol independence' because the location o Removed open issue 'Protocol independence' because the location
leaf was removed. leaf was removed.
o Removed open issue 'RESTCONF coupling' because there is no concern o Removed open issue 'RESTCONF coupling' because there is no concern
skipping to change at page 28, line 5 skipping to change at page 28, 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.10. bierman:yang-patch-00 to ietf:yang-patch-00 B.11. 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
skipping to change at page 29, line 31 skipping to change at page 29, line 43
album. Each edit contains one song. The first song already exists, album. Each edit contains one song. The first song already exists,
so an error will be reported for that edit. The rest of the edits so an error will be reported for that edit. The rest of the edits
were not attempted, since the first edit failed. The XML encoding is were not attempted, since the first edit failed. The XML encoding is
used in this example. used in this example.
Request from 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
Host: example.com Host: example.com
Accept: application/yang-data+xml Accept: application/yang-data
Content-Type: application/yang-patch+xml Content-Type: application/yang-patch
<yang-patch xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-patch"> <yang-patch xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-patch">
<patch-id>add-songs-patch</patch-id> <patch-id>add-songs-patch</patch-id>
<edit> <edit>
<edit-id>edit1</edit-id> <edit-id>edit1</edit-id>
<operation>create</operation> <operation>create</operation>
<target>/song</target> <target>/song</target>
<value> <value>
<song xmlns="http://example.com/ns/example-jukebox"> <song xmlns="http://example.com/ns/example-jukebox">
<name>Bridge Burning</name> <name>Bridge Burning</name>
skipping to change at page 30, line 34 skipping to change at page 30, line 47
</value> </value>
</edit> </edit>
</yang-patch> </yang-patch>
XML Response from server: XML Response from server:
HTTP/1.1 409 Conflict HTTP/1.1 409 Conflict
Date: Mon, 23 Apr 2012 13:01:20 GMT Date: Mon, 23 Apr 2012 13:01:20 GMT
Server: example-server Server: example-server
Last-Modified: Mon, 23 Apr 2012 13:01:20 GMT Last-Modified: Mon, 23 Apr 2012 13:01:20 GMT
Content-Type: application/yang-data+xml Content-Type: application/yang-data
<yang-patch-status <yang-patch-status
xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-patch"> xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-patch">
<patch-id>add-songs-patch</patch-id> <patch-id>add-songs-patch</patch-id>
<edit-status> <edit-status>
<edit> <edit>
<edit-id>edit1</edit-id> <edit-id>edit1</edit-id>
<errors> <errors>
<error> <error>
<error-type>application</error-type> <error-type>application</error-type>
skipping to change at page 33, line 39 skipping to change at page 33, line 52
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
Host: example.com Host: example.com
Accept: application/yang-patch+json Accept: application/yang-data+json
Content-Type: application/yang-data+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" : "edit1", "edit-id" : "edit1",
"operation" : "move", "operation" : "move",
"target" : "/song/1", "target" : "/song/1",
skipping to change at page 34, line 25 skipping to change at page 34, line 37
Last-Modified: Mon, 23 Apr 2012 13:01:20 GMT Last-Modified: Mon, 23 Apr 2012 13:01:20 GMT
Content-Type: application/yang-data+json Content-Type: application/yang-data+json
{ {
"ietf-restconf:yang-patch-status" : { "ietf-restconf:yang-patch-status" : {
"patch-id" : "move-song-patch", "patch-id" : "move-song-patch",
"ok" : [null] "ok" : [null]
} }
} }
D.1.4. Edit datastore resource example
The following example shows how 3 top-level data nodes from different
modules can be edited at the same time.
Example module "foo" defines leaf X. Example module "bar" defines
container Y, with child leafs A and B. Example module "baz" defines
list Z, with key C and child leafs D and E.
Request from client:
PATCH /restconf/data HTTP/1.1
Host: example.com
Accept: application/yang-data+json
Content-Type: application/yang-patch+json
{
"ietf-yang-patch:yang-patch" : {
"patch-id" : "datastore-patch-1",
"comment" : "Edit 3 top-level data nodes at once",
"edit" : [
{
"edit-id" : "edit1",
"operation" : "create",
"target" : "/foo:X",
"value" : {
"foo:X" : 42
}
},
{
"edit-id" : "edit2",
"operation" : "merge",
"target" : "/bar:Y",
"value" : {
"bar:Y" : {
"A" : "test1",
"B" : 99
}
}
},
{
"edit-id" : "edit3",
"operation" : "replace",
"target" : "/baz:Z=2",
"value" : {
"baz:Z" : {
"C" : 2,
"D" : 100,
"E" : false
}
}
}
]
}
}
Response from server:
HTTP/1.1 400 OK
Date: Mon, 23 Apr 2012 13:02:20 GMT
Server: example-server
Last-Modified: Mon, 23 Apr 2012 13:01:20 GMT
Content-Type: application/yang-data+json
{
"ietf-restconf:yang-patch-status" : {
"patch-id" : "datastore-patch-1",
"ok" : [null]
}
}
Authors' Addresses Authors' Addresses
Andy Bierman Andy Bierman
YumaWorks YumaWorks
Email: andy@yumaworks.com Email: andy@yumaworks.com
Martin Bjorklund Martin Bjorklund
Tail-f Systems Tail-f Systems
 End of changes. 57 change blocks. 
84 lines changed or deleted 165 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/