module ietf-factory-default {
yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-factory-default";
prefix fd;
import ietf-datastores {
prefix ds;
}
import ietf-netconf-acm {
prefix nacm;
}
import ietf-netconf {
prefix nc;
}
organization
"IETF NETCONF (Network Configuration) Working Group";
contact
"WG Web:
WG List:
WG Chair: Kent Watsen
WG Chair: Mahesh Jethanandani
Editor: Qin Wu
";
description
"This module defines operations that implement factory-default
capability in both NETCONF and 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-09-03 {
description
"Initial revision.";
reference "RFC XXXX: Factory default Setting Capability for RESTCONF";
}
identity factory {
base ds:datastore;
description
"The factory default configuration datastore.";
}
rpc reset {
nacm:default-deny-all;
description
"Request to reset the device to factory default setting
and make configuration update to take effect.
A server SHOULD send an rpc reply to the client before
reset the device.";
}
/*
* Augment the copy-config operation with a
* "factory" datastore parameter.
*/
augment "/nc:copy-config/nc:input/nc:source/nc:config-source" {
description
"Add factory default Datastore as source.";
leaf factory {
type ds:datastore-ref;
must "derived-from-or-self(current(), 'fd:factory')" {
error-message "config source is only applicable to factory.";
}
description
"The factory configuration is the config source.
If the copy-config operation is not supported by the server on the
specified target datastore, then the server MUST return an
element with an value of 'invalid-value'.";
}
}
/*
* Augment the get-config operation with a
* "factory" datastore parameter.
*/
augment "/nc:get-config/nc:input/nc:source/nc:config-source" {
description
"Add factory default Datastore as source.";
leaf factory {
type ds:datastore-ref;
must "derived-from-or-self(current(), 'fd:factory')" {
error-message "config source is only applicable to factory.";
}
description
"The factory configuration is the config source.
If the get-config operation is not supported by the server on the
specified target datastore, then the server MUST return an
element with an value of 'invalid-value'.";
}
}
}