|
| 1 | +module ietf-yang-library { |
| 2 | + namespace "urn:ietf:params:xml:ns:yang:ietf-yang-library"; |
| 3 | + prefix "yanglib"; |
| 4 | + |
| 5 | + import ietf-yang-types { |
| 6 | + prefix yang; |
| 7 | + } |
| 8 | + import ietf-inet-types { |
| 9 | + prefix inet; |
| 10 | + } |
| 11 | + |
| 12 | + organization |
| 13 | + "IETF NETCONF (Network Configuration) Working Group"; |
| 14 | + |
| 15 | + contact |
| 16 | + "WG Web: <https://datatracker.ietf.org/wg/netconf/> |
| 17 | + WG List: <mailto:[email protected]> |
| 18 | +
|
| 19 | + WG Chair: Mehmet Ersue |
| 20 | + |
| 21 | +
|
| 22 | + WG Chair: Mahesh Jethanandani |
| 23 | + |
| 24 | +
|
| 25 | + Editor: Andy Bierman |
| 26 | + |
| 27 | +
|
| 28 | + Editor: Martin Bjorklund |
| 29 | + |
| 30 | +
|
| 31 | + Editor: Kent Watsen |
| 32 | + |
| 33 | + |
| 34 | + description |
| 35 | + "This module contains monitoring information about the YANG |
| 36 | + modules and submodules that are used within a YANG-based |
| 37 | + server. |
| 38 | +
|
| 39 | + Copyright (c) 2016 IETF Trust and the persons identified as |
| 40 | + authors of the code. All rights reserved. |
| 41 | +
|
| 42 | + Redistribution and use in source and binary forms, with or |
| 43 | + without modification, is permitted pursuant to, and subject |
| 44 | + to the license terms contained in, the Simplified BSD License |
| 45 | + set forth in Section 4.c of the IETF Trust's Legal Provisions |
| 46 | + Relating to IETF Documents |
| 47 | + (http://trustee.ietf.org/license-info). |
| 48 | +
|
| 49 | + This version of this YANG module is part of RFC 7895; see |
| 50 | + the RFC itself for full legal notices."; |
| 51 | + |
| 52 | + revision 2016-06-21 { |
| 53 | + description |
| 54 | + "Initial revision."; |
| 55 | + reference |
| 56 | + "RFC 7895: YANG Module Library."; |
| 57 | + } |
| 58 | + |
| 59 | + /* |
| 60 | + * Typedefs |
| 61 | + */ |
| 62 | + |
| 63 | + typedef revision-identifier { |
| 64 | + type string { |
| 65 | + pattern '\d{4}-\d{2}-\d{2}'; |
| 66 | + } |
| 67 | + description |
| 68 | + "Represents a specific date in YYYY-MM-DD format."; |
| 69 | + } |
| 70 | + |
| 71 | + /* |
| 72 | + * Groupings |
| 73 | + */ |
| 74 | + |
| 75 | + grouping module-list { |
| 76 | + description |
| 77 | + "The module data structure is represented as a grouping |
| 78 | + so it can be reused in configuration or another monitoring |
| 79 | + data structure."; |
| 80 | + |
| 81 | + grouping common-leafs { |
| 82 | + description |
| 83 | + "Common parameters for YANG modules and submodules."; |
| 84 | + |
| 85 | + leaf name { |
| 86 | + type yang:yang-identifier; |
| 87 | + description |
| 88 | + "The YANG module or submodule name."; |
| 89 | + } |
| 90 | + leaf revision { |
| 91 | + type union { |
| 92 | + type revision-identifier; |
| 93 | + type string { length 0; } |
| 94 | + } |
| 95 | + description |
| 96 | + "The YANG module or submodule revision date. |
| 97 | + A zero-length string is used if no revision statement |
| 98 | + is present in the YANG module or submodule."; |
| 99 | + } |
| 100 | + } |
| 101 | + |
| 102 | + grouping schema-leaf { |
| 103 | + description |
| 104 | + "Common schema leaf parameter for modules and submodules."; |
| 105 | + |
| 106 | + leaf schema { |
| 107 | + type inet:uri; |
| 108 | + description |
| 109 | + "Contains a URL that represents the YANG schema |
| 110 | + resource for this module or submodule. |
| 111 | +
|
| 112 | + This leaf will only be present if there is a URL |
| 113 | + available for retrieval of the schema for this entry."; |
| 114 | + } |
| 115 | + } |
| 116 | + |
| 117 | + list module { |
| 118 | + key "name revision"; |
| 119 | + description |
| 120 | + "Each entry represents one revision of one module |
| 121 | + currently supported by the server."; |
| 122 | + |
| 123 | + uses common-leafs; |
| 124 | + uses schema-leaf; |
| 125 | + |
| 126 | + leaf namespace { |
| 127 | + type inet:uri; |
| 128 | + mandatory true; |
| 129 | + description |
| 130 | + "The XML namespace identifier for this module."; |
| 131 | + } |
| 132 | + leaf-list feature { |
| 133 | + type yang:yang-identifier; |
| 134 | + description |
| 135 | + "List of YANG feature names from this module that are |
| 136 | + supported by the server, regardless of whether they are |
| 137 | + defined in the module or any included submodule."; |
| 138 | + } |
| 139 | + list deviation { |
| 140 | + key "name revision"; |
| 141 | + description |
| 142 | + "List of YANG deviation module names and revisions |
| 143 | + used by this server to modify the conformance of |
| 144 | + the module associated with this entry. Note that |
| 145 | + the same module can be used for deviations for |
| 146 | + multiple modules, so the same entry MAY appear |
| 147 | + within multiple 'module' entries. |
| 148 | +
|
| 149 | + The deviation module MUST be present in the 'module' |
| 150 | + list, with the same name and revision values. |
| 151 | + The 'conformance-type' value will be 'implement' for |
| 152 | + the deviation module."; |
| 153 | + uses common-leafs; |
| 154 | + } |
| 155 | + leaf conformance-type { |
| 156 | + type enumeration { |
| 157 | + enum implement { |
| 158 | + description |
| 159 | + "Indicates that the server implements one or more |
| 160 | + protocol-accessible objects defined in the YANG module |
| 161 | + identified in this entry. This includes deviation |
| 162 | + statements defined in the module. |
| 163 | +
|
| 164 | + For YANG version 1.1 modules, there is at most one |
| 165 | + module entry with conformance type 'implement' for a |
| 166 | + particular module name, since YANG 1.1 requires that, |
| 167 | + at most, one revision of a module is implemented. |
| 168 | +
|
| 169 | + For YANG version 1 modules, there SHOULD NOT be more |
| 170 | + than one module entry for a particular module name."; |
| 171 | + } |
| 172 | + enum import { |
| 173 | + description |
| 174 | + "Indicates that the server imports reusable definitions |
| 175 | + from the specified revision of the module but does |
| 176 | + not implement any protocol-accessible objects from |
| 177 | + this revision. |
| 178 | +
|
| 179 | + Multiple module entries for the same module name MAY |
| 180 | + exist. This can occur if multiple modules import the |
| 181 | + same module but specify different revision dates in |
| 182 | + the import statements."; |
| 183 | + } |
| 184 | + } |
| 185 | + mandatory true; |
| 186 | + description |
| 187 | + "Indicates the type of conformance the server is claiming |
| 188 | + for the YANG module identified by this entry."; |
| 189 | + } |
| 190 | + list submodule { |
| 191 | + key "name revision"; |
| 192 | + description |
| 193 | + "Each entry represents one submodule within the |
| 194 | + parent module."; |
| 195 | + uses common-leafs; |
| 196 | + uses schema-leaf; |
| 197 | + } |
| 198 | + } |
| 199 | + } |
| 200 | + |
| 201 | + /* |
| 202 | + * Operational state data nodes |
| 203 | + */ |
| 204 | + |
| 205 | + container modules-state { |
| 206 | + config false; |
| 207 | + description |
| 208 | + "Contains YANG module monitoring information."; |
| 209 | + |
| 210 | + leaf module-set-id { |
| 211 | + type string; |
| 212 | + mandatory true; |
| 213 | + description |
| 214 | + "Contains a server-specific identifier representing |
| 215 | + the current set of modules and submodules. The |
| 216 | + server MUST change the value of this leaf if the |
| 217 | + information represented by the 'module' list instances |
| 218 | + has changed."; |
| 219 | + } |
| 220 | + |
| 221 | + uses module-list; |
| 222 | + } |
| 223 | + |
| 224 | + /* |
| 225 | + * Notifications |
| 226 | + */ |
| 227 | + |
| 228 | + notification yang-library-change { |
| 229 | + description |
| 230 | + "Generated when the set of modules and submodules supported |
| 231 | + by the server has changed."; |
| 232 | + leaf module-set-id { |
| 233 | + type leafref { |
| 234 | + path "/yanglib:modules-state/yanglib:module-set-id"; |
| 235 | + } |
| 236 | + mandatory true; |
| 237 | + description |
| 238 | + "Contains the module-set-id value representing the |
| 239 | + set of modules and submodules supported at the server at |
| 240 | + the time the notification is generated."; |
| 241 | + } |
| 242 | + } |
| 243 | + |
| 244 | +} |
| 245 | + |
0 commit comments