netconfcentral logo

ietf-mount@2017-03-30



  module ietf-mount {

    yang-version 1;

    namespace
      "urn:ietf:params:xml:ns:yang:ietf-mount";

    prefix mnt;

    import ietf-inet-types {
      prefix inet;
    }

    organization
      "IETF NETMOD (NETCONF Data Modeling Language) Working Group";

    contact
      "WG Web:   <http://tools.ietf.org/wg/netmod/>
     WG List:  <mailto:netmod@ietf.org>

     WG Chair: Kent Watsen
               <mailto:kwatsen@juniper.net>

     WG Chair: Lou Berger
               <mailto:lberger@labn.net>

     Editor: Alexander Clemm
     <mailto:ludwig@clemm.org>

     Editor: Jan Medved
     <mailto:jmedved@cisco.com>

     Editor: Eric Voit
     <mailto:evoit@cisco.com>";

    description
      "This module provides a set of YANG extensions and definitions
     that can be used to mount information from remote datastores.";

    revision "2017-03-30" {
      description "Initial revision.";
      reference
        "draft-clemm-netmod-mount-06.txt";

    }


    extension mountpoint {
      argument "name" {
        yin-element false;
      }
      description
        "This YANG extension is used to mount data from another
       subtree in place of the node under which this YANG extension
       statement is used.

       This extension takes one argument which specifies the name
       of the mountpoint.

       This extension can occur as a substatement underneath a
       container statement, a list statement, or a case statement.
       As a best practice, it SHOULD occur as statement only
       underneath a container statement, but it MAY also occur
       underneath a list or a case statement.

       The extension can take two parameters, target and subtree,
       each defined as their own YANG extensions.

       For Alias-Mount, a mountpoint statement MUST contain a
       subtree statement for the mountpoint definition to be valid.
       For Peer-Mount, a mountpoint statement MUST contain both a
       target and a subtree substatement for the mountpoint
       definition to be valid.

       The subtree SHOULD be specified in terms of a data node of
       type 'mnt:subtree-ref'. The targeted data node MUST
       represent a container.

       The target system MAY be specified in terms of a data node
       that uses the grouping 'mnt:mount-target'.  However, it
       can be specified also in terms of any other data node that
       contains sufficient information to address the mount target,
       such as an IP address, a host name, or a URI.

       It is possible for the mounted subtree to in turn contain a
       mountpoint.  However, circular mount relationships MUST NOT
       be introduced. For this reason, a mounted subtree MUST NOT
       contain a mountpoint that refers back to the mounting system
       with a mount target that directly or indirectly contains the
       originating mountpoint.";
    }

    extension target {
      argument "target-name" {
        yin-element false;
      }
      description
        "This YANG extension is used to perform a Peer-Mount.
       It is used to specify a remote target system from which to
       mount a datastore subtree.  This YANG
       extension takes one argument which specifies the remote
       system. In general, this argument will contain the name of
       a data node that contains the remote system information. It
       is recommended that the reference data node uses the
       mount-target grouping that is defined further below in this
       module.

       This YANG extension can occur only as a substatement below
       a mountpoint statement. It MUST NOT occur as a substatement
       below any other YANG statement.";
    }

    extension subtree {
      argument "subtree-path" {
        yin-element false;
      }
      description
        "This YANG extension is used to specify a subtree in a
       datastore that is to be mounted.  This YANG extension takes
       one argument which specifies the path to the root of the
       subtree. The root of the subtree SHOULD represent an
       instance of a YANG container.  However, it MAY represent
       also another data node.

       This YANG extension can occur only as a substatement below
       a mountpoint statement. It MUST NOT occur as a substatement
       below any other YANG statement.";
    }

    feature mount-server-mgmt {
      description
        "Provide additional capabilities to manage remote mount
       points";
    }

    typedef mount-status {
      type enumeration {
        enum "ok" {
          value 0;
          description "Mounted";
        }
        enum "no-target" {
          value 1;
          description
            "The argument of the mountpoint does not define a
           target system";
        }
        enum "no-subtree" {
          value 2;
          description
            "The argument of the mountpoint does not define a
            root of a subtree";
        }
        enum "target-unreachable" {
          value 3;
          description
            "The specified target system is currently
           unreachable";
        }
        enum "mount-failure" {
          value 4;
          description
            "Any other mount failure";
        }
        enum "unmounted" {
          value 5;
          description
            "The specified mountpoint has been unmounted as the
           result of a management operation";
        }
      }
      description
        "This type is used to represent the status of a
       mountpoint.";
    }

    typedef subtree-ref {
      type string;
      description
        "This string specifies a path to a datanode. It corresponds
       to the path substatement of a leafref type statement.  Its
       syntax needs to conform to the corresponding subset of the
       XPath abbreviated syntax. Contrary to a leafref type,
       subtree-ref allows to refer to a node in a remote datastore.
       Also, a subtree-ref refers only to a single node, not a list
       of nodes.";
    }

    grouping mount-monitor {
      description
        "This grouping contains data nodes that indicate the
       current status of a mount point.";
      leaf mount-status {
        type mount-status;
        config false;
        description
          "Indicates whether a mountpoint has been successfully
         mounted or whether some kind of fault condition is
         present.";
      }
    }  // grouping mount-monitor

    grouping mount-target {
      description
        "This grouping contains data nodes that can be used to
       identify a remote system from which to mount a datastore
       subtree.";
      container mount-target {
        description
          "A container is used to keep mount target information
         together.";
        choice target-address-type {
          mandatory true;
          description
            "Allows to identify mount target in different ways,
           i.e. using different types of addresses.";
          leaf target-ip {
            type inet:ip-address;
            description
              "IP address identifying the mount target.";
          }
          leaf uri {
            type inet:uri;
            description
              "URI identifying the mount target";
          }
          leaf hostname {
            type inet:host;
            description
              "Host name of mount target.";
          }
          leaf node-info-ref {
            type subtree-ref;
            description
              "Node identified by named subtree.";
          }
          leaf opaque-target-ID {
            type string;
            description
              "Catch-all; could be used also for mounting
               of data nodes that are local.";
          }
        }  // choice target-address-type
      }  // container mount-target
    }  // grouping mount-target

    grouping mount-policies {
      description
        "This grouping contains data nodes that allow to configure
       policies associated with mountpoints.";
      leaf manual-mount {
        type empty;
        description
          "When present, a specified mountpoint is not
         automatically mounted when the mount data node is
         created, but needs to mounted via specific RPC
         invocation.";
      }

      leaf retry-timer {
        type uint16;
        units "seconds";
        description
          "When specified, provides the period after which
         mounting will be automatically reattempted in case of a
         mount status of an unreachable target";
      }

      leaf number-of-retries {
        type uint8;
        description
          "When specified, provides a limit for the number of
         times for which retries will be automatically
         attempted";
      }
    }  // grouping mount-policies

    rpc mount {
      description
        "This RPC allows an application or administrative user to
       perform a mount operation.  If successful, it will result in
       the creation of a new mountpoint.";
      input {
        leaf mountpoint-id {
          type string {
            length "1..32";
          }
          description
            "Identifier for the mountpoint to be created.
           The mountpoint-id needs to be unique;
           if the mountpoint-id of an existing mountpoint is
           chosen, an error is returned.";
        }
      }

      output {
        leaf mount-status {
          type mount-status;
          description
            "Indicates if the mount operation was successful.";
        }
      }
    }  // rpc mount

    rpc unmount {
      description
        "This RPC allows an application or administrative user to
       unmount information from a remote datastore.  If successful,
       the corresponding mountpoint will be removed from the
       datastore.";
      input {
        leaf mountpoint-id {
          type string {
            length "1..32";
          }
          description
            "Identifies the mountpoint to be unmounted.";
        }
      }

      output {
        leaf mount-status {
          type mount-status;
          description
            "Indicates if the unmount operation was successful.";
        }
      }
    }  // rpc unmount

    container mount-server-mgmt {
      if-feature mount-server-mgmt;
      description
        "Contains information associated with managing the
       mountpoints of a datastore.";
      container mountpoints {
        description
          "Keep the mountpoint information consolidated
         in one place.";
        list mountpoint {
          key "mountpoint-id";
          description
            "There can be multiple mountpoints.
           Each mountpoint is represented by its own
           list element.";
          leaf mountpoint-id {
            type string {
              length "1..32";
            }
            description
              "An identifier of the mountpoint.
             RPC operations refer to the mountpoint
             using this identifier.";
          }

          leaf mountpoint-origin {
            type enumeration {
              enum "client" {
                value 0;
                description
                  "Mountpoint has been supplied and is
                 manually administered by a client";
              }
              enum "auto" {
                value 1;
                description
                  "Mountpoint is automatically
                 administered by the server";
              }
            }
            config false;
            description
              "This describes how the mountpoint came
             into being.";
          }

          leaf subtree-ref {
            type subtree-ref;
            mandatory true;
            description
              "Identifies the root of the subtree in the
             target system that is to be mounted.";
          }

          uses mount-target;

          uses mount-monitor;

          uses mount-policies;
        }  // list mountpoint
      }  // container mountpoints

      container global-mount-policies {
        description
          "Provides mount policies applicable for all mountpoints,
         unless overridden for a specific mountpoint.";
        uses mount-policies;
      }  // container global-mount-policies
    }  // container mount-server-mgmt
  }  // module ietf-mount