Class: Cisco::OverlayGlobal
Overview
node_utils class for overlay_global
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?
Instance Method Details
#anycast_gateway_mac ⇒ Object
118
119
120
121
|
# File 'lib/cisco_node_utils/overlay_global.rb', line 118
def anycast_gateway_mac
mac = config_get('overlay_global', 'anycast_gateway_mac')
mac.nil? || mac.empty? ? default_anycast_gateway_mac : mac.downcase
end
|
#anycast_gateway_mac=(mac_addr) ⇒ Object
123
124
125
126
127
128
129
130
131
132
133
134
135
136
|
# File 'lib/cisco_node_utils/overlay_global.rb', line 123
def anycast_gateway_mac=(mac_addr)
fail TypeError unless mac_addr.is_a?(String)
Feature.nv_overlay_evpn_enable
Feature.fabric_forwarding_enable
if mac_addr == default_anycast_gateway_mac
state = 'no'
mac_addr = ''
else
state = ''
end
config_set('overlay_global', 'anycast_gateway_mac',
state: state, mac_addr: mac_addr)
end
|
#default_anycast_gateway_mac ⇒ Object
138
139
140
|
# File 'lib/cisco_node_utils/overlay_global.rb', line 138
def default_anycast_gateway_mac
config_get_default('overlay_global', 'anycast_gateway_mac')
end
|
#default_dup_host_ip_addr_detection ⇒ Object
65
66
67
68
|
# File 'lib/cisco_node_utils/overlay_global.rb', line 65
def default_dup_host_ip_addr_detection
[default_dup_host_ip_addr_detection_host_moves,
default_dup_host_ip_addr_detection_timeout]
end
|
#default_dup_host_ip_addr_detection_host_moves ⇒ Object
70
71
72
73
|
# File 'lib/cisco_node_utils/overlay_global.rb', line 70
def default_dup_host_ip_addr_detection_host_moves
config_get_default('overlay_global',
'dup_host_ip_addr_detection_host_moves')
end
|
#default_dup_host_ip_addr_detection_timeout ⇒ Object
75
76
77
|
# File 'lib/cisco_node_utils/overlay_global.rb', line 75
def default_dup_host_ip_addr_detection_timeout
config_get_default('overlay_global', 'dup_host_ip_addr_detection_timeout')
end
|
#default_dup_host_mac_detection ⇒ Object
104
105
106
107
|
# File 'lib/cisco_node_utils/overlay_global.rb', line 104
def default_dup_host_mac_detection
[default_dup_host_mac_detection_host_moves,
default_dup_host_mac_detection_timeout]
end
|
#default_dup_host_mac_detection_host_moves ⇒ Object
109
110
111
|
# File 'lib/cisco_node_utils/overlay_global.rb', line 109
def default_dup_host_mac_detection_host_moves
config_get_default('overlay_global', 'dup_host_mac_detection_host_moves')
end
|
#default_dup_host_mac_detection_timeout ⇒ Object
113
114
115
|
# File 'lib/cisco_node_utils/overlay_global.rb', line 113
def default_dup_host_mac_detection_timeout
config_get_default('overlay_global', 'dup_host_mac_detection_timeout')
end
|
#dup_host_ip_addr_detection ⇒ Object
dup-host-ip-addr-detection
33
34
35
36
37
38
39
40
|
# File 'lib/cisco_node_utils/overlay_global.rb', line 33
def dup_host_ip_addr_detection
match = config_get('overlay_global', 'dup_host_ip_addr_detection')
if match.nil?
default_dup_host_ip_addr_detection
else
match.collect(&:to_i)
end
end
|
#dup_host_ip_addr_detection_host_moves ⇒ Object
42
43
44
45
|
# File 'lib/cisco_node_utils/overlay_global.rb', line 42
def dup_host_ip_addr_detection_host_moves
host_moves, _timeout = dup_host_ip_addr_detection
host_moves
end
|
#dup_host_ip_addr_detection_set(host_moves, timeout) ⇒ Object
52
53
54
55
56
57
58
59
60
61
62
63
|
# File 'lib/cisco_node_utils/overlay_global.rb', line 52
def dup_host_ip_addr_detection_set(host_moves, timeout)
Feature.fabric_forwarding_enable
Feature.nv_overlay_evpn_enable
if host_moves == default_dup_host_ip_addr_detection_host_moves &&
timeout == default_dup_host_ip_addr_detection_timeout
state = 'no'
else
state = ''
end
set_args = { state: state, host_moves: host_moves, timeout: timeout }
config_set('overlay_global', 'dup_host_ip_addr_detection', set_args)
end
|
#dup_host_ip_addr_detection_timeout ⇒ Object
47
48
49
50
|
# File 'lib/cisco_node_utils/overlay_global.rb', line 47
def dup_host_ip_addr_detection_timeout
_host_moves, timeout = dup_host_ip_addr_detection
timeout
end
|
#dup_host_mac_detection ⇒ Object
80
81
82
83
84
85
86
87
|
# File 'lib/cisco_node_utils/overlay_global.rb', line 80
def dup_host_mac_detection
match = config_get('overlay_global', 'dup_host_mac_detection')
if match.nil?
default_dup_host_mac_detection
else
match.collect(&:to_i)
end
end
|
#dup_host_mac_detection_host_moves ⇒ Object
89
90
91
92
|
# File 'lib/cisco_node_utils/overlay_global.rb', line 89
def dup_host_mac_detection_host_moves
host_moves, _timeout = dup_host_mac_detection
host_moves
end
|
#dup_host_mac_detection_set(host_moves, timeout) ⇒ Object
99
100
101
102
|
# File 'lib/cisco_node_utils/overlay_global.rb', line 99
def dup_host_mac_detection_set(host_moves, timeout)
set_args = { host_moves: host_moves, timeout: timeout }
config_set('overlay_global', 'dup_host_mac_detection', set_args)
end
|
#dup_host_mac_detection_timeout ⇒ Object
94
95
96
97
|
# File 'lib/cisco_node_utils/overlay_global.rb', line 94
def dup_host_mac_detection_timeout
_host_moves, timeout = dup_host_mac_detection
timeout
end
|