Michal Vasko | 8a4e146 | 2020-05-07 11:32:31 +0200 | [diff] [blame] | 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 | |
| 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 | reference |
| 84 | "RFC 4743: Using NETCONF over the Simple Object |
| 85 | Access Protocol (SOAP)"; |
| 86 | } |
| 87 | |
| 88 | identity netconf-soap-over-https { |
| 89 | base transport; |
| 90 | description |
| 91 | "NETCONF over Simple Object Access Protocol (SOAP) |
| 92 | over Hypertext Transfer Protocol Secure (HTTPS)."; |
| 93 | reference |
| 94 | "RFC 4743: Using NETCONF over the Simple Object |
| 95 | Access Protocol (SOAP)"; |
| 96 | } |
| 97 | |
| 98 | identity netconf-beep { |
| 99 | base transport; |
| 100 | description |
| 101 | "NETCONF over Blocks Extensible Exchange Protocol (BEEP)."; |
| 102 | reference |
| 103 | "RFC 4744: Using the NETCONF Protocol over the |
| 104 | Blocks Extensible Exchange Protocol (BEEP)"; |
| 105 | } |
| 106 | |
| 107 | identity netconf-tls { |
| 108 | base transport; |
| 109 | description |
| 110 | "NETCONF over Transport Layer Security (TLS)."; |
| 111 | reference |
| 112 | "RFC 5539: NETCONF over Transport Layer Security (TLS)"; |
| 113 | } |
| 114 | |
| 115 | identity schema-format { |
| 116 | description |
| 117 | "Base identity for data model schema languages."; |
| 118 | } |
| 119 | |
| 120 | identity xsd { |
| 121 | base schema-format; |
| 122 | description |
| 123 | "W3C XML Schema Definition."; |
| 124 | reference |
| 125 | "W3C REC REC-xmlschema-1-20041028: |
| 126 | XML Schema Part 1: Structures"; |
| 127 | } |
| 128 | |
| 129 | identity yang { |
| 130 | base schema-format; |
| 131 | description |
| 132 | "The YANG data modeling language for NETCONF."; |
| 133 | reference |
| 134 | "RFC 6020: YANG - A Data Modeling Language for the |
| 135 | Network Configuration Protocol (NETCONF)"; |
| 136 | } |
| 137 | |
| 138 | identity yin { |
| 139 | base schema-format; |
| 140 | description |
| 141 | "The YIN syntax for YANG."; |
| 142 | reference |
| 143 | "RFC 6020: YANG - A Data Modeling Language for the |
| 144 | Network Configuration Protocol (NETCONF)"; |
| 145 | } |
| 146 | |
| 147 | identity rng { |
| 148 | base schema-format; |
| 149 | description |
| 150 | "Regular Language for XML Next Generation (RELAX NG)."; |
| 151 | reference |
| 152 | "ISO/IEC 19757-2:2008: RELAX NG"; |
| 153 | } |
| 154 | |
| 155 | identity rnc { |
| 156 | base schema-format; |
| 157 | description |
| 158 | "Relax NG Compact Syntax"; |
| 159 | reference |
| 160 | "ISO/IEC 19757-2:2008: RELAX NG"; |
| 161 | } |
| 162 | |
| 163 | grouping common-counters { |
| 164 | description |
| 165 | "Counters that exist both per session, and also globally, |
| 166 | accumulated from all sessions."; |
| 167 | |
| 168 | leaf in-rpcs { |
| 169 | type yang:zero-based-counter32; |
| 170 | description |
| 171 | "Number of correct <rpc> messages received."; |
| 172 | } |
| 173 | leaf in-bad-rpcs { |
| 174 | type yang:zero-based-counter32; |
| 175 | description |
| 176 | "Number of messages received when an <rpc> message was expected, |
| 177 | that were not correct <rpc> messages. This includes XML parse |
| 178 | errors and errors on the rpc layer."; |
| 179 | } |
| 180 | leaf out-rpc-errors { |
| 181 | type yang:zero-based-counter32; |
| 182 | description |
| 183 | "Number of <rpc-reply> messages sent that contained an |
| 184 | <rpc-error> element."; |
| 185 | } |
| 186 | leaf out-notifications { |
| 187 | type yang:zero-based-counter32; |
| 188 | description |
| 189 | "Number of <notification> messages sent."; |
| 190 | } |
| 191 | } |
| 192 | |
| 193 | container netconf-state { |
| 194 | config false; |
| 195 | description |
| 196 | "The netconf-state container is the root of the monitoring |
| 197 | data model."; |
| 198 | |
| 199 | container capabilities { |
| 200 | description |
| 201 | "Contains the list of NETCONF capabilities supported by the |
| 202 | server."; |
| 203 | |
| 204 | leaf-list capability { |
| 205 | type inet:uri; |
| 206 | description |
| 207 | "List of NETCONF capabilities supported by the server."; |
| 208 | } |
| 209 | } |
| 210 | |
| 211 | container datastores { |
| 212 | description |
| 213 | "Contains the list of NETCONF configuration datastores."; |
| 214 | |
| 215 | list datastore { |
| 216 | key name; |
| 217 | description |
| 218 | "List of NETCONF configuration datastores supported by |
| 219 | the NETCONF server and related information."; |
| 220 | |
| 221 | leaf name { |
| 222 | type netconf-datastore-type; |
| 223 | description |
| 224 | "Name of the datastore associated with this list entry."; |
| 225 | } |
| 226 | container locks { |
| 227 | presence |
| 228 | "This container is present only if the datastore |
| 229 | is locked."; |
| 230 | description |
| 231 | "The NETCONF <lock> and <partial-lock> operations allow |
| 232 | a client to lock specific resources in a datastore. The |
| 233 | NETCONF server will prevent changes to the locked |
| 234 | resources by all sessions except the one that acquired |
| 235 | the lock(s). |
| 236 | |
| 237 | Monitoring information is provided for each datastore |
| 238 | entry including details such as the session that acquired |
| 239 | the lock, the type of lock (global or partial) and the |
| 240 | list of locked resources. Multiple locks per datastore |
| 241 | are supported."; |
| 242 | |
| 243 | grouping lock-info { |
| 244 | description |
| 245 | "Lock related parameters, common to both global and |
| 246 | partial locks."; |
| 247 | |
| 248 | leaf locked-by-session { |
| 249 | type uint32; |
| 250 | mandatory true; |
| 251 | description |
| 252 | "The session ID of the session that has locked |
| 253 | this resource. Both a global lock and a partial |
| 254 | lock MUST contain the NETCONF session-id. |
| 255 | |
| 256 | If the lock is held by a session that is not managed |
| 257 | by the NETCONF server (e.g., a CLI session), a session |
| 258 | id of 0 (zero) is reported."; |
| 259 | reference |
| 260 | "RFC 4741: NETCONF Configuration Protocol"; |
| 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 | |
| 276 | container global-lock { |
| 277 | description |
| 278 | "Present if the global lock is set."; |
| 279 | uses lock-info; |
| 280 | } |
| 281 | |
| 282 | list partial-lock { |
| 283 | key lock-id; |
| 284 | description |
| 285 | "List of partial locks."; |
| 286 | reference |
| 287 | "RFC 5717: Partial Lock Remote Procedure Call (RPC) for |
| 288 | NETCONF"; |
| 289 | |
| 290 | leaf lock-id { |
| 291 | type uint32; |
| 292 | description |
| 293 | "This is the lock id returned in the <partial-lock> |
| 294 | response."; |
| 295 | } |
| 296 | uses lock-info; |
| 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 | leaf-list locked-node { |
| 306 | type instance-identifier; |
| 307 | description |
| 308 | "The list of instance-identifiers (i.e., the |
| 309 | locked nodes). |
| 310 | |
| 311 | The scope of the partial lock is defined by the list |
| 312 | of locked nodes."; |
| 313 | } |
| 314 | } |
| 315 | } |
| 316 | } |
| 317 | } |
| 318 | } |
| 319 | |
| 320 | container schemas { |
| 321 | description |
| 322 | "Contains the list of data model schemas supported by the |
| 323 | server."; |
| 324 | |
| 325 | list schema { |
| 326 | key "identifier version format"; |
| 327 | |
| 328 | description |
| 329 | "List of data model schemas supported by the server."; |
| 330 | |
| 331 | leaf identifier { |
| 332 | type string; |
| 333 | description |
| 334 | "Identifier to uniquely reference the schema. The |
| 335 | identifier is used in the <get-schema> operation and may |
| 336 | be used for other purposes such as file retrieval. |
| 337 | |
| 338 | For modeling languages that support or require a data |
| 339 | model name (e.g., YANG module name) the identifier MUST |
| 340 | match that name. For YANG data models, the identifier is |
| 341 | the name of the module or submodule. In other cases, an |
| 342 | identifier such as a filename MAY be used instead."; |
| 343 | } |
| 344 | leaf version { |
| 345 | type string; |
| 346 | description |
| 347 | "Version of the schema supported. Multiple versions MAY be |
| 348 | supported simultaneously by a NETCONF server. Each |
| 349 | version MUST be reported individually in the schema list, |
| 350 | i.e., with same identifier, possibly different location, |
| 351 | but different version. |
| 352 | |
| 353 | For YANG data models, version is the value of the most |
| 354 | recent YANG 'revision' statement in the module or |
| 355 | submodule, or the empty string if no 'revision' statement |
| 356 | is present."; |
| 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 | leaf namespace { |
| 369 | type inet:uri; |
| 370 | mandatory true; |
| 371 | description |
| 372 | "The XML namespace defined by the data model. |
| 373 | |
| 374 | For YANG data models, this is the module's namespace. |
| 375 | If the list entry describes a submodule, this field |
| 376 | contains the namespace of the module to which the |
| 377 | submodule belongs."; |
| 378 | } |
| 379 | leaf-list location { |
| 380 | type union { |
| 381 | type enumeration { |
| 382 | enum "NETCONF"; |
| 383 | } |
| 384 | type inet:uri; |
| 385 | } |
| 386 | description |
| 387 | "One or more locations from which the schema can be |
| 388 | retrieved. This list SHOULD contain at least one |
| 389 | entry per schema. |
| 390 | |
| 391 | A schema entry may be located on a remote file system |
| 392 | (e.g., reference to file system for ftp retrieval) or |
| 393 | retrieved directly from a server supporting the |
| 394 | <get-schema> operation (denoted by the value 'NETCONF')."; |
| 395 | } |
| 396 | } |
| 397 | } |
| 398 | |
| 399 | container sessions { |
| 400 | description |
| 401 | "The sessions container includes session-specific data for |
| 402 | NETCONF management sessions. The session list MUST include |
| 403 | all currently active NETCONF sessions."; |
| 404 | |
| 405 | list session { |
| 406 | key session-id; |
| 407 | description |
| 408 | "All NETCONF sessions managed by the NETCONF server |
| 409 | MUST be reported in this list."; |
| 410 | |
| 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 | leaf transport { |
| 422 | type identityref { |
| 423 | base transport; |
| 424 | } |
| 425 | mandatory true; |
| 426 | description |
| 427 | "Identifies the transport for each session, e.g., |
| 428 | 'netconf-ssh', 'netconf-soap', etc."; |
| 429 | } |
| 430 | leaf username { |
| 431 | type string; |
| 432 | mandatory true; |
| 433 | description |
| 434 | "The username is the client identity that was authenticated |
| 435 | by the NETCONF transport protocol. The algorithm used to |
| 436 | derive the username is NETCONF transport protocol specific |
| 437 | and in addition specific to the authentication mechanism |
| 438 | used by the NETCONF transport protocol."; |
| 439 | } |
| 440 | leaf source-host { |
| 441 | type inet:host; |
| 442 | description |
| 443 | "Host identifier of the NETCONF client. The value |
| 444 | returned is implementation specific (e.g., hostname, |
| 445 | IPv4 address, IPv6 address)"; |
| 446 | } |
| 447 | leaf login-time { |
| 448 | type yang:date-and-time; |
| 449 | mandatory true; |
| 450 | description |
| 451 | "Time at the server at which the session was established."; |
| 452 | } |
| 453 | uses common-counters { |
| 454 | description |
| 455 | "Per-session counters. Zero based with following reset |
| 456 | behaviour: |
| 457 | - at start of a session |
| 458 | - when max value is reached"; |
| 459 | } |
| 460 | } |
| 461 | } |
| 462 | |
| 463 | container statistics { |
| 464 | description |
| 465 | "Statistical data pertaining to the NETCONF server."; |
| 466 | |
| 467 | leaf netconf-start-time { |
| 468 | type yang:date-and-time; |
| 469 | description |
| 470 | "Date and time at which the management subsystem was |
| 471 | started."; |
| 472 | } |
| 473 | leaf in-bad-hellos { |
| 474 | type yang:zero-based-counter32; |
| 475 | description |
| 476 | "Number of sessions silently dropped because an |
| 477 | invalid <hello> message was received. This includes <hello> |
| 478 | messages with a 'session-id' attribute, bad namespace, and |
| 479 | bad capability declarations."; |
| 480 | } |
| 481 | leaf in-sessions { |
| 482 | type yang:zero-based-counter32; |
| 483 | description |
| 484 | "Number of sessions started. This counter is incremented |
| 485 | when a <hello> message with a <session-id> is sent. |
| 486 | |
| 487 | 'in-sessions' - 'in-bad-hellos' = |
| 488 | 'number of correctly started netconf sessions'"; |
| 489 | } |
| 490 | leaf dropped-sessions { |
| 491 | type yang:zero-based-counter32; |
| 492 | description |
| 493 | "Number of sessions that were abnormally terminated, e.g., |
| 494 | due to idle timeout or transport close. This counter is not |
| 495 | incremented when a session is properly closed by a |
| 496 | <close-session> operation, or killed by a <kill-session> |
| 497 | operation."; |
| 498 | } |
| 499 | uses common-counters { |
| 500 | description |
| 501 | "Global counters, accumulated from all sessions. |
| 502 | Zero based with following reset behaviour: |
| 503 | - re-initialization of NETCONF server |
| 504 | - when max value is reached"; |
| 505 | } |
| 506 | } |
| 507 | } |
| 508 | |
| 509 | rpc get-schema { |
| 510 | description |
| 511 | "This operation is used to retrieve a schema from the |
| 512 | NETCONF server. |
| 513 | |
| 514 | Positive Response: |
| 515 | The NETCONF server returns the requested schema. |
| 516 | |
| 517 | Negative Response: |
| 518 | If requested schema does not exist, the <error-tag> is |
| 519 | 'invalid-value'. |
| 520 | |
| 521 | If more than one schema matches the requested parameters, the |
| 522 | <error-tag> is 'operation-failed', and <error-app-tag> is |
| 523 | 'data-not-unique'."; |
| 524 | |
| 525 | input { |
| 526 | leaf identifier { |
| 527 | type string; |
| 528 | mandatory true; |
| 529 | description |
| 530 | "Identifier for the schema list entry."; |
| 531 | } |
| 532 | leaf version { |
| 533 | type string; |
| 534 | description |
| 535 | "Version of the schema requested. If this parameter is not |
| 536 | present, and more than one version of the schema exists on |
| 537 | the server, a 'data-not-unique' error is returned, as |
| 538 | described above."; |
| 539 | } |
| 540 | leaf format { |
| 541 | type identityref { |
| 542 | base schema-format; |
| 543 | } |
| 544 | description |
| 545 | "The data modeling language of the schema. If this |
| 546 | parameter is not present, and more than one formats of |
| 547 | the schema exists on the server, a 'data-not-unique' error |
| 548 | is returned, as described above."; |
| 549 | } |
| 550 | } |
| 551 | output { |
| 552 | anyxml data { |
| 553 | description |
| 554 | "Contains the schema content."; |
| 555 | } |
| 556 | } |
| 557 | } |
| 558 | } |