netconfcentral logo

ietf-netconf-state@2009-06-16



  module ietf-netconf-state {

    yang-version 1;

    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:   <http://tools.ietf.org/wg/netconf/>
     WG List:  <mailto:netconf@ietf.org>

     WG Chair: Mehmet Ersue
               <mailto:mehmet.ersue@nsn.com>

     WG Chair: Bert Wijnen
               <mailto:bertietf@bwijnen.net>

     Editor:   Mark Scott
               <mailto:markscot@nortel.com>";

    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.";

    revision "2009-06-16" {
      description
        "Initial revision, published as RFC XXXX.";
    }


    typedef session-id {
      type uint32 {
        range "1..max";
      }
      description "NETCONF Session Id";
      reference
        "RFC 4741: NETCONF Configuration Protocol";

    }

    identity transport {
      base 
      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 {
      base 
      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";

    }

    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 capabilities

      container datastores {
        description
          "List of NETCONF configuration datastores (e.g. running,
         startup, candidate) supported on this device and related
         information.";
        list datastore {
          container name {
            choice datastore {
              mandatory true;
              leaf running {
                type empty;
              }
              leaf candidate {
                type empty;
              }
              leaf startup {
                type empty;
              }
            }  // choice datastore
          }  // container name

          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.";
            choice lock-type {
              container global-lock {
                description
                  "Present if the global lock is set.";
                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.";
                }
              }  // container global-lock
              list partial-locks {
                key "lock-id";
                description
                  "For a partial lock this is the lock id returned
                  in the <partial-lock> response.";
                leaf lock-id {
                  type uint32;
                }

                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.";
                }

                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).";
                }
              }  // list partial-locks
            }  // choice lock-type
          }  // container locks
        }  // list datastore
      }  // container datastores

      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" {
                  value 0;
                }
              }
              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 <get-schema> NETCONF
          operation (denoted by the value 'NETCONF') or some
          network location (i.e. URL).";
          }
        }  // list schema
      }  // container schemas

      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 {
            type identityref {
              base transport;
            }
            mandatory true;
          }

          leaf username {
            type string;
          }

          leaf source-host {
            type inet:host;
          }

          leaf login-time {
            type yang:date-and-time;
            mandatory true;
            description
              "Time at which the session was established.";
          }

          leaf in-rpcs {
            type yang:zero-based-counter32;
            description
              "Number of correct <rpc> requests received.";
          }

          leaf in-bad-rpcs {
            type yang:zero-based-counter32;
            description
              "Number of messages received when a <rpc> message was expected,
that were not correct <rpc> messages.  This includes XML parse
errors and errors on the rpc layer.";
          }

          leaf out-rpc-errors {
            type yang:zero-based-counter32;
            description
              "Number of <rpc-reply> messages sent which contained an
<rpc-error> element.";
          }

          leaf out-notifications {
            type yang:zero-based-counter32;
            description
              "Number of <notification> messages sent.";
          }
        }  // list session
      }  // container sessions

      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 <hello> 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 <hello> message with a <session-id> 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
           <close-session> operation, or killed by a <kill-session>
           operation.";
        }

        leaf in-rpcs {
          type yang:zero-based-counter32;
          description
            "Number of correct <rpc> requests received.";
        }

        leaf in-bad-rpcs {
          type yang:zero-based-counter32;
          description
            "Number of messages received when a <rpc> message was expected,
that were not correct <rpc> messages.  This includes XML parse
errors and errors on the rpc layer.";
        }

        leaf out-rpc-errors {
          type yang:zero-based-counter32;
          description
            "Number of <rpc-reply> messages sent which contained an
<rpc-error> element.";
        }

        leaf out-notifications {
          type yang:zero-based-counter32;
          description
            "Number of <notification> messages sent.";
        }
      }  // container statistics
    }  // container netconf-state

    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 <error-tag> is 'invalid-value'.  If requested schema
      is not unique, the <error-tag> is  'operation-failed' and the
      <error-app-tag> 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.";
        }
      }
    }  // rpc get-schema
  }  // module ietf-netconf-state