add python compatibility module
[ccsdk/apps.git] / sdnr / model / yang / ietf-yang-library@2016-04-09.yang
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:   <http://tools.ietf.org/wg/netconf/>
17        WG List:  <mailto:netconf@ietf.org>
18
19        WG Chair: Mehmet Ersue
20                  <mailto:mehmet.ersue@nsn.com>
21
22        WG Chair: Mahesh Jethanandani
23                  <mailto:mjethanandani@gmail.com>
24
25        Editor:   Andy Bierman
26                  <mailto:andy@yumaworks.com>
27
28        Editor:   Martin Bjorklund
29                  <mailto:mbj@tail-f.com>
30
31        Editor:   Kent Watsen
32                  <mailto:kwatsen@juniper.net>";
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 XXXX; see
50        the RFC itself for full legal notices.";
51
52     // RFC Ed.: replace XXXX with actual RFC number and remove this
53     // note.
54
55     // RFC Ed.: remove this note
56     // Note: extracted from draft-ietf-netconf-yang-library-06.txt
57
58     // RFC Ed.: update the date below with the date of RFC publication
59     // and remove this note.
60     revision 2016-04-09 {
61       description
62         "Initial revision.";
63       reference
64         "RFC XXXX: YANG Module Library.";
65     }
66
67     /*
68      * Typedefs
69      */
70
71     // FIXME inline this union after https://bugs.opendaylight.org/show_bug.cgi?id=5826 is fixed
72     typedef optional-revision {
73       type union {
74         type revision-identifier;
75         type string { length 0; }
76       }
77       description
78         "The YANG module or submodule revision date.
79          A zero-length string is used if no revision statement
80          is present in the YANG module or submodule.";
81     }
82
83     typedef revision-identifier {
84       type string {
85         pattern '\d{4}-\d{2}-\d{2}';
86       }
87       description
88         "Represents a specific date in YYYY-MM-DD format.";
89     }
90
91     /*
92      * Groupings
93      */
94
95     grouping module-list {
96       description
97         "The module data structure is represented as a grouping
98          so it can be reused in configuration or another monitoring
99          data structure.";
100
101       grouping common-leafs {
102         description
103           "Common parameters for YANG modules and submodules.";
104
105         leaf name {
106           type yang:yang-identifier;
107           description
108             "The YANG module or submodule name.";
109         }
110         leaf revision {
111           type optional-revision;
112         }
113       }
114
115       grouping schema-leaf {
116         description
117           "Common schema leaf parameter for modules and submodules.";
118
119         leaf schema {
120           type inet:uri;
121           description
122             "Contains a URL that represents the YANG schema
123              resource for this module or submodule.
124
125              This leaf will only be present if there is a URL
126              available for retrieval of the schema for this entry.";
127         }
128       }
129
130       list module {
131         key "name revision";
132         description
133           "Each entry represents one revision of one module
134            currently supported by the server.";
135
136         uses common-leafs;
137         uses schema-leaf;
138
139         leaf namespace {
140           type inet:uri;
141           mandatory true;
142           description
143             "The XML namespace identifier for this module.";
144         }
145         leaf-list feature {
146           type yang:yang-identifier;
147           description
148             "List of YANG feature names from this module that are
149              supported by the server, regardless whether they are
150              defined in the module or any included submodule.";
151         }
152         list deviation {
153           key "name revision";
154           description
155             "List of YANG deviation module names and revisions
156              used by this server to modify the conformance of
157              the module associated with this entry.  Note that
158              the same module can be used for deviations for
159              multiple modules, so the same entry MAY appear
160              within multiple 'module' entries.
161
162              The deviation module MUST be present in the 'module'
163              list, with the same name and revision values.
164              The 'conformance-type' value will be 'implement' for
165              the deviation module.";
166           uses common-leafs;
167         }
168         leaf conformance-type {
169           type enumeration {
170             enum implement {
171               description
172                 "Indicates that the server implements one or more
173                  protocol-accessible objects defined in the YANG module
174                  identified in this entry.  This includes deviation
175                  statements defined in the module.
176
177                  For YANG version 1.1 modules, there is at most one
178                  module entry with conformance type 'implement' for a
179                  particular module name, since YANG 1.1 requires that
180                  at most one revision of a module is implemented.
181
182                  For YANG version 1 modules, there SHOULD NOT be more
183                  than one module entry for a particular module name.";
184             }
185             enum import {
186               description
187                 "Indicates that the server imports reusable definitions
188                  from the specified revision of the module, but does
189                  not implement any protocol accessible objects from
190                  this revision.
191
192                  Multiple module entries for the same module name MAY
193                  exist. This can occur if multiple modules import the
194                  same module, but specify different revision-dates in
195                  the import statements.";
196             }
197           }
198           mandatory true;
199           description
200             "Indicates the type of conformance the server is claiming
201              for the YANG module identified by this entry.";
202         }
203         container submodules {
204           description
205             "Contains information about all the submodules used
206              by the parent module entry";
207
208           list submodule {
209             key "name revision";
210             description
211               "Each entry represents one submodule within the
212                parent module.";
213             uses common-leafs;
214             uses schema-leaf;
215           }
216         }
217       }
218     }
219
220     /*
221      * Operational state data nodes
222      */
223
224     container modules-state {
225       config false;
226       description
227         "Contains YANG module monitoring information.";
228
229       leaf module-set-id {
230         type string;
231         mandatory true;
232         description
233           "Contains a server-specific identifier representing
234            the current set of modules and submodules.  The
235            server MUST change the value of this leaf if the
236            information represented by the 'module' list instances
237            has changed.";
238       }
239
240       uses module-list;
241     }
242
243     /*
244      * Notifications
245      */
246
247     notification yang-library-change {
248       description
249        "Generated when the set of modules and submodules supported
250         by the server has changed.";
251       leaf module-set-id {
252         type leafref {
253           path "/yanglib:modules-state/yanglib:module-set-id";
254         }
255         mandatory true;
256         description
257           "Contains the module-set-id value representing the
258            set of modules and submodules supported at the server at
259            the time the notification is generated.";
260       }
261     }
262
263 }