Method: Rbeapi::Api::Logging#set_time_stamp_units

Defined in:
lib/rbeapi/api/logging.rb

#set_time_stamp_units(opts = {}) ⇒ Boolean

set_time_stamp_units configures the global logging time_stamp_units If the default keyword is specified and set to true, then the configuration is defaulted using the default keyword. The default keyword option takes precedence over the enable keyword if both options are specified.

Commands

logging format timestamp <traditional|high-resolution>
no logging format timestamp <level>
default logging format timestamp

Parameters:

  • opts (Hash) (defaults to: {})

    Optional keyword arguments

Options Hash (opts):

  • units (String)

    Enables logging timestamps with the specified units. One of ‘traditional’ | ‘seconds’ or ‘high-resolution’ | ‘milliseconds’

  • default (Boolean)

    Resets the logging timestamp level to the default.

Returns:

  • (Boolean)

    Returns true if the command completed successfully.

Since:

  • eos_version 4.13.7M



303
304
305
306
307
308
309
310
311
312
313
314
315
# File 'lib/rbeapi/api/logging.rb', line 303

def set_time_stamp_units(opts = {})
  unit_map = {
    'traditional' => ' traditional',
    'seconds' => ' traditional',
    'high-resolution' => ' high-resolution',
    'milliseconds' => ' high-resolution'
  }
  units = ''
  units = unit_map[opts[:units]] if opts[:units]
  cmd = "logging format timestamp#{units}"
  cmd = command_builder(cmd, opts)
  configure cmd
end