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