Method: Rbeapi::Api::Managementdefaults#set_secret_hash

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

#set_secret_hash(opts = {}) ⇒ Boolean

set_secret_hash configures the management defaults secret hash value in the current nodes running configuration. If the default keyword is provided, the configuration is defaulted using the default keyword.

Commands

management defaults
  secret hash <value>
  no secret hash
  default secret hash

Parameters:

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

    Optional keyword arguments

Options Hash (opts):

  • value (String)

    The value to configure the secret hash to.

  • enable (Boolean)

    If false then the command is negated. Default is true.

  • default (Boolean)

    Configure the secret hash value using the default keyword.

Returns:

  • (Boolean)

    Returns true if the command completed successfully.

Since:

  • eos_version 4.13.7M



109
110
111
112
113
114
115
116
# File 'lib/rbeapi/api/managementdefaults.rb', line 109

def set_secret_hash(opts = {})
  unless ['md5', 'sha512', nil].include?(opts[:value])
    raise ArgumentError, 'secret hash must be md5 or sha512'
  end
  cmd = command_builder("secret hash #{opts[:value]}")
  cmds = ['management defaults', cmd]
  configure(cmds)
end