draft-ietf-netconf-yang-patch-00.txt   draft-ietf-netconf-yang-patch-01.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: September 23, 2014 Tail-f Systems Expires: January 4, 2015 Tail-f Systems
K. Watsen K. Watsen
Juniper Networks Juniper Networks
R. Fernando R. Fernando
Cisco Cisco
March 22, 2014 July 3, 2014
YANG Patch Media Type YANG Patch Media Type
draft-ietf-netconf-yang-patch-00 draft-ietf-netconf-yang-patch-01
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 36
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 September 23, 2014. This Internet-Draft will expire on January 4, 2015.
Copyright Notice Copyright Notice
Copyright (c) 2014 IETF Trust and the persons identified as the Copyright (c) 2014 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 21 skipping to change at page 2, line 21
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. Terms . . . . . . . . . . . . . . . . . . . . . . . . 5
1.1.5. Tree Diagrams . . . . . . . . . . . . . . . . . . . . 5 1.1.5. Tree Diagrams . . . . . . . . . . . . . . . . . . . . 5
2. YANG Patch . . . . . . . . . . . . . . . . . . . . . . . . . . 6 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 . . . . . . . . . . . . . . . . . 7 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 . . . . . . . . . . . . . . . . . . . . . . . . . 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. application/yang.patch Media Types . . . . . . . . . . . . 18 4.2. application/yang.patch Media Types . . . . . . . . . . . . 18
4.3. application/yang.patch-status Media Types . . . . . . . . 18 4.3. application/yang.patch-status Media Types . . . . . . . . 18
5. Security Considerations . . . . . . . . . . . . . . . . . . . 20 5. Security Considerations . . . . . . . . . . . . . . . . . . . 20
6. Normative References . . . . . . . . . . . . . . . . . . . . . 21 6. Normative References . . . . . . . . . . . . . . . . . . . . . 21
Appendix A. Change Log . . . . . . . . . . . . . . . . . . . . . 22 Appendix A. Change Log . . . . . . . . . . . . . . . . . . . . . 22
A.1. bierman:yang-patch-00 to ietf:yang-patch-00 . . . . . . . 22 A.1. bierman:yang-patch-00 to ietf:yang-patch-00 . . . . . . . 22
A.2. 00 to 01 . . . . . . . . . . . . . . . . . . . . . . . . . 22
Appendix B. Open Issues . . . . . . . . . . . . . . . . . . . . . 23 Appendix B. Open Issues . . . . . . . . . . . . . . . . . . . . . 23
B.1. Identification of YANG Patch capabilities . . . . . . . . 23 Appendix C. Example YANG Module . . . . . . . . . . . . . . . . . 24
B.2. Protocol independence . . . . . . . . . . . . . . . . . . 23 C.1. YANG Patch Examples . . . . . . . . . . . . . . . . . . . 25
B.3. RESTCONF coupling . . . . . . . . . . . . . . . . . . . . 23 C.1.1. Add Resources: Error . . . . . . . . . . . . . . . . . 25
B.4. Delete operation needed? . . . . . . . . . . . . . . . . . 24 C.1.2. Add Resources: Success . . . . . . . . . . . . . . . . 27
B.5. global-errors needed? . . . . . . . . . . . . . . . . . . 24 C.1.3. Move list entry example . . . . . . . . . . . . . . . 28
B.6. Is location leaf needed? . . . . . . . . . . . . . . . . . 24 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 30
B.7. Bulk editing support in yang-patch-status . . . . . . . . 24
B.8. Edit list mechanism . . . . . . . . . . . . . . . . . . . 24
Appendix C. Example YANG Module . . . . . . . . . . . . . . . . . 26
C.1. YANG Patch Examples . . . . . . . . . . . . . . . . . . . 26
C.1.1. Patch an Existing Data Resource . . . . . . . . . . . 27
C.1.2. Add Resources: Error . . . . . . . . . . . . . . . . . 27
C.1.3. Add Resources: Success . . . . . . . . . . . . . . . . 29
C.1.4. Move list entry example . . . . . . . . . . . . . . . 31
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 33
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 6, line 16 skipping to change at page 6, line 16
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 'yang-patch' container 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.
For NETCONF, a YANG "rpc" statement must be defined. The The RESTCONF server MUST return the Accept-Patch header in an OPTIONS
response, as specified in [RFC5789], which includes the media type
for YANG Patch. Example:
Accept-Patch: application/yang.patch, application/yang.data
For NETCONF, a YANG "rpc" statement needs to be defined. The
"yang-patch" grouping MUST be included in the input parameters and "yang-patch" grouping MUST be included in the input parameters and
the "yang-patch-status" grouping MUST be included in the output the "yang-patch-status" grouping MUST be included in the output
parameters. 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.
skipping to change at page 7, line 28 skipping to change at page 7, line 38
| | +--ro errors | | +--ro errors
| | | |
| +--:(ok) | +--:(ok)
| +--rw ok? empty | +--rw ok? empty
+--rw edit-status +--rw edit-status
+--rw edit [edit-id] +--rw edit [edit-id]
+--rw edit-id string +--rw edit-id string
+--rw (edit-status-choice)? +--rw (edit-status-choice)?
+--:(ok) +--:(ok)
| +--rw ok? empty | +--rw ok? empty
+--:(location)
| +--rw location? inet:uri
+--:(errors) +--:(errors)
+--ro errors +--ro errors
2.4. Target Data Node 2.4. Target Data Node
The target data node for each edit operation is determined by the The target data node for each edit operation is determined by the
value of the target resource in the request and the "target" leaf value of the target resource in the request and the "target" leaf
within each "edit" entry. within each "edit" entry.
If the target resource specified in the request URI identifies a If the target resource specified in the request URI identifies a
skipping to change at page 9, line 20 skipping to change at page 9, line 20
The "ietf-yang-types" and "ietf-inet_types" modules from [RFC6991] The "ietf-yang-types" and "ietf-inet_types" modules from [RFC6991]
are used by this module for some type definitions. are used by this module for some type definitions.
The "ietf-restconf" module from [RESTCONF] is used by this module for The "ietf-restconf" module from [RESTCONF] is used by this module for
a grouping definition. a grouping 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@2014-03-22.yang" <CODE BEGINS> file "ietf-yang-patch@2014-07-03.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-inet-types { prefix inet; }
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: Bert Wijnen WG Chair: Bert Wijnen
skipping to change at page 10, line 31 skipping to change at page 10, line 31
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-00.txt // Note: extracted from draft-ietf-netconf-yang-patch-01.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 2014-03-22 { revision 2014-07-03 {
description description
"Initial revision."; "Initial revision.";
reference reference
"RFC XXXX: YANG Patch"; "RFC XXXX: YANG Patch";
} }
typedef target-resource-offset { typedef target-resource-offset {
type string { type string {
length "1 .. max"; length "1 .. max";
} }
skipping to change at page 12, line 15 skipping to change at page 12, line 15
audit logging records generated by the server for the audit logging records generated by the server for the
patch."; patch.";
} }
list edit { list edit {
key edit-id; key edit-id;
ordered-by user; ordered-by user;
description description
"Represents one edit within the YANG Patch "Represents one edit within the YANG Patch
request message."; request message. The edit list is applied
in the following manner:
- The first edit is conceptually applied to a copy
of the existing target datastore, e.g., the
running configuration datastore.
- Each ascending edit is conceptually applied to
the result of the previous edit(s).
- After all edits have been successfully processed,
the result is validated according to YANG constraints.
- If successful, the server will attempt to apply
the result to the target datastore. ";
leaf edit-id { leaf edit-id {
type string; type string;
description description
"Arbitrary string index for the edit. "Arbitrary string index for the edit.
Error messages returned by the server pertaining Error messages returned by the server pertaining
to a specific edit will be identified by this to a specific edit will be identified by this
value."; value.";
} }
skipping to change at page 15, line 47 skipping to change at page 16, line 12
description description
"This leaf will be present if the request succeeded "This leaf will be present if the request succeeded
and there are no errors reported in the edit-status and there are no errors reported in the edit-status
container."; container.";
} }
} }
container edit-status { container edit-status {
description description
"This container will be present if there are "This container will be present if there are
edit-specific status responses to report."; edit-specific status responses to report.
If all edits succeeded and the 'global-status'
returned is 'ok', then a server MAY omit this
container";
list edit { list edit {
key edit-id; key edit-id;
description description
"Represents a list of status responses, "Represents a list of status responses,
corresponding to edits in the YANG Patch corresponding to edits in the YANG Patch
request message. If an edit entry was request message. If an edit entry was
skipped or not reached by the server, skipped or not reached by the server,
then this list will not contain a corresponding then this list will not contain a corresponding
entry for that edit."; entry for that edit.";
leaf edit-id { leaf edit-id {
type string; type string;
skipping to change at page 16, line 29 skipping to change at page 16, line 45
description description
"A choice between different types of status "A choice between different types of status
responses for each edit entry."; responses for each edit entry.";
leaf ok { leaf ok {
type empty; type empty;
description description
"This edit entry was invoked without any "This edit entry was invoked without any
errors detected by the server associated errors detected by the server associated
with this edit."; with this edit.";
} }
leaf location {
type inet:uri;
description
"Contains the Location header value that would be
returned if this edit causes a new resource to be
created. If the edit identified by the same edit-id
value was successfully invoked and a new resource
was created, then this field will be returned
instead of 'ok'.";
}
case errors { case errors {
uses rc:errors; uses rc:errors;
description description
"The server detected errors associated with the "The server detected errors associated with the
edit identified by the same edit-id value."; edit identified by the same edit-id value.";
} }
} }
} }
} }
} }
} // grouping yang-patch-status } // grouping yang-patch-status
} }
<CODE ENDS> <CODE ENDS>
4. IANA Considerations 4. IANA Considerations
4.1. YANG Module Registry 4.1. YANG Module Registry
This document registers one URI in the IETF XML registry [RFC3688]. This document registers one URI in the IETF XML registry [RFC3688].
Following the format in RFC 3688, the following registration is Following the format in RFC 3688, the following registration is
requested to be made. requested to be made.
skipping to change at page 21, line 7 skipping to change at page 21, line 7
// 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
5. Security Considerations 5. Security Considerations
TBD TBD
6. Normative References 6. Normative References
[JSON] Bray, T., Ed., "The JSON Data Interchange Format",
draft-ietf-json-rfc4627bis-10 (work in progress),
December 2013.
[RESTCONF] [RESTCONF]
Bierman, A., Bjorklund, M., Watsen, K., and R. Fernando, Bierman, A., Bjorklund, M., Watsen, K., and R. Fernando,
"RESTCONF Protocol", draft-ietf-netconf-restconf-00 (work "RESTCONF Protocol", draft-ietf-netconf-restconf-01 (work
in progress), December 2013. in progress), July 2014.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, March 1997. Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H.,
Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext
Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999.
[RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688,
January 2004. January 2004.
skipping to change at page 21, line 40 skipping to change at page 21, line 36
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, [RFC6991] Schoenwaelder, J., "Common YANG Data Types", RFC 6991,
July 2013. July 2013.
[RFC7158] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data
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. Change Log
-- RFC Ed.: remove this section before publication. -- RFC Ed.: remove this section before publication.
A.1. bierman:yang-patch-00 to ietf:yang-patch-00 A.1. bierman:yang-patch-00 to ietf:yang-patch-00
o Created open issues section o Created open issues section
Appendix B. Open Issues A.2. 00 to 01
-- RFC Ed.: remove this section before publication.
B.1. Identification of YANG Patch capabilities
How does a client know that the YANG Patch media type is supported?
Status: closed-update-pending
Resolution: the Accept-Patch header defined in RFC 5789 needs to be
implemented by the server to advertise the media types supported for
PATCH.
B.2. Protocol independence
o yang-patch/target and point leafs are type target-resource-offset.
Is this syntax for a relative resource identifier acceptable for
all protocols? Acceptable for just NETCONF and RESTCONF?
o yang-patch-status/location leaf (type inet:uri) Can this be
ignored in a protocol such as NETCONF?
Status: open (pending location issue)
Solution proposal: Change the 'location' leaf to match the
'error-node' choice in RESTCONF:
choice resource-identifier {
leaf location-path {
type instance-identifier;
}
leaf location-urlpath {
type rc:data-resource-identifier;
}
}
B.3. RESTCONF coupling
o RESTCONF is a normative reference for YANG Patch, imported in YANG
module for rc:errors grouping. Is this a problem for protocol
independence?
Status: open
B.4. Delete operation needed?
o Is the delete operation needed?
Status: closed-update-pending
Resolution: The delete operation is not needed. The remove operation
is good enough, and the ability to delete only if the target data
node exists is not needed. The delete option is dependent on the
treatment of default leafs and RESTCONF tries to hide the with-
defaults details.
B.5. global-errors needed?
o There are 2 <errors> sections in yang-patch-status (global-errors/
errors and edit-status/edit/errors). If a special 'edit-id' value
was reserved, such as an empty string, it could be used in the
'edit' list to identify global errors
Status: open
B.6. Is location leaf needed?
The location leaf in each edit is used to identify the sub-resource o Added text requiring support for Accept-Patch header, and removed
created by the edit request. Is this leaf needed at all? The POST 'Identification of YANG Patch capabilities' open issue.
method needs to return a Location header but no such requirement
exists for sub-resources created via PATCH.
Status: open o Removed 'location' leaf from yang-patch-status grouping
Solution proposal: remove location leaf from yang-patch-status. o Removed open issue 'Protocol independence' because the location
leaf was removed.
B.7. Bulk editing support in yang-patch-status o Removed open issue 'RESTCONF coupling' because thre is no concern
about a normative reference to RESTCONF. There may need to be a
YANG 1.1 mechanism to allow protocol template usage (instead of
grouping wrapper).
What if the protocol is using a bulk edit (such as NETCONF-EX o Removed open issue 'Is the delete operation needed'. It was
<edit2>) and the edit list is applied to multiple nodes? Should decided that both delete and remove should remain as operations
'leaf location' be changed to 'leaf-list location'? and clients can choose which one to use. This is not an
implementation burden on the server.
Status: open (pending location issue) o Removed open issue 'global-errors needed'. It was decided that
they are needed as defined because the global <ok/> is needed and
the special key value for edit=global error only allows for 1
global error.
Solution Proposal: the location leaf will be changed to a leaf-list o Removed open issue 'Is location leaf needed'. It was decided that
in case multiple sub-resources are created in one edit operation. it is not needed so this leaf has been removed.
B.8. Edit list mechanism o Removed open issue 'Bulk editing support in yang-patch-status'.
The 'location' leaf has been removed so this issue is no longer
applicable.
o Is the edit list approach better or worse than the 'config' o Removed open issue 'Edit list mechanism'. Added text to the
subtree approach used in the <edit-config> operation? NETCONF 'edit' list description-stmt about how the individual edits must
does not have any constraints on how operation attributes are be processed. There is no concern about duplicate edits which
nested, or whether duplicate nodes are allowed. There is no cause intermediate results to be altered by subsequent edits in
specified processing order in NETCONF. the same edit list.
Status: open Appendix B. Open Issues
o Are constraints needed (for either approach) in order to improve -- RFC Ed.: remove this section before publication.
processing consistency and interoperability? E.g., no nested
operations allowed, no duplicates allowed?
Status: open o There are no open issues at this time.
Appendix C. Example YANG Module Appendix C. 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 [RESTCONF].
YANG Tree Diagram for "example-jukebox" Module: YANG Tree Diagram for "example-jukebox" Module:
+--rw jukebox? +--rw jukebox?
+--rw library +--rw library
| +--rw artist [name] | +--rw artist [name]
| | +--rw name string | | +--rw name string
| | +--rw album [name] | | +--rw album [name]
| | +--rw name string | | +--rw name string
| | +--rw genre? identityref | | +--rw genre? identityref
| | +--rw year? uint16 | | +--rw year? uint16
| | +--rw admin
| | | +--rw label? string
| | | +--rw catalogue-number? string
| | +--rw song [name] | | +--rw song [name]
| | +--rw name string | | +--rw name string
| | +--rw location string | | +--rw location string
| | +--rw format? string | | +--rw format? string
| | +--rw length? uint32 | | +--rw length? uint32
| +--ro artist-count? uint32 | +--ro artist-count? uint32
| +--ro album-count? uint32 | +--ro album-count? uint32
| +--rw song-count? uint32 | +--ro song-count? uint32
+--rw playlist [name] +--rw playlist [name]
| +--rw name string | +--rw name string
| +--rw description? string | +--rw description? string
| +--rw song [index] | +--rw song [index]
| +--rw index uint32 | +--rw index uint32
| +--rw id instance-identifier | +--rw id instance-identifier
+--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 C.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 [JSON], and some are shown Most examples are shown in JSON encoding [RFC7158], and some are
in XML encoding [W3C.REC-xml-20081126]. shown in XML encoding [W3C.REC-xml-20081126].
C.1.1. Patch an Existing Data Resource
To replace just the "year" field in the "album" resource (instead of
replacing the entire resource), the client might send a plain patch
as follows. Note that the request URI header line is wrapped for
display purposes only:
PATCH /restconf/data/example-jukebox:jukebox/
library/artist/Foo%20Fighters/album/Wasting%20Light HTTP/1.1
Host: example.com
If-Match: b8389233a4c
Content-Type: application/yang.data+json
{ "example-jukebox:year" : 2011 }
If the field is updated, the server might respond:
HTTP/1.1 204 No Content
Date: Mon, 23 Apr 2012 17:49:30 GMT
Server: example-server
Last-Modified: Mon, 23 Apr 2012 17:49:30 GMT
ETag: b2788923da4c
The XML encoding for the same request might be:
PATCH /restconf/data/example-jukebox:jukebox/
library/artist/Foo%20Fighters/album/Wasting%20Light HTTP/1.1
Host: example.com
If-Match: b8389233a4c
Content-Type: application/yang.data+xml
<year xmlns="http://example.com/ns/example-jukebox">2011</year>
C.1.2. Add Resources: Error C.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
Host: example.com Host: example.com
Accept: application/yang.patch-status+json Accept: application/yang.patch-status+json
Content-Type: application/yang.patch+json Content-Type: application/yang.patch+json
{ {
"ietf-restconf:yang-patch" : { "ietf-yang-patch:yang-patch" : {
"patch-id" : "add-songs-patch", "patch-id" : "add-songs-patch",
"edit" : [ "edit" : [
{ {
"edit-id" : 1, "edit-id" : 1,
"operation" : "create", "operation" : "create",
"target" : "/song", "target" : "/song",
"value" : { "value" : {
"song" : { "song" : {
"name" : "Bridge Burning", "name" : "Bridge Burning",
"location" : "/media/bridge_burning.mp3", "location" : "/media/bridge_burning.mp3",
skipping to change at page 29, line 12 skipping to change at page 26, line 34
Response from server: 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.patch-status+json Content-Type: application/yang.patch-status+json
{ {
"ietf-restconf:yang-patch-status" : { "ietf-yang-patch:yang-patch-status" : {
"patch-id" : "add-songs-patch", "patch-id" : "add-songs-patch",
"edit-status" : { "edit-status" : {
"edit" : [ "edit" : [
{ {
"edit-id" : 1, "edit-id" : 1,
"errors" : { "errors" : {
"error" : [ "error" : [
{ {
"error-type": "application", "error-type": "application",
"error-tag": "data-exists", "error-tag": "data-exists",
"error-path": "/example-jukebox:jukebox/library "error-path": "/example-jukebox:jukebox/library
/artist/Foo%20Fighters/album/Wasting%20Light /artist=Foo%20Fighters/album=Wasting%20Light
/song/Burning%20Light", /song=Burning%20Light",
"error-message": "error-message":
"Data already exists, cannot be created" "Data already exists, cannot be created"
} }
] ]
} }
} }
] ]
} }
} }
} }
C.1.3. Add Resources: Success C.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:
PATCH /restconf/data/example-jukebox:jukebox/ PATCH /restconf/data/example-jukebox:jukebox/
library/artist/Foo%20Fighters/album/Wasting%20Light library/artist=Foo%20Fighters/album=Wasting%20Light
HTTP/1.1 HTTP/1.1
Host: example.com Host: example.com
Accept: application/yang.patch-status+json Accept: application/yang.patch-status+json
Content-Type: application/yang.patch+json Content-Type: application/yang.patch+json
{ {
"ietf-restconf:yang-patch" : { "ietf-yang-patch:yang-patch" : {
"patch-id" : "add-songs-patch-2", "patch-id" : "add-songs-patch-2",
"edit" : [ "edit" : [
{ {
"edit-id" : 1, "edit-id" : 1,
"operation" : "create", "operation" : "create",
"target" : "/song", "target" : "/song",
"value" : { "value" : {
"song" : { "song" : {
"name" : "Rope", "name" : "Rope",
"location" : "/media/rope.mp3", "location" : "/media/rope.mp3",
skipping to change at page 30, line 43 skipping to change at page 28, line 17
"length" : 269 "length" : 269
} }
} }
} }
] ]
} }
} }
Response from server: Response from server:
HTTP/1.1 409 Conflict HTTP/1.1 200 Success
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.patch-status+json Content-Type: application/yang.patch-status+json
{ {
"ietf-restconf: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]
"edit-status" : {
"edit" : [
{
"edit-id" : 1,
"location" : "http://example.com/restconf/
data/example-jukebox:jukebox/library/artist/
Foo%20Fighters/album/Wasting%20Light/song/Rope"
},
{
"edit-id" : 2,
"location" : "http://example.com/restconf/
data/example-jukebox:jukebox/library/artist/
Foo%20Fighters/album/Wasting%20Light/song/
Dear%20Rosemary"
}
]
}
} }
} }
C.1.4. Move list entry example C.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
Host: example.com Host: example.com
Accept: application/yang.patch-status+json Accept: application/yang.patch-status+json
Content-Type: application/yang.patch+json Content-Type: application/yang.patch+json
{ {
"ietf-restconf:yang-patch" : { "ietf-yang-patch:yang-patch" : {
"patch-id" : "move-song-patch", "patch-id" : "move-song-patch",
"comment" : "Move song 1 after song 3", "comment" : "Move song 1 after song 3",
"edit" : [ "edit" : [
{ {
"edit-id" : 1, "edit-id" : 1,
"operation" : "move", "operation" : "move",
"target" : "/song/1", "target" : "/song/1",
"point" : "/song3", "point" : "/song3",
"where" : "after" "where" : "after"
} }
skipping to change at page 32, line 40 skipping to change at page 29, line 40
HTTP/1.1 400 OK HTTP/1.1 400 OK
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.patch-status+json Content-Type: application/yang.patch-status+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]
"edit-status" : {
"edit" : [
{
"edit-id" : 1,
"ok" : [ null ]
}
]
}
} }
} }
Authors' Addresses Authors' Addresses
Andy Bierman Andy Bierman
YumaWorks YumaWorks
Email: andy@yumaworks.com Email: andy@yumaworks.com
 End of changes. 55 change blocks. 
213 lines changed or deleted 101 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/