module ietf-netconf-datastores { yang-version 1.1; namespace "urn:ietf:params:xml:ns:yang:ietf-netconf-datastores"; prefix ncds; import ietf-yang-types { prefix yang; } import ietf-inet-types { prefix inet; } import ietf-datastores { prefix ds; } import ietf-origin { prefix or; } import ietf-netconf { prefix nc; } import ietf-netconf-with-defaults { prefix ncwd; } organization "IETF NETCONF Working Group"; contact "WG Web: WG List: Author: Martin Bjorklund Author: Juergen Schoenwaelder Author: Phil Shafer Author: Kent Watsen Author: Rob Wilton "; description "This YANG module defines a set of NETCONF operations for the Network Management Datastore Architecture (NMDA). Copyright (c) 2017 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 (http://trustee.ietf.org/license-info). This version of this YANG module is part of RFC XXXX (http://www.rfc-editor.org/info/rfcxxxx); see the RFC itself for full legal notices."; revision 2017-08-24 { description "Initial revision."; reference "RFC XXXX: NETCONF Support for NMDA"; } feature origin { description "Indicates that the server supports the 'origin' annotation."; reference "RFC XXXX: Network Management Datastore Architecture"; } typedef datastore { type identityref { base ds:datastore; } description "An NMDA datastore."; reference "RFC XXXX: Network Management Datastore Architecture"; } rpc get-data { description "Retrieve data from an NMDA datastore."; input { leaf datastore { type ncds:datastore; mandatory true; description "Datastore from which to retrieve data."; } choice filter-spec { description "The content filter specification for this request."; anydata subtree-filter { description "This parameter identifies the portions of the target datastore to retrieve."; reference "RFC 6241, Section 6."; } leaf xpath-filter { if-feature nc:xpath; type yang:xpath1.0; description "This parameter contains an XPath expression identifying the portions of the target datastore to retrieve."; } } container where { description "Filter content with the specified criteria. All given criteria are logically AND:ed."; leaf config { type boolean; description "Filter for nodes with the given value for their 'config' property."; } leaf origin { if-feature origin; type identityref { base or:origin; } description "Filter based on 'origin' annotation. A node matches the filter if its 'origin' annotation is derived from or equal to the given filter value."; } } leaf with-origin { when 'derived-from-or-self(../datastore, "or:operational")'; if-feature origin; type empty; description "If this parameter is present, the server will return the 'origin' annotation for the nodes that has one."; } uses ncwd:with-defaults-parameters; } output { anydata data { description "Copy of the source datastore subset which matched the filter criteria (if any). An empty data container indicates that the request did not produce any results."; } } } rpc edit-data { description "Edit data in an NMDA datastore."; input { leaf datastore { type ncds:datastore; description "Datastore which data affects."; } leaf default-operation { type enumeration { enum "merge" { description "The default operation is merge."; } enum "replace" { description "The default operation is replace."; } enum "none" { description "There is no default operation."; } } default "merge"; description "The default operation to use."; } choice edit-content { mandatory true; description "The content for the edit operation."; anydata config { description "Inline Config content."; } leaf url { if-feature nc:url; type inet:uri; description "URL based config content."; } } } } /* * Augment the lock and unlock operations with a * "datastore" parameter. */ augment "/nc:lock/nc:input/nc:target/nc:config-target" { description "Add NMDA Datastore as target."; leaf datastore { type ncds:datastore; description "Datastore to lock."; } } augment "/nc:unlock/nc:input/nc:target/nc:config-target" { description "Add NMDA Datastore as target."; leaf datastore { type ncds:datastore; description "Datastore to unlock."; } } /* * Augment the validate operation with a * "datastore" parameter. */ augment "/nc:validate/nc:input/nc:source/nc:config-source" { description "Add NMDA Datastore as source."; leaf datastore { type ncds:datastore; description "Datastore to validate."; } } }