Method: Rbeapi::Api::EthernetInterface#set_sflow

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

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

set_sflow configures the administrative state of sflow on the interface. Setting the value to true enables sflow on the interface and setting the value to false disables sflow on the interface. If the value is not provided, the sflow state is negated using the no keyword. If the default keyword is set to true, then the sflow value is defaulted using the default keyword. The default keyword takes precedence over the value keyword

Parameters:

  • :name (String)

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

  • :opts (Hash)

    optional keyword arguments

Returns:

  • (Boolean)

    returns true if the command completed successfully



530
531
532
533
534
535
536
537
538
539
540
541
542
# File 'lib/rbeapi/api/interfaces.rb', line 530

def set_sflow(name, opts = {})
  value = opts[:value]
  default = opts.fetch(:default, false)

  cmds = ["interface #{name}"]
  case default
  when true
    cmds << 'default sflow'
  when false
    cmds << (value ? 'sflow enable' : 'no sflow enable')
  end
  configure(cmds)
end