netconfcentral logo


  module ietf-yang-schema-mount {

    yang-version 1.1;


    prefix yangmnt;

    import ietf-inet-types {
      prefix inet;
        "RFC 6991: Common YANG Data Types";

    import ietf-yang-types {
      prefix yang;
        "RFC 6991: Common YANG Data Types";

    import ietf-yang-library {
      prefix yanglib;
        "RFC 7895: YANG Module Library";


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

      "WG Web:   <>
     WG List:  <>

     Editor:   Martin Bjorklund

     Editor:   Ladislav Lhotka

      "This module defines a YANG extension statement that can be used
     to incorporate data models defined in other YANG modules in a
     module. It also defines operational state data that specify the
     overall structure of the data model.

     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

     The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL
     'OPTIONAL' in the module text are to be interpreted as described
     in RFC 2119 (

     This version of this YANG module is part of RFC XXXX
     (; see the RFC itself for
     full legal notices.";

    revision "2017-10-09" {
      description "Initial revision.";
        "RFC XXXX: YANG Schema Mount";


    extension mount-point {
      argument "label" {
        yin-element false;
        "The argument 'label' is a YANG identifier, i.e., it is of the
       type 'yang:yang-identifier'.

       The 'mount-point' statement MUST NOT be used in a YANG
       version 1 module, neither explicitly nor via a 'uses'

       The 'mount-point' statement MAY be present as a substatement
       of 'container' and 'list', and MUST NOT be present elsewhere.
       There MUST NOT be more than one 'mount-point' statement in a
       given 'container' or 'list' statement.

       If a mount point is defined within a grouping, its label is
       bound to the module where the grouping is used.

       A mount point defines a place in the node hierarchy where
       other data models may be attached. A server that implements a
       module with a mount point populates the
       /schema-mounts/mount-point list with detailed information on
       which data models are mounted at each mount point.

       Note that the 'mount-point' statement does not define a new
       data node.";

    grouping mount-point-list {
        "This grouping is used inside the 'schema-mounts' container and
       inside the 'schema' list.";
      list mount-point {
        key "module label";
          "Each entry of this list specifies a schema for a particular
         mount point.

         Each mount point MUST be defined using the 'mount-point'
         extension in one of the modules listed in the corresponding
         YANG library instance with conformance type 'implement'. The
         corresponding YANG library instance is:

         - standard YANG library state data as defined in RFC 7895,
           if the 'mount-point' list is a child of 'schema-mounts',

         - the contents of the sibling 'yanglib:modules-state'
           container, if the 'mount-point' list is a child of
        leaf module {
          type yang:yang-identifier;
            "Name of a module containing the mount point.";

        leaf label {
          type yang:yang-identifier;
            "Label of the mount point defined using the 'mount-point'

        leaf config {
          type boolean;
          default "true";
            "If this leaf is set to 'false', then all data nodes in the
           mounted schema are read-only (config false), regardless of
           their 'config' property.";

        choice schema-ref {
          mandatory true;
            "Alternatives for specifying the schema.";
          leaf inline {
            type empty;
              "This leaf indicates that the server has mounted
             'ietf-yang-library' and 'ietf-schema-mount' at the mount
             point, and their instantiation (i.e., state data
             containers 'yanglib:modules-state' and 'schema-mounts')
             provides the information about the mounted schema.";
          list use-schema {
            key "name";
            min-elements 1;
              "Each entry of this list contains a reference to a schema
             defined in the /schema-mounts/schema list.";
            leaf name {
              type leafref {
                "Name of the referenced schema.";

            leaf-list parent-reference {
              type yang:xpath1.0;
                "Entries of this leaf-list are XPath 1.0 expressions
               that are evaluated in the following context:

               - The context node is the node in the parent data tree
                 where the mount-point is defined.

               - The accessible tree is the parent data tree
                 *without* any nodes defined in modules that are
                 mounted inside the parent schema.

               - The context position and context size are both equal
                 to 1.

               - The set of variable bindings is empty.

               - The function library is the core function library
                 defined in [XPath] and the functions defined in
                 Section 10 of [RFC7950].

               - The set of namespace declarations is defined by the
                 'namespace' list under 'schema-mounts'.

               Each XPath expression MUST evaluate to a nodeset
               (possibly empty). For the purposes of evaluating XPath
               expressions whose context nodes are defined in the
               mounted schema, the union of all these nodesets
               together with ancestor nodes are added to the
               accessible data tree.";
          }  // list use-schema
        }  // choice schema-ref
      }  // list mount-point
    }  // grouping mount-point-list

    container schema-mounts {
      config false;
        "Contains information about the structure of the overall
       mounted data model implemented in the server.";
      list namespace {
        key "prefix";
          "This list provides a mapping of namespace prefixes that are
         used in XPath expressions of 'parent-reference' leafs to the
         corresponding namespace URI references.";
        leaf prefix {
          type yang:yang-identifier;
          description "Namespace prefix.";

        leaf uri {
          type inet:uri;
            "Namespace URI reference.";
      }  // list namespace

      uses mount-point-list;

      list schema {
        key "name";
          "Each entry specifies a schema that can be mounted at a mount
         point.  The schema information consists of two parts:

         - an instance of YANG library that defines YANG modules used
           in the schema,

         - mount-point list with content identical to the top-level
           mount-point list (this makes the schema structure
        leaf name {
          type string;
            "Arbitrary name of the schema entry.";

        uses yanglib:module-list;

        uses mount-point-list;
      }  // list schema
    }  // container schema-mounts
  }  // module ietf-yang-schema-mount