Method: Rbeapi::Api::BaseInterface#set_shutdown

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

#set_shutdown(name, opts = {}) ⇒ Boolean

set_shutdown configures the administrative state of the specified interface in the node. If the enable keyword is false, then the interface is administratively disabled. If the enable keyword is true, then the interface is administratively enabled. If the default keyword is set to true, then the interface shutdown value is configured using the default keyword. The default keyword takes precedence over the enable keyword if both are provided.

Parameters:

  • name (String)

    The interface name to apply the configuration to. The name value must be the full interface identifier.

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

    Optional keyword arguments.

Options Hash (opts):

  • enable (Boolean)

    True if the interface should be administratively enabled or false if the interface should be administratively disabled.

  • default (Boolean)

    Configure the interface shutdown using the default keyword.

Returns:

  • (Boolean)

    Returns true if the command completed successfully.

Since:

  • eos_version 4.13.7M



410
411
412
413
414
415
416
417
# File 'lib/rbeapi/api/interfaces.rb', line 410

def set_shutdown(name, opts = {})
  raise 'set_shutdown has the value option set' if opts[:value]
  # Shutdown semantics are opposite of enable semantics so invert enable.
  value = !opts[:enable]
  opts[:enable] = value
  commands = command_builder('shutdown', opts)
  configure_interface(name, commands)
end