Method: Cisco::Node#config_set

Defined in:
lib/cisco_node_utils/node.rb

#config_set(feature, name, *args) ⇒ Object

Uses CommandReference to look up the given config command(s) of interest and then applies the configuration.

Examples:

config_set(“vtp”, “domain”, “example.com”)


config_set(“ospf”, “router_id”,

{:name => "green", :vrf => "one", :state => "",
 :router_id => "192.0.0.1"})

Parameters:

  • feature (String)
  • name (String)
  • args (*String)

    zero or more args to be substituted into the cmdref.

Raises:

  • (IndexError)

    if no relevant cmd_ref config_set exists

  • (ArgumentError)

    if too many or too few args are provided.

  • (Cisco::CliError)

    if any command is rejected by the device.



158
159
160
161
162
# File 'lib/cisco_node_utils/node.rb', line 158

def config_set(feature, name, *args)
  fail 'lazy_connect specified but did not request connect' unless @cmd_ref
  ref = @cmd_ref.lookup(feature, name)
  config(ref.config_set(*args))
end