blob: 8130bfd0f07676816adecd984ef645d31be09091 [file] [log] [blame]
Sean Condonfae8e662016-12-15 10:25:13 +00001
2module ietf-netconf-monitoring {
3
4 namespace "urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring";
5 prefix "ncm";
6
7 import ietf-yang-types { prefix yang; }
8 import ietf-inet-types { prefix inet; }
9
10 organization
11 "IETF NETCONF (Network Configuration) Working Group";
12
13 contact
14 "WG Web: <http://tools.ietf.org/wg/netconf/>
15 WG List: <mailto:netconf@ietf.org>
16
17 WG Chair: Mehmet Ersue
18 <mailto:mehmet.ersue@nsn.com>
19
20 WG Chair: Bert Wijnen
21 <mailto:bertietf@bwijnen.net>
22
23 Editor: Mark Scott
24 <mailto:mark.scott@ericsson.com>
25
26 Editor: Martin Bjorklund
27 <mailto:mbj@tail-f.com>";
28
29 description
30 "NETCONF Monitoring Module.
31 All elements in this module are read-only.
32
33 Copyright (c) 2010 IETF Trust and the persons identified as
34 authors of the code. All rights reserved.
35
36 Redistribution and use in source and binary forms, with or
37 without modification, is permitted pursuant to, and subject
38 to the license terms contained in, the Simplified BSD
39 License set forth in Section 4.c of the IETF Trust's
40 Legal Provisions Relating to IETF Documents
41 (http://trustee.ietf.org/license-info).
42
43 This version of this YANG module is part of RFC 6022; see
44 the RFC itself for full legal notices.";
45
46 revision 2010-10-04 {
47 description
48 "Initial revision.";
49 reference
50 "RFC 6022: YANG Module for NETCONF Monitoring";
51 }
52
53 typedef netconf-datastore-type {
54 type enumeration {
55 enum running;
56 enum candidate;
57 enum startup;
58 }
59 description
60 "Enumeration of possible NETCONF datastore types.";
61 reference
62 "RFC 4741: NETCONF Configuration Protocol";
63 }
64
65 identity transport {
66 description
67 "Base identity for NETCONF transport types.";
68 }
69
70 identity netconf-ssh {
71 base transport;
72 description
73 "NETCONF over Secure Shell (SSH).";
74 reference
75 "RFC 4742: Using the NETCONF Configuration Protocol
76 over Secure SHell (SSH)";
77 }
78
79 identity netconf-soap-over-beep {
80 base transport;
81 description
82 "NETCONF over Simple Object Access Protocol (SOAP) over
83 Blocks Extensible Exchange Protocol (BEEP).";
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 description
177 "Number of messages received when an <rpc> message was expected,
178 that were not correct <rpc> messages. This includes XML parse
179 errors and errors on the rpc layer.";
180 }
181 leaf out-rpc-errors {
182 type yang:zero-based-counter32;
183 description
184 "Number of <rpc-reply> messages sent that contained an
185 <rpc-error> element.";
186 }
187 leaf out-notifications {
188 type yang:zero-based-counter32;
189 description
190 "Number of <notification> messages sent.";
191 }
192 }
193
194 container netconf-state {
195 config false;
196 description
197 "The netconf-state container is the root of the monitoring
198 data model.";
199
200 container capabilities {
201 description
202 "Contains the list of NETCONF capabilities supported by the
203 server.";
204
205 leaf-list capability {
206 type inet:uri;
207 description
208 "List of NETCONF capabilities supported by the server.";
209 }
210 }
211
212 container datastores {
213 description
214 "Contains the list of NETCONF configuration datastores.";
215
216 list datastore {
217 key name;
218 description
219 "List of NETCONF configuration datastores supported by
220 the NETCONF server and related information.";
221
222 leaf name {
223 type netconf-datastore-type;
224 description
225 "Name of the datastore associated with this list entry.";
226 }
227 container locks {
228 presence
229 "This container is present only if the datastore
230 is locked.";
231 description
232 "The NETCONF <lock> and <partial-lock> 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
244 grouping lock-info {
245 description
246 "Lock related parameters, common to both global and
247 partial locks.";
248
249 leaf locked-by-session {
250 type uint32;
251 mandatory true;
252 description
253 "The session ID of the session that has locked
254 this resource. Both a global lock and a partial
255 lock MUST contain the NETCONF session-id.
256
257 If the lock is held by a session that is not managed
258 by the NETCONF server (e.g., a CLI session), a session
259 id of 0 (zero) is reported.";
260 reference
261 "RFC 4741: NETCONF Configuration Protocol";
262 }
263 leaf locked-time {
264 type yang:date-and-time;
265 mandatory true;
266 description
267 "The date and time of when the resource was
268 locked.";
269 }
270 }
271
272 choice lock-type {
273 description
274 "Indicates if a global lock or a set of partial locks
275 are set.";
276
277 container global-lock {
278 description
279 "Present if the global lock is set.";
280 uses lock-info;
281 }
282
283 list partial-lock {
284 key lock-id;
285 description
286 "List of partial locks.";
287 reference
288 "RFC 5717: Partial Lock Remote Procedure Call (RPC) for
289 NETCONF";
290
291 leaf lock-id {
292 type uint32;
293 description
294 "This is the lock id returned in the <partial-lock>
295 response.";
296 }
297 uses lock-info;
298 leaf-list select {
299 type yang:xpath1.0;
300 min-elements 1;
301 description
302 "The xpath expression that was used to request
303 the lock. The select expression indicates the
304 original intended scope of the lock.";
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
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 For YANG data models, 'yang' format MUST be supported and
367 'yin' format MAY also be provided.";
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 leaf-list location {
381 type union {
382 type enumeration {
383 enum "NETCONF";
384 }
385 type inet:uri;
386 }
387 description
388 "One or more locations from which the schema can be
389 retrieved. This list SHOULD contain at least one
390 entry per schema.
391
392 A schema entry may be located on a remote file system
393 (e.g., reference to file system for ftp retrieval) or
394 retrieved directly from a server supporting the
395 <get-schema> operation (denoted by the value 'NETCONF').";
396 }
397 }
398 }
399
400 container sessions {
401 description
402 "The sessions container includes session-specific data for
403 NETCONF management sessions. The session list MUST include
404 all currently active NETCONF sessions.";
405
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
412 leaf session-id {
413 type uint32 {
414 range "1..max";
415 }
416 description
417 "Unique identifier for the session. This value is the
418 NETCONF session identifier, as defined in RFC 4741.";
419 reference
420 "RFC 4741: NETCONF Configuration Protocol";
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 leaf username {
432 type string;
433 mandatory true;
434 description
435 "The username is the client identity that was authenticated
436 by the NETCONF transport protocol. The algorithm used to
437 derive the username is NETCONF transport protocol specific
438 and in addition specific to the authentication mechanism
439 used by the NETCONF transport protocol.";
440 }
441 leaf source-host {
442 type inet:host;
443 description
444 "Host identifier of the NETCONF client. The value
445 returned is implementation specific (e.g., hostname,
446 IPv4 address, IPv6 address)";
447 }
448 leaf login-time {
449 type yang:date-and-time;
450 mandatory true;
451 description
452 "Time at the server at which the session was established.";
453 }
454 uses common-counters {
455 description
456 "Per-session counters. Zero based with following reset
457 behaviour:
458 - at start of a session
459 - when max value is reached";
460 }
461 }
462 }
463
464 container statistics {
465 description
466 "Statistical data pertaining to the NETCONF server.";
467
468 leaf netconf-start-time {
469 type yang:date-and-time;
470 description
471 "Date and time at which the management subsystem was
472 started.";
473 }
474 leaf in-bad-hellos {
475 type yang:zero-based-counter32;
476 description
477 "Number of sessions silently dropped because an
478 invalid <hello> message was received. This includes <hello>
479 messages with a 'session-id' attribute, bad namespace, and
480 bad capability declarations.";
481 }
482 leaf in-sessions {
483 type yang:zero-based-counter32;
484 description
485 "Number of sessions started. This counter is incremented
486 when a <hello> message with a <session-id> is sent.
487
488 'in-sessions' - 'in-bad-hellos' =
489 'number of correctly started netconf sessions'";
490 }
491 leaf dropped-sessions {
492 type yang:zero-based-counter32;
493 description
494 "Number of sessions that were abnormally terminated, e.g.,
495 due to idle timeout or transport close. This counter is not
496 incremented when a session is properly closed by a
497 <close-session> operation, or killed by a <kill-session>
498 operation.";
499 }
500 uses common-counters {
501 description
502 "Global counters, accumulated from all sessions.
503 Zero based with following reset behaviour:
504 - re-initialization of NETCONF server
505 - when max value is reached";
506 }
507 }
508 }
509
510 rpc get-schema {
511 description
512 "This operation is used to retrieve a schema from the
513 NETCONF server.
514
515 Positive Response:
516 The NETCONF server returns the requested schema.
517
518 Negative Response:
519 If requested schema does not exist, the <error-tag> is
520 'invalid-value'.
521
522 If more than one schema matches the requested parameters, the
523 <error-tag> is 'operation-failed', and <error-app-tag> is
524 'data-not-unique'.";
525
526 input {
527 leaf identifier {
528 type string;
529 mandatory true;
530 description
531 "Identifier for the schema list entry.";
532 }
533 leaf version {
534 type string;
535 description
536 "Version of the schema requested. If this parameter is not
537 present, and more than one version of the schema exists on
538 the server, a 'data-not-unique' error is returned, as
539 described above.";
540 }
541 leaf format {
542 type identityref {
543 base schema-format;
544 }
545 description
546 "The data modeling language of the schema. If this
547 parameter is not present, and more than one formats of
548 the schema exists on the server, a 'data-not-unique' error
549 is returned, as described above.";
550 }
551 }
552 output {
553 anyxml data {
554 description
555 "Contains the schema content.";
556 }
557 }
558 }
559}