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