module ietf-netconf-monitoring {
namespace
"urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring:DRAFT-12";
prefix "ns";
import ietf-yang-types { prefix yang; }
import ietf-inet-types { prefix inet; }
organization
"IETF NETCONF (Network Configuration) Working Group";
contact
"WG Web:
WG List:
WG Chair: Mehmet Ersue
WG Chair: Bert Wijnen
Editor: Mark Scott
";
description
"NETCONF Monitoring Module.
All elements in this module are read-only.
Copyright (c) 2009 IETF Trust and the persons identified as
the document authors. All rights reserved.
Redistribution and use in source and binary forms, with or
without modification, is permitted pursuant to, and subject
to the license terms contained in, the Simplified BSD License
set forth in Section 4.c of the IETF Trust's Legal Provisions
Relating to IETF Documents
(http://trustee.ietf.org/license-info).
This version of this YANG module is part of RFC XXXX; see
the RFC itself for full legal notices.";
// RFC Ed.: replace XXXX with actual RFC number and remove this note
revision 2010-02-18 {
description
"Initial revision.";
reference
"RFC XXXX: YANG Module for NETCONF Monitoring";
// RFC Ed.: replace XXXX with actual RFC number and remove this note
}
// 'session-id-type' from 'ietf-netconf' module
// can be replaced with import when 4741bis is published
typedef session-id {
type uint32 {
range "1..max";
}
description
"NETCONF Session Id.";
reference
"RFC 4741: NETCONF Configuration Protocol";
}
// to be added to base protocol 'ietf-netconf' module
// and imported when 4741bis is published
grouping netconf-datastore-type {
description
"Enumeration of possible NETCONF datastore types.";
reference
"RFC 4741: NETCONF Configuration Protocol";
choice datastore {
mandatory true;
leaf running {
type empty;
}
leaf candidate {
type empty;
}
leaf startup {
type empty;
}
}
}
identity transport {
description
"Base identity for NETCONF transport types.";
}
identity netconf-ssh {
base transport;
description
"NETCONF over Secure Shell (SSH).";
reference
"RFC 4742: Using the NETCONF Configuration Protocol
over Secure SHell (SSH)";
}
identity netconf-soap-over-beep {
base transport;
description
"NETCONF Simple Object Access Protocol (SOAP) over
Blocks Extensible Exchange Protocol (BEEP).";
reference
"RFC 4743: Using NETCONF over the Simple Object
Access Protocol (SOAP)";
}
identity netconf-soap-over-https {
base transport;
description
"NETCONF Simple Object Access Protocol (SOAP)
over Hypertext Transfer Protocol Secure (HTTPS).";
reference
"RFC 4743: Using NETCONF over the Simple Object
Access Protocol (SOAP)";
}
identity netconf-beep {
base transport;
description
"NETCONF over Blocks Extensible Exchange Protocol (BEEP).";
reference
"RFC 4744: Using the NETCONF Protocol over the
Blocks Extensible Exchange Protocol (BEEP)";
}
identity netconf-tls {
base transport;
description
"NETCONF over Transport Layer Security (TLS).";
reference
"RFC 5539: NETCONF over Transport Layer Security (TLS)";
}
identity schema-format {
description
"Base identity for data model schema languages.";
}
identity xsd {
base schema-format;
description
"XML Schema Definition.";
reference
"W3C REC REC-xmlschema-1-20041028: XML Schema Part 1: Structure
W3C REC REC-xmlschema-2-20041028: XML Schema Part 2: Datatypes";
}
identity yang {
base schema-format;
description
"YANG is a data modeling language used to model configuration
and state data manipulated by the NETCONF protocol.";
reference
"RFC XXXX: YANG - A data modeling language for NETCONF";
// RFC Ed.: replace XXXX with actual RFC number and remove this note
}
identity yin {
base schema-format;
reference
"YIN is an alternative, equivalent XML syntax for YANG.";
reference
"RFC XXXX: YANG - A data modeling language for NETCONF";
// RFC Ed.: replace XXXX with actual RFC number and remove this note
}
identity rng {
base schema-format;
description
"Regular Language for XML Next Generation (RELAX NG).";
reference
"ISO/IEC 19757-2: RELAX NG";
}
identity rnc {
base schema-format;
description
"Relax NG Compact Syntax";
reference
"ISO/IEC 19757-2: RELAX NG";
}
grouping common-counters {
description
"Counters that exist both per session, and also globally,
accumulated from all sessions.";
leaf in-rpcs {
type yang:zero-based-counter32;
description
"Number of correct messages received.";
}
leaf in-bad-rpcs {
type yang:zero-based-counter32;
description
"Number of messages received when a message was expected,
that were not correct messages. This includes XML parse
errors and errors on the rpc layer.";
}
leaf out-rpc-errors {
type yang:zero-based-counter32;
description
"Number of messages sent which contained an
element.";
}
leaf out-notifications {
type yang:zero-based-counter32;
description
"Number of messages sent.";
}
}
container netconf-state {
config false;
description
"The netconf-state container is the root of the monitoring
data model.";
container capabilities {
description
"List of NETCONF capabilities supported by the server.";
leaf-list capability {
type inet:uri;
}
}
container datastores {
description
"The datastores container provides the list of NETCONF
configuration datastores (e.g. running, startup, candidate)
supported on this device and related information.";
list datastore {
container name {
uses netconf-datastore-type;
}
container locks {
description
"The NETCONF and operations allow
a client to lock specific resources in a datastore. The
NETCONF server will prevent changes to the locked
resources by all sessions except the one which acquired
the lock(s).
Monitoring information is provided for each datastore
entry including details such as the session which acquired
the lock, the type of lock (global or partial) and the
list of locked resources. Multiple locks per datastore
are supported.";
grouping lock-info {
leaf locked-by-session {
type session-id;
description
"The session ID of the session that has locked
this resource. Both a global lock and a partial
lock MUST contain the NETCONF session-id.";
}
leaf locked-time {
type yang:date-and-time;
description
"The date and time of when the resource was
locked.";
}
}
choice lock-type {
container global-lock {
description
"Present if the global lock is set.";
uses lock-info;
}
list partial-locks {
key lock-id;
description
"List of partial locks.";
reference
"RFC 5717: Partial Lock Remote Procedure Call (RPC) for
NETCONF";
leaf lock-id {
type uint32;
description
"For a partial lock this is the lock id returned
in the response.";
}
uses lock-info;
leaf-list select {
type string;
min-elements 1;
description
"The xpath expression which was used to request
the lock. The select expression indicates the
original intended scope of the lock.";
}
leaf-list locked-nodes {
type instance-identifier;
description
"The list of instance-identifiers (i.e. the
locked nodes).
The scope of the partial lock is defined by the list
of locked nodes.";
}
}
}
}
}
}
container schemas {
list schema {
key "identifier version format";
leaf identifier {
type string;
description
"Identifier to uniquely reference the schema. Identifier is
used in the operation and may be used for
other purposes such as file retrieval.
For modeling languages which support or require a data
model name (eg: YANG module name) the identifier MUST match
that name. For YANG data models, the identifier is the
name of the module or submodule. In other cases an
identifier such as a filename MAY be used instead.";
}
leaf version {
type string;
description
"Version of the schema supported. Multiple versions MAY be
supported simultaneously by a NETCONF server. Each version
MUST be reported individually in the schema list, i.e. with
same identifier, possibly different location, but different
version.
For YANG data models, version is the value of the most
recent YANG 'revision' statement in the module or
submodule, or the empty string if no revision statement
is present.";
}
leaf format {
type identityref {
base schema-format;
}
description
"The data modeling language the schema is written
in (currently xsd, yang, yin, rng or rnc).
For YANG data models, 'yang' format MUST be supported and
'yin' format MAY also be provided.";
}
leaf namespace {
type inet:uri;
description
"The XML namespace defined by the data model.
For YANG data models, this is the module's namespace.
If the list entry describes a submodule, this field
contains the namespace of the module to which the
submodule belongs.";
}
leaf-list location {
type union {
type enumeration {
enum "NETCONF";
}
type inet:uri;
}
description
"One or more locations from which the schema can be
retrieved. This list SHOULD contain at least one
entry per schema.
A schema entry may be located on a remote file system
(eg: reference to file system for ftp retrieval) or
retrieved directly from a server supporting the
operation (denoted by the value 'NETCONF').";
}
}
}
container sessions {
description
"The sessions container includes session specific data for
NETCONF management sessions. The session list MUST include
all currently active NETCONF sessions.";
list session {
key session-id;
description
"Unique identifier for the session. This value is the
NETCONF session identifier, as defined in [RFC4741].
All NETCONF sessions managed by the NETCONF server
SHOULD be reported in this table.
Any sessions not managed by the NETCONF server with
session identifier 0 MUST be excluded.";
leaf session-id {
type session-id;
}
leaf transport {
type identityref {
base transport;
}
mandatory true;
description
"Identifies the transport for each session, e.g.
'netconf-ssh', 'netconf-soap', etc.";
}
leaf username {
type string;
description
"If present, the username contains an identifier which can
be used to uniquely identify an individual client (human
or machine). This is likely to be implementation specific
and subject to the security requirements of the device
vendor and/or operators, e.g., an SSH user, a host RSA
fingerprint or other identifier deemed acceptable.";
}
leaf source-host {
type inet:host;
description
"Host identifier of the client. The value returned is
likely to be implementation specific (e.g. hostname,
IP v4 address, IP v6 address)";
}
leaf login-time {
type yang:date-and-time;
mandatory true;
description
"Time at which the session was established.";
}
uses common-counters {
description
"Per-session counters. Zero based with following reset
behaviour:
- at start of a session
- when max value is reached";
}
}
}
container statistics {
leaf netconf-start-time {
type yang:date-and-time;
description
"Date and time at which the management subsystem was
started.";
}
leaf in-bad-hellos {
type yang:zero-based-counter32;
description
"Number of sessions silently dropped because an
invalid message was received. This includes hello
messages with a 'session-id' attribute, bad namespace, and
bad capability declarations.";
}
leaf in-sessions {
type yang:zero-based-counter32;
description
"Number of sessions started. This counter is incremented
when a message with a is sent.
'in-sessions' - 'in-bad-hellos' = 'number of correctly started
netconf sessions'";
}
leaf dropped-sessions {
type yang:zero-based-counter32;
description
"Number of sessions that were abnormally terminated, e.g. due
to idle timeout or transport close. This counter is not
incremented when a session is properly closed by a
operation, or killed by a
operation.";
}
uses common-counters {
description
"Global counters, accumulated from all sessions.
Zero based with following reset behaviour:
- re-initialization of NETCONF server
- when max value is reached";
}
}
}
rpc get-schema {
description
"This operation is used to retrieve a schema from the
NETCONF server.
Positive Response:
The NETCONF server returns the requested schema.
Negative Response:
If requested schema does not exist, the is
'invalid-value'.
If more than one schema matches the requested parameters, the
is 'operation-failed', and is
'data-not-unique'.";
input {
leaf identifier {
type string;
mandatory true;
description
"Identifier for the schema list entry.";
}
leaf version {
type string;
description
"Version of the schema requested. If this parameter is not
present, and more than one version of the schema exists on
the server, a 'data-not-unique' error is returned, as
described above.";
}
leaf format {
type identityref {
base schema-format;
}
description
"The data modeling language of the schema. If this parameter
is not present, and more than one formats of the schema
exists on the server, a 'data-not-unique' error is returned,
as described above.";
}
}
output {
anyxml data {
description
"Contains the schema content.";
}
}
}
}