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