module ietf-netconf-state {
namespace "urn:ietf:params:xml:ns:netconf:state";
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.
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 2009-06-16 {
description
"Initial revision, published as RFC XXXX.";
// 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 {
description
"NETCONF Session Id";
type uint32 {
range "1..max";
}
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 session types.";
}
identity netconf-ssh {
base transport;
reference "RFC 4742";
}
identity netconf-soap-over-beep {
base transport;
reference "RFC 4743";
}
identity netconf-soap-over-https {
base transport;
reference "RFC 4743";
}
identity netconf-beep {
base transport;
reference "RFC 4744";
}
identity netconf-tls {
base transport;
reference "RFC 5539";
}
identity schema-format {
description
"Base identity for data model schema languages.";
}
identity xsd {
base schema-format;
reference "W3C REC REC-xmlschema-1-20041028";
}
identity rng {
base schema-format;
reference "ISO/IEC 19757-2";
}
identity yang {
base schema-format;
reference "RFC XXXX: YANG - A data modeling language for NETCONF";
}
identity yin {
base schema-format;
reference "RFC XXXX: YANG - A data modeling language for NETCONF";
}
identity rnc {
base schema-format;
reference "ISO/IEC 19757-2";
}
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 requests 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;
container capabilities {
description
"The list of currently provided NETCONF capabilities
exchanged during session setup (i.e. hello).";
leaf-list capability {
type inet:uri;
}
}
container datastores {
description
"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
"An indication of whether a resource is locked or
unlocked. If locked, additional information about
the locking such as user an time stamp is provided.";
grouping lock-info {
leaf locked-by-session {
type session-id;
description
"The session ID of the session that has locked
this resource.";
}
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
"For a partial lock this is the lock id returned
in the response.";
leaf lock-id {
type uint32;
}
uses lock-info;
leaf-list select {
type string;
min-elements 1;
description
"The xpath expression which was used to request
the lock.";
}
leaf-list locked-nodes {
type instance-identifier;
description
"The list of instance-identifiers (i.e. the
locked nodes).";
}
}
}
}
}
}
container schemas {
list schema {
key "identifier version format";
leaf identifier {
type string;
description
"Identifier to uniquely reference the schema";
}
leaf version {
type string;
description
"Version of the schema supported. Multiple versions can be
supported simultaneously.";
}
leaf format {
type identityref {
base schema-format;
}
description
"Schema language for the file/module.";
}
leaf namespace {
type inet:uri;
description
"The XML namespace defined by the data model.";
}
leaf-list location {
type union {
type enumeration {
enum "NETCONF";
}
type inet:uri;
}
description
"One or more locations from which the schema can be
retrieved. Can be either on the network device
retrievable explicitly via the NETCONF
operation (denoted by the value 'NETCONF') or some
network location (i.e. URL).";
}
}
}
container sessions {
description
"List of management sessions currently active on this device.";
list session {
key session-id;
leaf session-id {
type session-id;
}
leaf transport {
mandatory true;
type identityref {
base transport;
}
}
leaf username {
type string;
}
leaf source-host {
type inet:host;
}
leaf login-time {
mandatory true;
type yang:date-and-time;
description
"Time at which the session was established.";
}
uses common-counters {
description
"Per-session counters.";
}
}
}
container statistics {
leaf netconf-start-time {
type yang:date-and-time;
description
"Date and time at which the NETCONF server process was
started. Allows for calculation of time interval for
reported metrics.";
}
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.";
}
}
}
rpc get-schema {
description
"When the schema is available on the device this operation is
used to return it via NETCONF. If requested schema does not
exist, the is 'invalid-value'. If requested schema
is not unique, the is 'operation-failed' and the
is 'data-not-unique'.";
input {
leaf identifier {
type string;
mandatory true;
}
leaf version {
type string;
}
leaf format {
type identityref {
base schema-format;
}
}
}
output {
anyxml data {
description "Contains the schema content.";
}
}
}
}