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