netconfcentral logo

ietf-module-tags@2017-10-25



  module ietf-module-tags {

    yang-version 1;

    namespace
      "urn:ietf:params:xml:ns:yang:ietf-module-tags";

    prefix mtags;

    import ietf-yang-types {
      prefix yang;
    }
    import ietf-yang-library {
      prefix yanglib;
    }

    organization
      "IETF NetMod Working Group (NetMod)";

    contact
      "NetMod Working Group - <netmod@ietf.org>";

    description
      "This module describes a tagging mechanism for yang module.
     Tags may be IANA assigned or privately defined types.";

    revision "2017-10-25" {
      description "Initial revision.";
      reference
        "TBD";

    }


    grouping module-tags {
      description
        "A grouping that may be used to classify a module.";
      leaf-list tags {
        type string;
        description
          "The module associated tags. See the IANA 'YANG Module Tag
        Prefix' registry for reserved prefixes and the IANA 'YANG
        Module IETF Tag' registry for IETF standard tags";
      }
    }  // grouping module-tags

    grouping yanglib-common-leafs {
      description
        "Common parameters for YANG modules and submodules.
       This definition extract from RFC7895 as it is defined as
       a grouping within a grouping.

       TBD is there a legal way to use a grouping defined within
       another grouping without using the parent? If so, should change
       to that.";
      leaf name {
        type yang:yang-identifier;
        mandatory true;
        description
          "The YANG module or submodule name.";
      }

      leaf revision {
        type union {
          type yanglib:revision-identifier;
          type string {
            length "0";
          }
        }
        mandatory true;
        description
          "The YANG module or submodule revision date.
         A zero-length string is used if no revision statement
         is present in the YANG module or submodule.";
      }
    }  // grouping yanglib-common-leafs

    list module-tags {
      key "name revision";
      description
        "A list of modules and their tags";
      uses yanglib-common-leafs;

      uses module-tags;
    }  // list module-tags

    rpc reset-tags {
      description
        "Reset a list of tags for a given module to the list of module
       and implementation time defiend tags. It provides the list of
       tags associated with the module post reset.";
      input {
        uses yanglib-common-leafs;
      }

      output {
        uses module-tags;
      }
    }  // rpc reset-tags
  }  // module ietf-module-tags