netconfcentral logo

yumaworks-app-common@2017-04-27



  module yumaworks-app-common {

    yang-version 1;

    namespace
      "http://yumaworks.com/ns/yumaworks-app-common";

    prefix ywapp;

    import yuma-ncx {
      prefix ncx;
    }
    import yumaworks-types {
      prefix ywt;
    }
    import yuma-types {
      prefix yt;
    }

    organization "YumaWorks, Inc.";

    contact
      "Support <support at yumaworks.com>";

    description
      "Common CLI parameters used in all yumapro applications.

     Copyright (c) 2012 - 2017 YumaWorks, Inc. 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 BSD 3-Clause License
     http://opensource.org/licenses/BSD-3-Clause";

    revision "2017-04-27" {
      description
        "Add OcPatternParm grouping";
    }

    revision "2016-04-11" {
      description
        "Add AnnotationParm grouping";
    }

    revision "2014-02-14" {
      description
        "Add UseSesssionVars CLI variable grouping.
          Add SaveSesssionVars CLI variable grouping.
          Add DataTemplateParms grouping.";
    }

    revision "2013-08-13" {
      description
        "Split log-vendor and log-vendor-level parameters into
          their own grouping.";
    }

    revision "2013-05-25" {
      description
        "Add log-console param as user friendly synonym
          for log-mirroring.";
    }

    revision "2013-02-11" {
      description
        "Move common yangcli-pro grouping to this module";
    }

    revision "2012-11-30" {
      description
        "Add message-indent parameter.";
    }

    revision "2012-10-23" {
      description
        'Remove log-custom and log-localtime empty leafs and convert
          to "bits" entity: log-header="custom localtime".';
    }

    revision "2012-10-10" {
      description
        "Change log-backtrace-level to and add log-backtrace-stream
          parameters as 'bits' type entities. Eliminate
          log-backtrace-xxx 'type empty' leafs.";
    }

    revision "2012-08-16" {
      description
        "Split from yuma-app-common; Add new logging parameters.";
    }


    grouping LoggingCommonParms {
      leaf log-backtrace {
        type uint32 {
          range "0 .. 100";
        }
        description
          "If present, log output will include traceback
	     detail for each log message, subject to further
             filtering by --log-backtrace-level and/or
             log-backtrace-stream qualifiers";
      }

      leaf log-backtrace-detail {
        type empty;
        description
          "If present in conjunction with --log-backtrace
              log messages will include 'detailed' backtrace
              information (if supported by the compiler).";
      }

      leaf log-backtrace-level {
        type bits {
          bit write {
            position 0;
            description
              "Include backtrace info in write messages.";
          }
          bit dev0 {
            position 1;
            description
              "Include backtrace info in developer
                           level 0 messages.";
          }
          bit error {
            position 2;
            description
              "Include backtrace info in error messages.";
          }
          bit warn {
            position 3;
            description
              "Include backtrace info in warning messages.";
          }
          bit info {
            position 4;
            description
              "Include backtrace info in info messages.";
          }
          bit dev1 {
            position 5;
            description
              "Include backtrace info in developer
                           level 1 messages.";
          }
          bit debug {
            position 6;
            description
              "Include backtrace info in debug messages.";
          }
          bit debug2 {
            position 7;
            description
              "Include backtrace info in debug2 messages.";
          }
          bit debug3 {
            position 8;
            description
              "Include backtrace info in debug3 messages.";
          }
          bit debug4 {
            position 9;
            description
              "Include backtrace info in debug4 messages.";
          }
        }
        description
          'Indicates for which debug level(s) backtrace
             info will be generated. Param string is an XSD
             list: a double quoted series of whitespace
             separated (level) strings like "error warn debug"';
      }

      leaf log-backtrace-stream {
        type bits {
          bit logfile {
            position 0;
            description
              "Include backtrace in logfile stream.";
          }
          bit stderr {
            position 1;
            description
              "Include backtrace in stderr stream.";
          }
          bit stdout {
            position 2;
            description
              "Include backtrace in stdout stream.";
          }
          bit syslog {
            position 3;
            description
              "Include backtrace in syslog stream.";
          }
          bit vendor {
            position 4;
            description
              "Include backtrace in vendor stream.";
          }
        }
        description
          'Indicates in which log stream(s) backtrace info
             will be included. Param string is an XSD list:
             a double quoted series of whitespace separated
             (log stream) strings like "logfile syslog"';
      }

      leaf log-header {
        type bits {
          bit custom {
            position 0;
            description
              "Include date, time, and level.";
          }
          bit localtime {
            position 1;
            description
              "Include localtime instead of Yang canonical format.";
          }
        }
        description
          'Indicates what header elements to include in
             header output. Param string is an XSD list:
             a double quoted series of whitespace separated
             (element) strings like "custom localtime"';
      }

      leaf log-mirroring {
        type empty;
        description
          "If present in conjunction with --log, --log-syslog,
              and/or --log-vendor, log output will be directed to
              the normal stdout/stderr/logfile as well as
              to the syslog or vendor log stream";
      }

      leaf log-console {
        type empty;
        description
          "User friendly synonym for --log-mirroring.";
      }

      leaf log-stderr {
        type empty;
        description
          "If present, error level output be directed to stderr
              instead of stdout (as well as log file, if specified)";
      }

      leaf log-syslog {
        type empty;
        description
          "If present, log output will be directed to the
              standard syslog interface. Yuma log priorities
              will be translated into the appropriate syslog
              equivalents.";
      }

      leaf log-syslog-level {
        type yt:NcDebugType;
        description
          "Sets the syslog debug logging level filter for output to
             the syslog file for the program.";
      }
    }  // grouping LoggingCommonParms

    grouping LoggingVendorParms {
      leaf log-vendor {
        type empty;
        description
          "If present, log messages will be directed to a
              customer-written and registered callback function.
              This functionality is defined by an API specified in
              the YumaWorks API Reference Manual. In the absence of
              a registered callback, this parameter will direct
              logging messages to syslog in order to facilitate
              standalone testing.";
      }

      leaf log-vendor-level {
        type yt:NcDebugType;
        description
          "Sets the vendor debug logging level filter for output to
             the vendor-specific log output file stream for the program.";
      }
    }  // grouping LoggingVendorParms

    grouping MessageIndentParm {
      leaf message-indent {
        type int8 {
          range "-1 .. 9";
        }
        default '-1';
        description
          "The number of spaces to indent for each level of
              output in a protocol message, e.g. NETCONF request.
              The value zero means no indent, just line feeds.
              The value -1 means no indent and no line feeds either.";
      }
    }  // grouping MessageIndentParm

    grouping YumaproHomeParm {
      leaf yumapro-home {
        type string;
        description
          "Directory for the yumapro project root to use.
              If present, this directory location will
              override the 'YUMAPRO_HOME' environment variable,
              if it is present.  If a zero-length string is
              entered, then the YUMAPRO_HOME environment variable
              will be ignored.";
      }
    }  // grouping YumaproHomeParm

    grouping MatchParms {
      leaf match-names {
        type ywt:NameMatchMode;
        description
          "Match mode to use for UrlPath name searches.";
      }

      leaf alt-names {
        type ywt:AltNameMode;
        description
          "Match mode to use for UrlPath name searches.";
      }

      leaf wildcard-keys {
        type boolean;
        description
          "Set to 'true' if UrlPath targets for GET operations
           are allowed to replace key values with the dash '-'
           character to indicate that all instances of that key
           are requested.

           Set to false to treat the '-' character as a plain
           character if entered as a key value in a UrlPath string.";
      }
    }  // grouping MatchParms

    grouping UseSessionVarsParm {
      leaf use-session-vars {
        type boolean;
        default 'true';
        description
          "Specifies how global variables will be handled when
           set from the context of a named session.  If 'true',
           then an assignment (e.g., $$foo = 'bar') will only
           affect the session-specific instance of the variable,
           and only be visible within the scope of the named
           session.

           If 'false', then assignment statements for global
           variables will affect the global instance of the
           variable, and be visible to all sessions.

           If the current session is the default session,
           and not a named session, then the value of this
           variable is ignored, and all global variable
           assignments will affect the global instance of
           the variable, and be visible to all sessions.";
      }
    }  // grouping UseSessionVarsParm

    grouping SaveSessionVarsParm {
      leaf save-session-vars {
        type boolean;
        default 'true';
        description
          "Specifies if session variables will be saved
           when the program exits. If use-session-vars
           is 'false' then this variable is ignored.

           If 'false', then session variables will not be
           saved when the program exits.

           If 'true', then session variables will be
           saved when the program exits, but only if user
           variables are being saved.";
      }
    }  // grouping SaveSessionVarsParm

    grouping DataTemplateParms {
      leaf use-data-templates {
        type boolean;
        default 'true';
        description
          "Specifies if variable expressions are enabled for
           data in XML, JSON or .conf instance documents.

           If 'false', then text matching the pattern for
           variable expressions in these instance documents
           will be treated as plain strings.

           If 'true', then text matching the pattern for
           variable expressions in these instance documents
           will be processed as variable expressions.";
      }

      leaf ignore-missing-vars {
        type boolean;
        default 'false';
        description
          "Specifies how missing variable errors in data
           templates are handled. This parameter has no
           affect unless the 'use-data-templates' parameter
           is 'true'.

           If 'false', then variable expressions that contain
           references to missing variables will cause a parsing
           error.

           If 'true', then variable expressions that contain
           references to missing variables will not cause a
           parsing error. Instead, an empty string will be used
           for the value of a missing variable.";
      }
    }  // grouping DataTemplateParms

    grouping AnnotationParm {
      leaf-list annotation {
        type yt:NcModuleSpec;
        description
          "YANG deviation file representing model annotations.
               Processed the same as a deviation parameter except
               the module is not advertised to any client sessions.

               Only the deviation 'deviate add' operation can be
               used to transfer extension statements to another
               model.

               The annotations will be applied to a data definition
               statement, as if they were defined as sub-statements
               of the deviation target.

                  --annotation=acme-dev1

               Example object annotations (contents of acme-dev1)

                 deviation /if:interfaces {
                   deviate add {
                     ncx:sil-delete-chilren-first;
                   }
                 }

                 deviation /if:interfaces/if:interface {
                   deviate add {
                     ncx:sil-delete-chilren-first;
                     acme:my-deviation1 'the deviation parm';
                   }
                 }
             ";
      }
    }  // grouping AnnotationParm

    grouping OcPatternParm {
      leaf with-ocpattern {
        type boolean;
        default 'false';
        description
          "If true, then OpenConfig patterns with be checked.
               If the module name starts with the string 'openconfig-'
               then all pattern statements within that module
               are treated as POSIX patterns, not YANG patterns.

               If false, then the pattern statements in all modules
               will be checked as YANG patterns.
             ";
      }
    }  // grouping OcPatternParm
  }  // module yumaworks-app-common