Cleanup License statement
[oam/tr069-adapter.git] / netconf-server / schemas / common / ietf-netconf-monitoring.yang
1 module ietf-netconf-monitoring {\r
2 \r
3     yang-version 1;\r
4 \r
5     namespace\r
6       "urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring";\r
7 \r
8     prefix ncm;\r
9 \r
10     import ietf-yang-types {\r
11       prefix yang;\r
12       revision-date "2013-07-15";\r
13     }\r
14 \r
15     import ietf-inet-types {\r
16       prefix inet;\r
17       revision-date "2013-07-15";\r
18     }\r
19 \r
20     organization\r
21       "IETF NETCONF (Network Configuration) Working Group";\r
22 \r
23     contact\r
24       "WG Web:   <http://tools.ietf.org/wg/netconf/>\r
25      WG List:  <mailto:netconf@ietf.org>\r
26 \r
27      WG Chair: Mehmet Ersue\r
28                <mailto:mehmet.ersue@nsn.com>\r
29 \r
30      WG Chair: Bert Wijnen\r
31                <mailto:bertietf@bwijnen.net>\r
32 \r
33      Editor:   Mark Scott\r
34                <mailto:mark.scott@ericsson.com>\r
35 \r
36      Editor:   Martin Bjorklund\r
37                <mailto:mbj@tail-f.com>";\r
38 \r
39     description\r
40       "NETCONF Monitoring Module.\r
41      All elements in this module are read-only.\r
42 \r
43      Copyright (c) 2010 IETF Trust and the persons identified as\r
44      authors of the code. All rights reserved.\r
45 \r
46      Redistribution and use in source and binary forms, with or\r
47      without modification, is permitted pursuant to, and subject\r
48      to the license terms contained in, the Simplified BSD\r
49      License set forth in Section 4.c of the IETF Trust's\r
50      Legal Provisions Relating to IETF Documents\r
51      (http://trustee.ietf.org/license-info).\r
52 \r
53      This version of this YANG module is part of RFC 6022; see\r
54      the RFC itself for full legal notices.";\r
55 \r
56     revision "2010-10-04" {\r
57       description "Initial revision.";\r
58       reference\r
59         "RFC 6022: YANG Module for NETCONF Monitoring";\r
60 \r
61     }\r
62 \r
63 \r
64     typedef netconf-datastore-type {\r
65       type enumeration {\r
66         enum "running" {\r
67           value 0;\r
68         }\r
69         enum "candidate" {\r
70           value 1;\r
71         }\r
72         enum "startup" {\r
73           value 2;\r
74         }\r
75       }\r
76       description\r
77         "Enumeration of possible NETCONF datastore types.";\r
78       reference\r
79         "RFC 4741: NETCONF Configuration Protocol";\r
80 \r
81     }\r
82 \r
83     identity transport {\r
84       description\r
85         "Base identity for NETCONF transport types.";\r
86     }\r
87 \r
88     identity netconf-ssh {\r
89       base transport;\r
90       description\r
91         "NETCONF over Secure Shell (SSH).";\r
92       reference\r
93         "RFC 4742: Using the NETCONF Configuration Protocol\r
94               over Secure SHell (SSH)";\r
95 \r
96     }\r
97 \r
98     identity netconf-soap-over-beep {\r
99       base transport;\r
100       description\r
101         "NETCONF over Simple Object Access Protocol (SOAP) over\r
102        Blocks Extensible Exchange Protocol (BEEP).";\r
103       reference\r
104         "RFC 4743: Using NETCONF over the Simple Object\r
105               Access Protocol (SOAP)";\r
106 \r
107     }\r
108 \r
109     identity netconf-soap-over-https {\r
110       base transport;\r
111       description\r
112         "NETCONF over Simple Object Access Protocol (SOAP)\r
113       over Hypertext Transfer Protocol Secure (HTTPS).";\r
114       reference\r
115         "RFC 4743: Using NETCONF over the Simple Object\r
116               Access Protocol (SOAP)";\r
117 \r
118     }\r
119 \r
120     identity netconf-beep {\r
121       base transport;\r
122       description\r
123         "NETCONF over Blocks Extensible Exchange Protocol (BEEP).";\r
124       reference\r
125         "RFC 4744: Using the NETCONF Protocol over the\r
126               Blocks Extensible Exchange Protocol (BEEP)";\r
127 \r
128     }\r
129 \r
130     identity netconf-tls {\r
131       base transport;\r
132       description\r
133         "NETCONF over Transport Layer Security (TLS).";\r
134       reference\r
135         "RFC 5539: NETCONF over Transport Layer Security (TLS)";\r
136 \r
137     }\r
138 \r
139     identity schema-format {\r
140       description\r
141         "Base identity for data model schema languages.";\r
142     }\r
143 \r
144     identity xsd {\r
145       base schema-format;\r
146       description\r
147         "W3C XML Schema Definition.";\r
148       reference\r
149         "W3C REC REC-xmlschema-1-20041028:\r
150           XML Schema Part 1: Structures";\r
151 \r
152     }\r
153 \r
154     identity yang {\r
155       base schema-format;\r
156       description\r
157         "The YANG data modeling language for NETCONF.";\r
158       reference\r
159         "RFC 6020:  YANG - A Data Modeling Language for the\r
160                Network Configuration Protocol (NETCONF)";\r
161 \r
162     }\r
163 \r
164     identity yin {\r
165       base schema-format;\r
166       description "The YIN syntax for YANG.";\r
167       reference\r
168         "RFC 6020:  YANG - A Data Modeling Language for the\r
169                Network Configuration Protocol (NETCONF)";\r
170 \r
171     }\r
172 \r
173     identity rng {\r
174       base schema-format;\r
175       description\r
176         "Regular Language for XML Next Generation (RELAX NG).";\r
177       reference\r
178         "ISO/IEC 19757-2:2008: RELAX NG";\r
179 \r
180     }\r
181 \r
182     identity rnc {\r
183       base schema-format;\r
184       description "Relax NG Compact Syntax";\r
185       reference\r
186         "ISO/IEC 19757-2:2008: RELAX NG";\r
187 \r
188     }\r
189 \r
190     grouping common-counters {\r
191       description\r
192         "Counters that exist both per session, and also globally,\r
193        accumulated from all sessions.";\r
194       leaf in-rpcs {\r
195         type yang:zero-based-counter32;\r
196         description\r
197           "Number of correct <rpc> messages received.";\r
198       }\r
199 \r
200       leaf in-bad-rpcs {\r
201         type yang:zero-based-counter32;\r
202         description\r
203           "Number of messages received when an <rpc> message was expected,\r
204          that were not correct <rpc> messages.  This includes XML parse\r
205          errors and errors on the rpc layer.";\r
206       }\r
207 \r
208       leaf out-rpc-errors {\r
209         type yang:zero-based-counter32;\r
210         description\r
211           "Number of <rpc-reply> messages sent that contained an\r
212          <rpc-error> element.";\r
213       }\r
214 \r
215       leaf out-notifications {\r
216         type yang:zero-based-counter32;\r
217         description\r
218           "Number of <notification> messages sent.";\r
219       }\r
220     }  // grouping common-counters\r
221 \r
222     container netconf-state {\r
223       config false;\r
224       description\r
225         "The netconf-state container is the root of the monitoring\r
226        data model.";\r
227       container capabilities {\r
228         description\r
229           "Contains the list of NETCONF capabilities supported by the\r
230          server.";\r
231         leaf-list capability {\r
232           type inet:uri;\r
233           description\r
234             "List of NETCONF capabilities supported by the server.";\r
235         }\r
236       }  // container capabilities\r
237 \r
238       container datastores {\r
239         description\r
240           "Contains the list of NETCONF configuration datastores.";\r
241         list datastore {\r
242           key "name";\r
243           description\r
244             "List of NETCONF configuration datastores supported by\r
245            the NETCONF server and related information.";\r
246           leaf name {\r
247             type netconf-datastore-type;\r
248             description\r
249               "Name of the datastore associated with this list entry.";\r
250           }\r
251 \r
252           container locks {\r
253             presence\r
254               "This container is present only if the datastore\r
255              is locked.";\r
256             description\r
257               "The NETCONF <lock> and <partial-lock> operations allow\r
258              a client to lock specific resources in a datastore.  The\r
259              NETCONF server will prevent changes to the locked\r
260              resources by all sessions except the one that acquired\r
261              the lock(s).\r
262 \r
263              Monitoring information is provided for each datastore\r
264              entry including details such as the session that acquired\r
265              the lock, the type of lock (global or partial) and the\r
266              list of locked resources.  Multiple locks per datastore\r
267              are supported.";\r
268             grouping lock-info {\r
269               description\r
270                 "Lock related parameters, common to both global and\r
271                partial locks.";\r
272               leaf locked-by-session {\r
273                 type uint32;\r
274                 mandatory true;\r
275                 description\r
276                   "The session ID of the session that has locked\r
277                  this resource.  Both a global lock and a partial\r
278                  lock MUST contain the NETCONF session-id.\r
279 \r
280                  If the lock is held by a session that is not managed\r
281                  by the NETCONF server (e.g., a CLI session), a session\r
282                  id of 0 (zero) is reported.";\r
283                 reference\r
284                   "RFC 4741: NETCONF Configuration Protocol";\r
285 \r
286               }\r
287 \r
288               leaf locked-time {\r
289                 type yang:date-and-time;\r
290                 mandatory true;\r
291                 description\r
292                   "The date and time of when the resource was\r
293                  locked.";\r
294               }\r
295             }  // grouping lock-info\r
296             choice lock-type {\r
297               description\r
298                 "Indicates if a global lock or a set of partial locks\r
299                are set.";\r
300               container global-lock {\r
301                 description\r
302                   "Present if the global lock is set.";\r
303                 uses lock-info;\r
304               }  // container global-lock\r
305               list partial-lock {\r
306                 key "lock-id";\r
307                 description\r
308                   "List of partial locks.";\r
309                 reference\r
310                   "RFC 5717: Partial Lock Remote Procedure Call (RPC) for\r
311                       NETCONF";\r
312 \r
313                 leaf lock-id {\r
314                   type uint32;\r
315                   description\r
316                     "This is the lock id returned in the <partial-lock>\r
317                    response.";\r
318                 }\r
319 \r
320                 uses lock-info;\r
321 \r
322                 leaf-list select {\r
323                   type yang:xpath1.0;\r
324                   min-elements 1;\r
325                   description\r
326                     "The xpath expression that was used to request\r
327                    the lock.  The select expression indicates the\r
328                    original intended scope of the lock.";\r
329                 }\r
330 \r
331                 leaf-list locked-node {\r
332                   type instance-identifier;\r
333                   description\r
334                     "The list of instance-identifiers (i.e., the\r
335                    locked nodes).\r
336 \r
337                    The scope of the partial lock is defined by the list\r
338                    of locked nodes.";\r
339                 }\r
340               }  // list partial-lock\r
341             }  // choice lock-type\r
342           }  // container locks\r
343         }  // list datastore\r
344       }  // container datastores\r
345 \r
346       container schemas {\r
347         description\r
348           "Contains the list of data model schemas supported by the\r
349          server.";\r
350         list schema {\r
351           key "identifier version format";\r
352           description\r
353             "List of data model schemas supported by the server.";\r
354           leaf identifier {\r
355             type string;\r
356             description\r
357               "Identifier to uniquely reference the schema.  The\r
358              identifier is used in the <get-schema> operation and may\r
359              be used for other purposes such as file retrieval.\r
360 \r
361              For modeling languages that support or require a data\r
362              model name (e.g., YANG module name) the identifier MUST\r
363              match that name.  For YANG data models, the identifier is\r
364              the name of the module or submodule.  In other cases, an\r
365              identifier such as a filename MAY be used instead.";\r
366           }\r
367 \r
368           leaf version {\r
369             type string;\r
370             description\r
371               "Version of the schema supported.  Multiple versions MAY be\r
372              supported simultaneously by a NETCONF server.  Each\r
373              version MUST be reported individually in the schema list,\r
374              i.e., with same identifier, possibly different location,\r
375              but different version.\r
376 \r
377              For YANG data models, version is the value of the most\r
378              recent YANG 'revision' statement in the module or\r
379              submodule, or the empty string if no 'revision' statement\r
380              is present.";\r
381           }\r
382 \r
383           leaf format {\r
384             type identityref {\r
385               base schema-format;\r
386             }\r
387             description\r
388               "The data modeling language the schema is written\r
389              in (currently xsd, yang, yin, rng, or rnc).\r
390              For YANG data models, 'yang' format MUST be supported and\r
391              'yin' format MAY also be provided.";\r
392           }\r
393 \r
394           leaf namespace {\r
395             type inet:uri;\r
396             mandatory true;\r
397             description\r
398               "The XML namespace defined by the data model.\r
399 \r
400              For YANG data models, this is the module's namespace.\r
401              If the list entry describes a submodule, this field\r
402              contains the namespace of the module to which the\r
403              submodule belongs.";\r
404           }\r
405 \r
406           leaf-list location {\r
407             type union {\r
408               type enumeration {\r
409                 enum "NETCONF" {\r
410                   value 0;\r
411                 }\r
412               }\r
413               type inet:uri;\r
414             }\r
415             description\r
416               "One or more locations from which the schema can be\r
417              retrieved.  This list SHOULD contain at least one\r
418              entry per schema.\r
419 \r
420              A schema entry may be located on a remote file system\r
421              (e.g., reference to file system for ftp retrieval) or\r
422              retrieved directly from a server supporting the\r
423              <get-schema> operation (denoted by the value 'NETCONF').";\r
424           }\r
425         }  // list schema\r
426       }  // container schemas\r
427 \r
428       container sessions {\r
429         description\r
430           "The sessions container includes session-specific data for\r
431          NETCONF management sessions.  The session list MUST include\r
432          all currently active NETCONF sessions.";\r
433         list session {\r
434           key "session-id";\r
435           description\r
436             "All NETCONF sessions managed by the NETCONF server\r
437            MUST be reported in this list.";\r
438           leaf session-id {\r
439             type uint32 {\r
440               range "1..max";\r
441             }\r
442             description\r
443               "Unique identifier for the session.  This value is the\r
444              NETCONF session identifier, as defined in RFC 4741.";\r
445             reference\r
446               "RFC 4741: NETCONF Configuration Protocol";\r
447 \r
448           }\r
449 \r
450           leaf transport {\r
451             type identityref {\r
452               base transport;\r
453             }\r
454             mandatory true;\r
455             description\r
456               "Identifies the transport for each session, e.g.,\r
457             'netconf-ssh', 'netconf-soap', etc.";\r
458           }\r
459 \r
460           leaf username {\r
461             type string;\r
462             mandatory true;\r
463             description\r
464               "The username is the client identity that was authenticated\r
465             by the NETCONF transport protocol.  The algorithm used to\r
466             derive the username is NETCONF transport protocol specific\r
467             and in addition specific to the authentication mechanism\r
468             used by the NETCONF transport protocol.";\r
469           }\r
470 \r
471           leaf source-host {\r
472             type inet:host;\r
473             description\r
474               "Host identifier of the NETCONF client.  The value\r
475              returned is implementation specific (e.g., hostname,\r
476              IPv4 address, IPv6 address)";\r
477           }\r
478 \r
479           leaf login-time {\r
480             type yang:date-and-time;\r
481             mandatory true;\r
482             description\r
483               "Time at the server at which the session was established.";\r
484           }\r
485 \r
486           uses common-counters {\r
487             description\r
488               "Per-session counters.  Zero based with following reset\r
489              behaviour:\r
490                - at start of a session\r
491                - when max value is reached";\r
492           }\r
493         }  // list session\r
494       }  // container sessions\r
495 \r
496       container statistics {\r
497         description\r
498           "Statistical data pertaining to the NETCONF server.";\r
499         leaf netconf-start-time {\r
500           type yang:date-and-time;\r
501           description\r
502             "Date and time at which the management subsystem was\r
503            started.";\r
504         }\r
505 \r
506         leaf in-bad-hellos {\r
507           type yang:zero-based-counter32;\r
508           description\r
509             "Number of sessions silently dropped because an\r
510           invalid <hello> message was received.  This includes <hello>\r
511           messages with a 'session-id' attribute, bad namespace, and\r
512           bad capability declarations.";\r
513         }\r
514 \r
515         leaf in-sessions {\r
516           type yang:zero-based-counter32;\r
517           description\r
518             "Number of sessions started.  This counter is incremented\r
519            when a <hello> message with a <session-id> is sent.\r
520 \r
521           'in-sessions' - 'in-bad-hellos' =\r
522               'number of correctly started netconf sessions'";\r
523         }\r
524 \r
525         leaf dropped-sessions {\r
526           type yang:zero-based-counter32;\r
527           description\r
528             "Number of sessions that were abnormally terminated, e.g.,\r
529            due to idle timeout or transport close.  This counter is not\r
530            incremented when a session is properly closed by a\r
531            <close-session> operation, or killed by a <kill-session>\r
532            operation.";\r
533         }\r
534 \r
535         uses common-counters {\r
536           description\r
537             "Global counters, accumulated from all sessions.\r
538            Zero based with following reset behaviour:\r
539              - re-initialization of NETCONF server\r
540              - when max value is reached";\r
541         }\r
542       }  // container statistics\r
543     }  // container netconf-state\r
544 \r
545     rpc get-schema {\r
546       description\r
547         "This operation is used to retrieve a schema from the\r
548        NETCONF server.\r
549 \r
550        Positive Response:\r
551          The NETCONF server returns the requested schema.\r
552 \r
553        Negative Response:\r
554          If requested schema does not exist, the <error-tag> is\r
555          'invalid-value'.\r
556 \r
557          If more than one schema matches the requested parameters, the\r
558          <error-tag> is 'operation-failed', and <error-app-tag> is\r
559          'data-not-unique'.";\r
560       input {\r
561         leaf identifier {\r
562           type string;\r
563           mandatory true;\r
564           description\r
565             "Identifier for the schema list entry.";\r
566         }\r
567 \r
568         leaf version {\r
569           type string;\r
570           description\r
571             "Version of the schema requested.  If this parameter is not\r
572            present, and more than one version of the schema exists on\r
573            the server, a 'data-not-unique' error is returned, as\r
574            described above.";\r
575         }\r
576 \r
577         leaf format {\r
578           type identityref {\r
579             base schema-format;\r
580           }\r
581           description\r
582             "The data modeling language of the schema.  If this\r
583             parameter is not present, and more than one formats of\r
584             the schema exists on the server, a 'data-not-unique' error\r
585             is returned, as described above.";\r
586         }\r
587       }\r
588 \r
589       output {\r
590         anyxml data {\r
591           description\r
592             "Contains the schema content.";\r
593         }\r
594       }\r
595     }  // rpc get-schema\r
596 } // module\r