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