netconfcentral logo

yuma-system.yang



  module yuma-system {

    yang-version 1;

    namespace
      "http://netconfcentral.org/ns/yuma-system";

    prefix sys;

    import ietf-inet-types {
      prefix inet;
    }
    import ietf-yang-types {
      prefix yang;
    }
    import yuma-netconf {
      prefix nc;
    }
    import notifications {
      prefix notif;
    }
    import yuma-app-common {
      prefix yumaapp;
    }
    import yuma-types {
      prefix nt;
    }
    import yuma-ncx {
      prefix ncx;
    }
    import yuma-nacm {
      prefix nacm;
    }

    organization "Netconf Central";

    contact
      "Andy Bierman <andy@netconfcentral.org>.";

    description
      "NETCONF Basic System Group.";

    revision "2012-01-15" {
      description
        "Add sysNetconfServerCLI monitoring data.";
    }

    revision "2010-05-24" {
      description
        "Change SessionId to standard session-id-type.";
    }

    revision "2009-12-27" {
      description "Initial version.";
    }


    container system {
      config false;
      description
        "Basic objects for NETCONF system status.";
      leaf sysName {
        type string;
        description "The system name.";
        reference
          "RFC 3418, sysName object";

      }

      leaf sysCurrentDateTime {
        type yang:date-and-time;
        description
          "The current system date and time.";
      }

      leaf sysBootDateTime {
        type yang:date-and-time;
        description
          "The system date and time when the system 
               last restarted.";
      }

      leaf sysLogLevel {
        type nt:NcDebugType;
        description
          "The current system logging verbosity level.";
      }

      leaf sysNetconfServerId {
        type string;
        description
          "The name and version ID for the NETCONF server
               running on this system.";
      }

      anyxml sysNetconfServerCLI {
        nacm:very-secure;
        description
          "The boot-time CLI and configuration parameters that
               were used by the server running on this system.
               The format is the 'netconfd' container, defined in
               netconfd.yang.  By default, only client-set
               parameters are shown.  Use with-defaults=report-all
               to see all CLI parameter values in effect.";
      }

      container uname {
        description
          "Contains the broken out fields from the 
             output of the 'uname' command on this machine.";
        leaf sysname {
          type string;
          description
            "The name of the operating system in use.";
        }

        leaf release {
          type string;
          description
            "The current release level of the operating 
                system in use.";
        }

        leaf version {
          type string;
          description
            "The current version level of the operating 
                system in use.";
        }

        leaf machine {
          type string;
          description
            "A description of the hardware in use.";
        }

        leaf nodename {
          type string;
          description
            "The host name of this system, as reported by
               the uname command.";
        }
      }  // container uname
    }  // container system

    rpc set-log-level {
      nacm:secure;
      description
        "Sets the server log verbosity level";
      input {
        ncx:default-parm "log-level";
        leaf log-level {
          type nt:NcDebugType;
          mandatory true;
          description
            "The desired verbosity level for system logging
                  messages generated by the server.
                  The current value can be obtained by retrieving
                  the /system/sysLogLevel object.";
        }
      }
    }  // rpc set-log-level

    notification sysStartup {
      description
        "Generated when the system restarts.
           Used for logging purposes, since no
           sessions are actually active when
           the system restarts.";
      leaf startupSource {
        type string;
        description
          "The filespec used to load the running configuration.
              This leaf will only be present if there was a startup
              configuration file used.";
      }

      list bootError {
        description
          "There will be one entry for each <rpc-error>
              encountered during the load config operation.
              The <rpc-error> fields are used directly.
              There is no particular order, so no key is defined.";
        leaf error-type {
          type ErrorType;
          mandatory true;
          description
            "Defines the conceptual layer that the error occurred.";
        }

        leaf error-tag {
          type ErrorTag;
          mandatory true;
          description
            "Contains a string identifying the error condition.";
        }

        leaf error-severity {
          type ErrorSeverity;
          mandatory true;
          description
            "Contains a string identifying the error severity, as
determined by the device.";
        }

        leaf error-app-tag {
          type string;
          description
            "Contains a string identifying the data-model-specific
or implementation-specific error condition, if one exists.
This element will not be present if no appropriate
application error tag can be associated with a particular
error condition.";
        }

        leaf error-path {
          type yang:xpath1.0;
          description
            "Contains the absolute XPath [2] expression identifying
the element path to the node that is associated with the error
being reported in a particular rpc-error element.  This element
will not be present if no appropriate payload element can be
associated with a particular error condition, or if the
'bad-element' QString returned in the 'error-info' container is
sufficient to identify the node associated with the error.  When
the XPath expression is interpreted, the set of namespace
declarations are those in scope on the rpc-error element,
including the default namespace.";
        }

        leaf error-message {
          type LangString;
          description
            "Contains a string suitable for human display that
describes the error condition.  This element will not be present
if no appropriate message is provided for a particular error
condition.  This element SHOULD include an xml:lang attribute.";
        }

        anyxml error-info {
          description
            "Contains protocol- or data-model-specific error content.
This element will not be present if no such error content is
provided for a particular error condition.  The list in
RFC 4741, Appendix A, defines any mandatory error-info content
for each error.  After any protocol-mandated content, a
data model definition may mandate that certain application-layer
error information be included in the error-info container.
An implementation may include additional elements to
provide extended and/or implementation-specific debugging
information.";
        }
      }  // list bootError
    }  // notification sysStartup

    notification sysConfigChange {
      description
        "Generated when the <running> configuration is changed.";
      leaf userName {
        type string;
        description
          "Name of the user for the session.";
      }

      leaf sessionId {
        type nc:session-id-type;
        mandatory true;
        description
          "Identifier of the session.";
      }

      leaf remoteHost {
        type inet:ip-address;
        description
          "Address of the remote host for the session.";
      }

      list edit {
        description
          "An edit record will be present for each distinct
              edit operation on the running config.";
        leaf target {
          type instance-identifier;
          description
            "Topmost node associated with the configuration change.";
        }

        leaf operation {
          type nc:EditOperationType;
          description
            "Type of edit operation performed.";
        }
      }  // list edit
    }  // notification sysConfigChange

    notification sysCapabilityChange {
      description
        "Generated when a <capability> is added or deleted.";
      container changed-by {
        description
          "Indicates who caused this capability change.
             If caused by internal action, then the
             empty leaf 'server' will be present.
             If caused by a management session, then
             the name, remote host address, and session ID
             of the session that made the change will be reported.";
        choice server-or-user {
          leaf server {
            type empty;
            description
              "The capability change was caused by the server.";
          }

          case by-user {
            leaf userName {
              type string;
              description
                "Name of the user for the session.";
            }

            leaf sessionId {
              type nc:session-id-type;
              mandatory true;
              description
                "Identifier of the session.";
            }

            leaf remoteHost {
              type inet:ip-address;
              description
                "Address of the remote host for the session.";
            }
          }  // case by-user
        }  // choice server-or-user
      }  // container changed-by

      leaf-list added-capability {
        type inet:uri;
        description
          "List of capabilities that have been just added.";
      }

      leaf-list deleted-capability {
        type inet:uri;
        description
          "List of capabilities that have been just deleted.";
      }
    }  // notification sysCapabilityChange

    notification sysSessionStart {
      description
        "Generated when a new management session is started.";
      leaf userName {
        type string;
        description
          "Name of the user for the session.";
      }

      leaf sessionId {
        type nc:session-id-type;
        mandatory true;
        description
          "Identifier of the session.";
      }

      leaf remoteHost {
        type inet:ip-address;
        description
          "Address of the remote host for the session.";
      }
    }  // notification sysSessionStart

    notification sysSessionEnd {
      description
        "Generated when a management session is terminated.";
      leaf userName {
        type string;
        description
          "Name of the user for the session.";
      }

      leaf sessionId {
        type nc:session-id-type;
        mandatory true;
        description
          "Identifier of the session.";
      }

      leaf remoteHost {
        type inet:ip-address;
        description
          "Address of the remote host for the session.";
      }

      leaf killedBy {
        when
          "../terminationReason = 'killed'";
        type nc:session-id-type;
        description
          "Session ID that issued the <kill-session>,
              if the session was terminated by this operation.";
      }

      leaf terminationReason {
        type enumeration {
          enum "closed" {
            value 0;
            description
              "The session was terminated with 
                    the <close-session> operation.";
          }
          enum "killed" {
            value 1;
            description
              "The session was terminated with 
                    the <kill-session> operation.";
          }
          enum "dropped" {
            value 2;
            description
              "The session was terminated because
                    the SSH session or TCP connection was
                    unexpectedly closed.";
          }
          enum "timeout" {
            value 3;
            description
              "The session was terminated because
                    of inactivity, either waiting for
                    the <hello> or <rpc> PDUs.";
          }
          enum "bad-start" {
            value 4;
            description
              "The session startup sequence failed.";
          }
          enum "bad-hello" {
            value 5;
            description
              "The client's <hello> message was 
                    bad or never arrived.";
          }
          enum "other" {
            value 6;
            description
              "The session was terminated for
                    some other reason.";
          }
        }
        mandatory true;
        description
          "Reason the session was terminated.";
      }
    }  // notification sysSessionEnd

    notification sysConfirmedCommit {
      description
        "Generated when a confirmed-commit event occurs.";
      leaf userName {
        type string;
        description
          "Name of the user for the session.";
      }

      leaf sessionId {
        type nc:session-id-type;
        mandatory true;
        description
          "Identifier of the session.";
      }

      leaf remoteHost {
        type inet:ip-address;
        description
          "Address of the remote host for the session.";
      }

      leaf confirmEvent {
        type enumeration {
          enum "start" {
            value 0;
            description
              "The confirm-commit procedure has started.";
          }
          enum "cancel" {
            value 1;
            description
              "The confirm-commit procedure has been canceled,
                    due to the session being terminated.";
          }
          enum "timeout" {
            value 2;
            description
              "The confirm-commit procedure has been canceled,
                    due to the confirm-timeout interval expiring.
                    The common session parameters will not be present
                    in this sub-mode.";
          }
          enum "extend" {
            value 3;
            description
              "The confirm-commit timeout has been extended.";
          }
          enum "complete" {
            value 4;
            description
              "The confirm-commit procedure has been completed.";
          }
        }
        mandatory true;
        description
          "Indicates the event that caused the notification.";
      }
    }  // notification sysConfirmedCommit

    rpc load {
      nacm:secure;
      description
        "Load a module into the server, if it is not already loaded.
         Returns the module revision date (or today's date if none),
         of the module that was loaded, or an error if not found
         or the module found had errors and was not loaded
         successfully.  If the module is already loaded, then the
         revision date will simply be returned.";
      input {
        ncx:default-parm "module";
        leaf module {
          type nt:NcxName;
          mandatory true;
          description
            "Name of the module to load.";
        }

        leaf revision {
          type nt:Date;
          description
            "Module revision to load.";
        }

        leaf-list deviation {
          type yt:NcModuleSpec;
          description
            "YANG deviation file.

This parameter identifies a YANG module that
should only be checked for deviation statements
for external modules.  These will be collected
and applied to the real module(s) being processed.

Deviations are applied as patches to the target module.
Since they are not identified in the target module at
all (ala imports), they have to be specified
explicitly, so they will be correctly processed.

If this string represents a filespec,
ending with the '.yang' or '.yin' extension,
then only that file location will be checked.

If this string represents a module name, then
the module search path will be checked for
a file with the module name and the '.yang'
or '.yin' extension.

If this string begins with a '~' character,
then a username is expected to follow or
a directory separator character.  If it begins
with a '$' character, then an environment variable
name is expected to follow.

~/some/path ==> <my-home-dir>/some/path

~fred/some/path ==> <fred-home-dir>/some/path

$workdir/some/path ==> <workdir-env-var>/some/path
";
        }
      }

      output {
        leaf mod-revision {
          type nt:Date;
          description
            "Revision date of the module in use by the server.
             Will only be present if the module has a version";
        }
      }
    }  // rpc load

    rpc restart {
      nacm:secure;
      description
        "Restart the server. Does not reload the software image..";
    }  // rpc restart

    rpc shutdown {
      nacm:secure;
      description "Shutdown the server.";
    }  // rpc shutdown

    rpc no-op {
      description
        "Just returns 'ok'. Used for debugging
         or relative performance measurements.";
    }  // rpc no-op
  }  // module yuma-system