Class: Cisco::InterfaceEvpnMultisite

Inherits:
NodeUtil
  • Object
show all
Defined in:
lib/cisco_node_utils/interface_evpn_multisite.rb

Overview

node_utils class for interface_evpn_multisite

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from NodeUtil

#client, client, #config_get, config_get, #config_get_default, config_get_default, config_set, #config_set, #get, #ios_xr?, #nexus?, node, #node, platform, #platform, supports?, #supports?

Constructor Details

#initialize(interface) ⇒ InterfaceEvpnMultisite


24
25
26
27
28
# File 'lib/cisco_node_utils/interface_evpn_multisite.rb', line 24

def initialize(interface)
  fail TypeError unless interface.is_a?(String)
  @interface = interface.downcase
  @get_args = @set_args = { interface: @interface }
end

Instance Attribute Details

#interfaceObject (readonly)

Returns the value of attribute interface


22
23
24
# File 'lib/cisco_node_utils/interface_evpn_multisite.rb', line 22

def interface
  @interface
end

#trackingObject

Returns the value of attribute tracking


22
23
24
# File 'lib/cisco_node_utils/interface_evpn_multisite.rb', line 22

def tracking
  @tracking
end

Class Method Details

.interfacesObject


30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/cisco_node_utils/interface_evpn_multisite.rb', line 30

def self.interfaces
  hash = {}
  intf_list = config_get('interface_evpn_multisite', 'all_interfaces')
  return hash if intf_list.nil?

  intf_list.each do |id|
    id = id.downcase
    intf = InterfaceEvpnMultisite.new(id)
    hash[id] = intf if intf.tracking
  end
  hash
end

Instance Method Details

#disable(tracking = 'dci-tracking') ⇒ Object


49
50
51
52
53
# File 'lib/cisco_node_utils/interface_evpn_multisite.rb', line 49

def disable(tracking='dci-tracking')
  @set_args[:tracking] = tracking
  @set_args[:state] = 'no'
  config_set('interface_evpn_multisite', 'evpn_multisite', @set_args)
end

#enable(tracking) ⇒ Object


43
44
45
46
47
# File 'lib/cisco_node_utils/interface_evpn_multisite.rb', line 43

def enable(tracking)
  @set_args[:tracking] = tracking
  @set_args[:state] = ''
  config_set('interface_evpn_multisite', 'evpn_multisite', @set_args)
end