draft-ietf-netconf-yang-patch-06.txt   draft-ietf-netconf-yang-patch-07.txt 
Network Working Group A. Bierman Network Working Group A. Bierman
Internet-Draft YumaWorks Internet-Draft YumaWorks
Intended status: Standards Track M. Bjorklund Intended status: Standards Track M. Bjorklund
Expires: April 20, 2016 Tail-f Systems Expires: June 17, 2016 Tail-f Systems
K. Watsen K. Watsen
Juniper Networks Juniper Networks
October 18, 2015 December 15, 2015
YANG Patch Media Type YANG Patch Media Type
draft-ietf-netconf-yang-patch-06 draft-ietf-netconf-yang-patch-07
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 April 20, 2016. This Internet-Draft will expire on June 17, 2016.
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
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
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 . . . . . . . . . . . . . . . . . . . . . . . . 3 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. YANG Patch . . . . . . . . . . . . . . . . . . . . . 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 . . . . . . . . . . . . . . . . . . . . . 8
2.6. Error Handling . . . . . . . . . . . . . . . . . . . . . 8 2.6. Error Handling . . . . . . . . . . . . . . . . . . . . . 8
2.7. yang-patch RESTCONF Capability . . . . . . . . . . . . . 9 2.7. yang-patch RESTCONF Capability . . . . . . . . . . . . . 9
3. YANG Module . . . . . . . . . . . . . . . . . . . . . . . . . 9 3. YANG Module . . . . . . . . . . . . . . . . . . . . . . . . . 9
4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 18 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 17
4.1. YANG Module Registry . . . . . . . . . . . . . . . . . . 18 4.1. YANG Module Registry . . . . . . . . . . . . . . . . . . 18
4.2. application/yang.patch Media Types . . . . . . . . . . . 18 4.2. application/yang.patch Media Types . . . . . . . . . . . 18
4.3. application/yang.patch-status Media Types . . . . . . . . 19 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 . . . . . . . . . . . . . . . . . . 21 Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 20
Appendix B. Change Log . . . . . . . . . . . . . . . . . . . . . 21 Appendix B. Change Log . . . . . . . . . . . . . . . . . . . . . 21
B.1. v05 to v06 . . . . . . . . . . . . . . . . . . . . . . . 21 B.1. v06 to v07 . . . . . . . . . . . . . . . . . . . . . . . 21
B.2. v04 to v05 . . . . . . . . . . . . . . . . . . . . . . . 21 B.2. v05 to v06 . . . . . . . . . . . . . . . . . . . . . . . 21
B.3. v03 to v04 . . . . . . . . . . . . . . . . . . . . . . . 21 B.3. v04 to v05 . . . . . . . . . . . . . . . . . . . . . . . 21
B.4. v02 to v03 . . . . . . . . . . . . . . . . . . . . . . . 22 B.4. v03 to v04 . . . . . . . . . . . . . . . . . . . . . . . 21
B.5. v01 to v02 . . . . . . . . . . . . . . . . . . . . . . . 22 B.5. v02 to v03 . . . . . . . . . . . . . . . . . . . . . . . 22
B.6. v00 to v01 . . . . . . . . . . . . . . . . . . . . . . . 22 B.6. v01 to v02 . . . . . . . . . . . . . . . . . . . . . . . 22
B.7. bierman:yang-patch-00 to ietf:yang-patch-00 . . . . . . . 23 B.7. v00 to v01 . . . . . . . . . . . . . . . . . . . . . . . 22
B.8. bierman:yang-patch-00 to ietf:yang-patch-00 . . . . . . . 23
Appendix C. Open Issues . . . . . . . . . . . . . . . . . . . . 23 Appendix C. Open Issues . . . . . . . . . . . . . . . . . . . . 23
Appendix D. Example YANG Module . . . . . . . . . . . . . . . . 23 Appendix D. Example YANG Module . . . . . . . . . . . . . . . . 23
D.1. YANG Patch Examples . . . . . . . . . . . . . . . . . . . 24 D.1. YANG Patch Examples . . . . . . . . . . . . . . . . . . . 24
D.1.1. Add Resources: Error . . . . . . . . . . . . . . . . 24 D.1.1. Add Resources: Error . . . . . . . . . . . . . . . . 24
D.1.2. Add Resources: Success . . . . . . . . . . . . . . . 27 D.1.2. Add Resources: Success . . . . . . . . . . . . . . . 27
D.1.3. Move list entry example . . . . . . . . . . . . . . . 28 D.1.3. Move list entry example . . . . . . . . . . . . . . . 29
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 29 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 29
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.
skipping to change at page 9, line 32 skipping to change at page 9, line 29
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-04-30.yang" <CODE BEGINS> file "ietf-yang-patch@2015-04-30.yang"
module ietf-yang-patch { module ietf-yang-patch {
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-yang-types { prefix yang; }
import ietf-restconf { import ietf-restconf {
prefix rc; prefix rc;
revision-date 2015-10-07; revision-date 2015-10-18;
} }
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 40
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-06.txt // Note: extracted from draft-ietf-netconf-yang-patch-07.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-06-04 { revision 2015-12-15 {
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 yang:xpath1.0;
description description
"Contains an XPath absolute path expression identifying "Contains an XPath absolute path expression identifying
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 XPath 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).";
} }
skipping to change at page 14, line 4 skipping to change at page 13, line 50
enum remove { enum remove {
description description
"Delete the target node if it currently exists."; "Delete the target node if it currently exists.";
} }
} }
mandatory true; mandatory true;
description description
"The datastore operation requested for the associated "The datastore operation requested for the associated
edit entry"; edit entry";
} }
leaf target { leaf target {
type target-resource-offset; type target-resource-offset;
mandatory true; mandatory true;
description description
"Identifies the target data resource for the edit "Identifies the target data resource for the edit
operation."; operation.";
} }
leaf point { leaf point {
when "(../operation = 'insert' or " + when "(../operation = 'insert' or ../operation = 'move') "
"../operation = 'move') and " + + "and (../where = 'before' or ../where = 'after')" {
"(../where = 'before' or ../where = 'after')" {
description description
"Point leaf only applies for insert or move "Point leaf only applies for insert or move
operations, before or after an existing entry."; operations, before or after an existing entry.";
} }
type target-resource-offset; type target-resource-offset;
description description
"The absolute URL path for the data node that is being "The absolute URL path for the data node that is being
used as the insertion point or move point for the used as the insertion point or move point for the
target of this edit entry."; target of this edit entry.";
} }
skipping to change at page 15, line 16 skipping to change at page 15, line 14
} }
default last; default last;
description description
"Identifies where a data resource will be inserted or "Identifies where a data resource will be inserted or
moved. YANG only allows these operations for moved. YANG only allows these operations for
list and leaf-list data nodes that are ordered-by list and leaf-list data nodes that are ordered-by
user."; user.";
} }
anyxml value { anydata value {
when "(../operation = 'create' or " + when "../operation = 'create' "
"../operation = 'merge' " + + "or ../operation = 'merge' "
"or ../operation = 'replace' or " + + "or ../operation = 'replace' "
"../operation = 'insert')" { + "or ../operation = 'insert'" {
description description
"Value node only used for create, merge, "Value node only used for create, merge,
replace, and insert operations"; replace, and insert operations";
} }
description description
"Value used for this edit operation. "Value used for this edit operation. The anydata 'value'
The anyxml value MUST represent a container with contains the target resource associated with the
exactly one child node, which MUST identify the 'target' leaf.
target resource associated with the 'target' leaf.
The descendants of this node MUST NOT contain
an 'anyxml' data node. Only 'list', 'container',
'leaf', and 'leaf-list' data nodes can appear as
descendant nodes of this object.
For example, suppose the target node is a YANG container For example, suppose the target node is a YANG container
named foo: named foo:
container foo { container foo {
leaf a { type string; } leaf a { type string; }
leaf b { type int32; } leaf b { type int32; }
} }
The value node will contain one instance of foo: The 'value' node will contain one instance of foo:
<value> <value>
<foo xmlns='example-foo-namespace'> <foo xmlns='example-foo-namespace'>
<a>some value</a> <a>some value</a>
<b>42</b> <b>42</b>
</foo> </foo>
</value> </value>
"; ";
} }
} }
} }
} // grouping yang-patch } // grouping yang-patch
grouping yang-patch-status { grouping yang-patch-status {
description description
"A grouping that contains a YANG container "A grouping that contains a YANG container
representing the syntax and semantics of representing the syntax and semantics of
YANG Patch status response message."; YANG Patch status response message.";
container yang-patch-status { container yang-patch-status {
description description
"A container representing the response message "A container representing the response message
sent by the server after a YANG Patch edit sent by the server after a YANG Patch edit
request message has been processed."; request message has been processed.";
skipping to change at page 21, line 29 skipping to change at page 21, line 21
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. v05 to v06 B.1. v06 to v07
o converted YANG module to YANG 1.1
o changed anyxml value to anydata value
o updated import revision date for ietf-restconf
o updated revision date for ietf-yang-patch because import-by-
revision date needed to be changed
B.2. 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.2. v04 to v05 B.3. v04 to v05
o updated reference to RESTCONF o updated reference to RESTCONF
B.3. v03 to v04 B.4. 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)
skipping to change at page 22, line 16 skipping to change at page 22, line 18
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.4. v02 to v03 B.5. 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.5. v01 to v02 B.6. 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.6. v00 to v01 B.7. v00 to v01
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 23, line 28 skipping to change at page 23, line 30
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.7. bierman:yang-patch-00 to ietf:yang-patch-00 B.8. 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 [1]
Appendix D. Example YANG Module Appendix D. Example YANG Module
The example YANG module used in this document represents a simple The example YANG module used in this document represents a simple
media jukebox interface. The "example-jukebox" YANG module is media jukebox interface. The "example-jukebox" YANG module is
defined in [I-D.ietf-netconf-restconf]. defined in [I-D.ietf-netconf-restconf].
YANG Tree Diagram for "example-jukebox" Module: YANG Tree Diagram for "example-jukebox" Module:
+--rw jukebox! +--rw jukebox!
 End of changes. 34 change blocks. 
52 lines changed or deleted 57 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/