NETCONF Working Group Q. Wu Internet-Draft Y. Niu Intended status: Standards Track Huawei Expires: December 29, 2018 June 27, 2018 Factory default Setting Capability for RESTCONF draft-wu-netconf-restconf-factory-restore-00 Abstract This document defines capability based extension to RESTCONF protocol that allows RESTCONF client to configure newly deployed devices with just its preconfigured initial state (i.e., factory default settings) during zero touch bootstrapping process or restore the configuration to its preconfigured initial state or system restore point either during device rooting process or at the time of system fatal error or malfunction. Status of This Memo This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at https://datatracker.ietf.org/drafts/current/. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." This Internet-Draft will expire on December 29, 2018. Copyright Notice Copyright (c) 2018 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of Wu & Niu Expires December 29, 2018 [Page 1] Internet-Draft Factory Default Setting Capability June 2018 the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 2 2. Datastore . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.1. The factory default setting Configuration Datastore . . . 3 3. New Operations . . . . . . . . . . . . . . . . . . . . . . . 3 3.1. factory-restore . . . . . . . . . . . . . . . . . . . . . 4 3.1.1. Example: return to factory default setting without zero touch bootstrapping support . . . . . . 4 3.1.2. Example: return to factory default setting with zero touch bootstrapping support . . . . . . . . 5 4. YANG Module . . . . . . . . . . . . . . . . . . . . . . . . . 5 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 9 6. Security Considerations . . . . . . . . . . . . . . . . . . . 9 7. Normative References . . . . . . . . . . . . . . . . . . . . 9 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 11 1. Introduction RESTCONF uses HTTP methods such as HTTP POST, PUT, PATCH, and DELETE to provide CRUD operations on a conceptual datastore containing YANG- defined data, which is compatible with a server that implements NETCONF datastores. As described in [RFC8040], the HTTP PUT method on the datastore resource can be used to replace the entire content of the Datasore, however it can not be used to return any datastore (e.g., ) to factory default setting or previous system restore point,especially when the RESTCONF server is implemented in a device that does not have NETCONF support. This document defines capability based extension to RESTCONF protocol that allows RESTCONF client to configure newly deployed devices with just its preconfigured initial state (i.e., factory default settings) during zero touch bootstrapping process or restore the configuration to its preconfigured initial state or system restore point either during device rooting process or at the time of system fatal error. 1.1. Terminology The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here. Wu & Niu Expires December 29, 2018 [Page 2] Internet-Draft Factory Default Setting Capability June 2018 The following terms are defined in [RFC8342] and are not redefined here: o operational state datastore o running configuration datastore o intended configuration datastore 2. Datastore A RESTCONF server implementing this document MUST be NMDA-compliant [I-D.ietf-netconf-nmda-restconf] and is implemented in a device that does not have a NETCONF server [RFC8040]. A RESTCONF server supports both the operational state Datastore and the intended configuration datastore. 2.1. The factory default setting Configuration Datastore This document introduces a new configuration datastore named 'Factory default setting' that represents datastore with its preconfigured initial state. The Factory default setting datastore is essentially a special case of startup configuration datastore. The new name is used in order to emphasize the narrower semantics: the factory default setting datastore MUST be preconfigured with initial state of factory default setting. The factory default setting datastore assumes the place of the datastore resource as defined in [RFC8040] Section 3.4. This means that the entire datastore resources inside the "{+restconf}/data" subtree correspond to data instances in the factory default setting datastore. Therefore, the contents of the factory default setting datastore can be retrieved by means of the GET method as specified in [RFC8040] and but can not be modified by means of PUT methods as specified in [RFC8040]. 3. New Operations In order to support factory restore and system restore capability in RESTCONF, the YANG module "ietf-restconf-restore" defines three operations below. The factory-restore operation is is similar to NETCONF and defined to support Factory default Setting Capability in RESTCONF. Wu & Niu Expires December 29, 2018 [Page 3] Internet-Draft Factory Default Setting Capability June 2018 3.1. factory-restore The operation atomically returns any target datastore to factory default setting. The operation replaces the entire contents of a writable Datastore with the contents of complete factory default setting, similar to the operation defined in [RFC6241], but with additional flexibility in specifying the target Datastore. If the target datastore exists, it is overwritten. Otherwise, a new one is created, if allowed. If an operation is invoked on a non-writable datastore, then an error is returned, as specified in"ietf-netconf-nmda". The "source" parameter is a datastore identity that indicates the desired source of operation. The "target" parameter is a name of the configuration datastore to use as the destination of the operation. The element can appear as the or parameter. The "restart" parameter is used to indicate whether to use bootstrapping to return target datastore to factory default setting in the < factor-restore > operation. If bootstrapping is used, the "source" parameter MAY not be specified. 3.1.1. Example: return to factory default setting without zero touch bootstrapping support The client(e.g.,NMS) might send the following POST request message to invoke the "factory-recovery" RPC operation: POST /restconf/operations/ietf-restconf-factory-default:factory-recovery HTTP/1.1 Host: example.com Content-Type: application/yang-data+xml file://checkpoint.conf running false In this request, element should be set to false, element MUST be specified. If URL Capability is supported, element in the element MUST be specified. The server will use HTTP GET method to retrieve content of corresponding to factory default setting datastore and copy the Wu & Niu Expires December 29, 2018 [Page 4] Internet-Draft Factory Default Setting Capability June 2018 entire content to . In successful case, the server might respond as follows: HTTP/1.1 204 No Content Date: Thu, 26 Jan 2017 20:56:30 GMT Server: example-server 3.1.2. Example: return to factory default setting with zero touch bootstrapping support The client(e.g.,NMS) might send the following POST request message to invoke the "factory-recovery" RPC operation: POST /restconf/operations/ietf-restconf-factory-default:factory-recovery HTTP/1.1 Host: example.com Content-Type: application/yang-data+xml running true In this request, element should be set to true, element is not specified. The server will use zerotouch bootstrap service defined in [I-D.ietf-netconf-zerotouch] to get factory default setting configuration and copy the entire content to . In successful case, the server might respond as follows: HTTP/1.1 204 No Content Date: Thu, 26 Jan 2017 20:56:30 GMT Server: example-server 4. YANG Module file "ietf-restconf-restore@2018-06-21.yang" module ietf-restconf-restore { namespace "urn:ietf:params:xml:ns:yang:ietf-restconf-restore"; prefix rct; import ietf-inet-types { prefix inet; } organization "IETF NETCONF (Network Configuration) Working Group"; contact "WG Web: WG List: Wu & Niu Expires December 29, 2018 [Page 5] Internet-Draft Factory Default Setting Capability June 2018 WG Chair: Kent Watsen WG Chair: Mahesh Jethanandani Editor: Qin Wu "; description "This module defines operations that implement factory-default and system restore capability in the RESTCONF protocol. Copyright (c) 2018 IETF Trust and the persons identified as authors of the code. All rights reserved. Redistribution and use in source and binary forms, with or without modification, is permitted pursuant to, and subject to the license terms contained in, the Simplified BSD License set forth in Section 4.c of the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info). The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'MAY', and 'OPTIONAL' in the module text are to be interpreted as described in RFC 2119 (https://tools.ietf.org/html/rfc2119). This version of this YANG module is part of RFC XXXX (https://tools.ietf.org/html/rfcXXXX); see the RFC itself for full legal notices."; revision 2018-06-21 { description "Initial revision."; reference "RFC XXXX: Factory default Setting Capability for RESTCONF"; } // NETCONF capabilities defined as features feature startup { description "NETCONF :startup capability; If the server advertises the :startup capability for a session, then this feature must also be enabled for that session. Otherwise, this feature must not be enabled."; reference "RFC 6241, Section 8.7"; Wu & Niu Expires December 29, 2018 [Page 6] Internet-Draft Factory Default Setting Capability June 2018 } feature url { description "NETCONF :url capability; If the server advertises the :url capability for a session, then this feature must also be enabled for that session. Otherwise, this feature must not be enabled."; reference "RFC 6241, Section 8.8"; } feature writable-running { description "NETCONF :writable-running capability; If the server advertises the :writable-running capability for a session, then this feature must also be enabled for that session. Otherwise, this feature must not be enabled."; reference "RFC 6241, Section 8.2"; } feature candidate { description "NETCONF :candidate capability; If the server advertises the :candidate capability for a session, then this feature must also be enabled for that session. Otherwise, this feature must not be enabled."; reference "RFC 6241, Section 8.3"; } /* Operations */ rpc factory-recovery { description "The operation atomically returns any target datastore to factory default setting. The operation replaces the entire contents of a writable Datastore with the contents of complete factory default setting, similar to the operation defined in [RFC6241], but with additional flexibility in specifying the target Datastore. "; input { container target { description "Particular configuration to return factory default setting to."; choice config-target { mandatory true; Wu & Niu Expires December 29, 2018 [Page 7] Internet-Draft Factory Default Setting Capability June 2018 description "The configuration target of the copy operation."; leaf candidate { if-feature candidate; type empty; description "The candidate configuration is the config target."; } leaf running { if-feature writable-running; type empty; description "The running configuration is the config target. This is optional-to-implement on the server."; } leaf startup { if-feature startup; type empty; description "The startup configuration is the config target."; } leaf url { if-feature url; type inet:uri; description "The URL-based configuration is the config target."; } } } container source { description "Particular configuration to copy from."; choice config-source { mandatory true; description "The configuration source for the copy operation."; leaf factory { if-feature candidate; type empty; description "The factory-default-setting configuration is the config source."; } leaf url { if-feature url; Wu & Niu Expires December 29, 2018 [Page 8] Internet-Draft Factory Default Setting Capability June 2018 type inet:uri; description "The URL-based configuration is the config source."; } } } leaf restart { type boolean; description "indicate whether restart or zero touch bootstrapping service is enabled."; } } } } 5. IANA Considerations This document registers one URI in the IETF XML Registry [RFC3688]. The following registration has been made: URI: urn:ietf:params:xml:ns:yang:ietf-restconf-restore Registrant Contact: The IESG. XML: N/A, the requested URI is an XML namespace. This document registers one YANG module in the YANG Module Names Registry [RFC6020]. The following registration has been made: name: ietf-restconf-restore namespace: urn:ietf:params:xml:ns:yang:ietf-restconf- restore prefix: rcf RFC: xxxx 6. Security Considerations TBD. 7. Normative References Wu & Niu Expires December 29, 2018 [Page 9] Internet-Draft Factory Default Setting Capability June 2018 [I-D.ietf-netconf-zerotouch] Watsen, K., Abrahamsson, M., and I. Farrer, "Zero Touch Provisioning for Networking Devices", draft-ietf-netconf- zerotouch-22 (work in progress), June 2018. [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, . [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, DOI 10.17487/RFC3688, January 2004, . [RFC5277] Chisholm, S. and H. Trevino, "NETCONF Event Notifications", RFC 5277, DOI 10.17487/RFC5277, July 2008, . [RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for the Network Configuration Protocol (NETCONF)", RFC 6020, DOI 10.17487/RFC6020, October 2010, . [RFC6021] Schoenwaelder, J., Ed., "Common YANG Data Types", RFC 6021, DOI 10.17487/RFC6021, October 2010, . [RFC6241] Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed., and A. Bierman, Ed., "Network Configuration Protocol (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011, . [RFC6242] Wasserman, M., "Using the NETCONF Protocol over Secure Shell (SSH)", RFC 6242, DOI 10.17487/RFC6242, June 2011, . [RFC6470] Bierman, A., "Network Configuration Protocol (NETCONF) Base Notifications", RFC 6470, DOI 10.17487/RFC6470, February 2012, . [RFC8040] Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF Protocol", RFC 8040, DOI 10.17487/RFC8040, January 2017, . [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017, . Wu & Niu Expires December 29, 2018 [Page 10] Internet-Draft Factory Default Setting Capability June 2018 [RFC8342] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K., and R. Wilton, "Network Management Datastore Architecture (NMDA)", RFC 8342, DOI 10.17487/RFC8342, March 2018, . Authors' Addresses Qin Wu Huawei 101 Software Avenue, Yuhua District Nanjing, Jiangsu 210012 China Email: bill.wu@huawei.com Ye Niu Huawei Email: niuye@huawei.com Wu & Niu Expires December 29, 2018 [Page 11]