module ietf-constrained-yang-library { namespace "urn:ietf:params:xml:ns:yang:ietf-constrained-yang-library"; prefix "lib"; organization "IETF CORE (Constrained RESTful Environments) Working Group"; contact "WG Web: WG List: WG Chair: Carsten Bormann WG Chair: Jaime Jimenez Editor: Michel Veillette "; description "This module contains the list of YANG modules and submodules implemented by a server. Copyright (c) 2016 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 ( This version of this YANG module is part of RFC XXXX; see the RFC itself for full legal notices."; // RFC Ed.: replace XXXX with actual RFC number and remove // this note. // RFC Ed.: update the date below with the date of the RFC // publication and remove this note. revision 2017-01-20 { description "Initial revision."; reference "RFC XXXX: Constrained YANG Module Library."; } /* * Typedefs */ typedef revision { type binary { length "4"; } description "Revision date encoded as a binary string as follow: - First byte = Year divided by 100 - Second byte = Year modulo 100 (0 to 99) - Third byte = Month (1 = January to 12 = december) - Forth byte = Day (1 to 31)"; } typedef sid { type uint64; description "Identifier assigned to different YANG items such as data nodes, RPCs and actions, notifications, modules, sub-modules, features and deviations."; } /* * Groupings */ grouping identification-info { description "YANG modules and submodules identification information."; leaf sid { type sid; mandatory true; description "SID assigned to this module or submodule."; } leaf revision { type revision; description "Revision date assigned to this module or submodule. A zero-length binary string is used if no revision statement is present in the YANG module or submodule."; } } identity module-set { description "Base identity from which shared module-set identifiers are derived."; } /* * Operational state data nodes */ container modules-state { config false; description "Contains information about the different data models implemented by the server."; leaf module-set-id { type union { type uint32; type identityref { base "lib:module-set"; } } mandatory true; description "Identifier representing the current set of modules and submodules listed in the 'module' list. This identifier is server-specific when implemented as unit32 or shared between multiple servers when implemented as identityref. The server MUST change the value of this leaf each time the content of the 'module' list instance change."; } list module { key "sid revision"; description "Each entry represents one revision of one module currently supported by the server."; uses identification-info; leaf-list feature { type sid; description "List of YANG features from this module that are supported by the server, regardless whether they are defined in the module or in any included submodules."; } list deviation { key "sid revision"; description "List of YANG deviation modules used by this server to modify the conformance of the module associated with this entry. Note that the same module can be used for deviations for multiple modules, so the same entry MAY appear within multiple 'module' entries. The deviation module MUST be present in the 'module' list, with the same sid and revision values. The 'conformance-type' value will be 'implement' for the deviation module."; uses identification-info; } leaf conformance-type { type enumeration { enum implement { value 0; description "Indicates that the server implements one or more protocol-accessible objects defined in the YANG module identified in this entry. This includes deviation statements defined in the module. For YANG version 1.1 modules, there is at most one module entry with conformance type 'implement' for a particular module, since YANG 1.1 requires that at most one revision of a module is implemented. For YANG version 1 modules, there SHOULD NOT be more than one module entry for a particular module."; } enum import { value 1; description "Indicates that the server imports reusable definitions from the specified revision of the module, but does not implement any protocol accessible objects from this revision. Multiple module entries for the same module MAY exist. This can occur if multiple modules import the same module, but specify different revision-dates in the import statements."; } } mandatory true; description "Indicates the type of conformance the server is claiming for the YANG module identified by this entry."; } list submodule { key "sid revision"; description "Each entry represents one submodule within the parent module."; uses identification-info; } } } /* * Notifications */ notification yang-library-change { description "Generated when the set of modules and submodules supported by the server has changed."; leaf module-set-id { type leafref { path "/lib:modules-state/lib:module-set-id"; } mandatory true; description "Contains the module-set-id value representing the set of modules and submodules supported by the server at the time the notification is generated."; } } }