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