netconfcentral logo

ietf-netconf-datastores@2017-08-24



  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:   <https://datatracker.ietf.org/wg/netconf/>

     WG List:  <mailto:netconf@ietf.org>

     Author:   Martin Bjorklund
           <mailto:mbj@tail-f.com>

     Author:   Juergen Schoenwaelder
           <mailto:j.schoenwaelder@jacobs-university.de>

     Author:   Phil Shafer
           <mailto:phil@juniper.net>

     Author:   Kent Watsen
           <mailto:kwatsen@juniper.net>

     Author:   Rob Wilton
           <rwilton@cisco.com>";

    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 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.";
          }
        }  // choice filter-spec

        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.";
          }
        }  // container where

        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 get-data

    rpc edit-data {
      description
        "Edit data in an NMDA datastore.";
      input {
        leaf datastore {
          type datastore;
          description
            "Datastore which data affects.";
        }

        leaf default-operation {
          type enumeration {
            enum "merge" {
              value 0;
              description
                "The default operation is merge.";
            }
            enum "replace" {
              value 1;
              description
                "The default operation is replace.";
            }
            enum "none" {
              value 2;
              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.";
          }
        }  // choice edit-content
      }
    }  // rpc edit-data

    augment /nc:lock/nc:input/nc:target/nc:config-target {
      description
        "Add NMDA Datastore as target.";
      leaf datastore {
        type datastore;
        description "Datastore to lock.";
      }
    }

    augment /nc:unlock/nc:input/nc:target/nc:config-target {
      description
        "Add NMDA Datastore as target.";
      leaf datastore {
        type datastore;
        description "Datastore to unlock.";
      }
    }

    augment /nc:validate/nc:input/nc:source/nc:config-source {
      description
        "Add NMDA Datastore as source.";
      leaf datastore {
        type datastore;
        description "Datastore to validate.";
      }
    }
  }  // module ietf-netconf-datastores