Class: Cisco::BfdGlobal
Overview
node_utils class for bfd_global
Instance Attribute Summary collapse
Instance Method Summary
collapse
-
#default_echo_interface ⇒ Object
-
#default_echo_rx_interval ⇒ Object
-
#default_fabricpath_interval ⇒ Object
-
#default_fabricpath_slow_timer ⇒ Object
-
#default_fabricpath_vlan ⇒ Object
-
#default_interval ⇒ Object
-
#default_ipv4_echo_rx_interval ⇒ Object
-
#default_ipv4_interval ⇒ Object
-
#default_ipv4_slow_timer ⇒ Object
-
#default_ipv6_echo_rx_interval ⇒ Object
-
#default_ipv6_interval ⇒ Object
-
#default_ipv6_slow_timer ⇒ Object
-
#default_slow_timer ⇒ Object
-
#default_startup_timer ⇒ Object
-
#destroy ⇒ Object
Reset everything back to default.
-
#echo_interface ⇒ Object
-
#echo_interface=(val) ⇒ Object
-
#echo_rx_interval ⇒ Object
-
#echo_rx_interval=(val) ⇒ Object
-
#fabricpath_interval ⇒ Object
fabricpath_interval is an array of fabricpath_interval, fabricpath_min_rx and fabricpath_multiplier CLI: bfd fabricpath interval 100 min_rx 100 multiplier 25.
-
#fabricpath_interval=(arr) ⇒ Object
fabricpath_interval is an array of fabricpath_interval, fabricpath_min_rx and fabricpath_multiplier ex: [‘100’, ‘100’, ‘25’] CLI: bfd fabricpath interval 100 min_rx 100 multiplier 25.
-
#fabricpath_slow_timer ⇒ Object
-
#fabricpath_slow_timer=(val) ⇒ Object
-
#fabricpath_vlan ⇒ Object
-
#fabricpath_vlan=(val) ⇒ Object
-
#initialize(instantiate = true) ⇒ BfdGlobal
constructor
A new instance of BfdGlobal.
-
#interval ⇒ Object
interval is an array of interval, min_rx and multiplier CLI: bfd interval 100 min_rx 100 multiplier 25.
-
#interval=(arr) ⇒ Object
interval is an array of interval, min_rx and multiplier ex: [‘100’, ‘100’, ‘25’] CLI: bfd interval 100 min_rx 100 multiplier 25.
-
#ipv4_echo_rx_interval ⇒ Object
-
#ipv4_echo_rx_interval=(val) ⇒ Object
-
#ipv4_interval ⇒ Object
ipv4_interval is an array of ipv4_interval, ipv4_min_rx and ipv4_multiplier CLI: bfd ipv4 interval 100 min_rx 100 multiplier 25.
-
#ipv4_interval=(arr) ⇒ Object
ipv4_interval is an array of ipv4_interval, ipv4_min_rx and ipv4_multiplier ex: [‘100’, ‘100’, ‘25’] CLI: bfd ipv4 interval 100 min_rx 100 multiplier 25.
-
#ipv4_slow_timer ⇒ Object
-
#ipv4_slow_timer=(val) ⇒ Object
-
#ipv6_echo_rx_interval ⇒ Object
-
#ipv6_echo_rx_interval=(val) ⇒ Object
-
#ipv6_interval ⇒ Object
ipv6_interval is an array of ipv6_interval, ipv6_min_rx and ipv6_multiplier CLI: bfd ipv6 interval 100 min_rx 100 multiplier 25.
-
#ipv6_interval=(arr) ⇒ Object
ipv6_interval is an array of ipv6_interval, ipv6_min_rx and ipv6_multiplier ex: [‘100’, ‘100’, ‘25’] CLI: bfd ipv6 interval 100 min_rx 100 multiplier 25.
-
#ipv6_slow_timer ⇒ Object
-
#ipv6_slow_timer=(val) ⇒ Object
-
#set_args_keys(hash = {}) ⇒ Object
rubocop:disable Style/AccessorMethodName.
-
#set_args_keys_default ⇒ Object
Helper method to delete @set_args hash keys.
-
#slow_timer ⇒ Object
-
#slow_timer=(val) ⇒ Object
-
#startup_timer ⇒ Object
-
#startup_timer=(val) ⇒ Object
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(instantiate = true) ⇒ BfdGlobal
Returns a new instance of BfdGlobal.
27
28
29
30
31
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 27
def initialize(instantiate=true)
set_args_keys_default
Feature.bfd_enable if instantiate
end
|
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
25
26
27
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 25
def name
@name
end
|
Instance Method Details
#default_echo_interface ⇒ Object
84
85
86
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 84
def default_echo_interface
config_get_default('bfd_global', 'echo_interface')
end
|
#default_echo_rx_interval ⇒ Object
98
99
100
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 98
def default_echo_rx_interval
config_get_default('bfd_global', 'echo_rx_interval')
end
|
#default_fabricpath_interval ⇒ Object
230
231
232
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 230
def default_fabricpath_interval
config_get_default('bfd_global', 'fabricpath_interval')
end
|
#default_fabricpath_slow_timer ⇒ Object
186
187
188
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 186
def default_fabricpath_slow_timer
config_get_default('bfd_global', 'fabricpath_slow_timer')
end
|
#default_fabricpath_vlan ⇒ Object
214
215
216
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 214
def default_fabricpath_vlan
config_get_default('bfd_global', 'fabricpath_vlan')
end
|
#default_interval ⇒ Object
218
219
220
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 218
def default_interval
config_get_default('bfd_global', 'interval')
end
|
#default_ipv4_echo_rx_interval ⇒ Object
112
113
114
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 112
def default_ipv4_echo_rx_interval
config_get_default('bfd_global', 'ipv4_echo_rx_interval')
end
|
#default_ipv4_interval ⇒ Object
222
223
224
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 222
def default_ipv4_interval
config_get_default('bfd_global', 'ipv4_interval')
end
|
#default_ipv4_slow_timer ⇒ Object
156
157
158
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 156
def default_ipv4_slow_timer
config_get_default('bfd_global', 'ipv4_slow_timer')
end
|
#default_ipv6_echo_rx_interval ⇒ Object
126
127
128
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 126
def default_ipv6_echo_rx_interval
config_get_default('bfd_global', 'ipv6_echo_rx_interval')
end
|
#default_ipv6_interval ⇒ Object
226
227
228
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 226
def default_ipv6_interval
config_get_default('bfd_global', 'ipv6_interval')
end
|
#default_ipv6_slow_timer ⇒ Object
172
173
174
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 172
def default_ipv6_slow_timer
config_get_default('bfd_global', 'ipv6_slow_timer')
end
|
#default_slow_timer ⇒ Object
140
141
142
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 140
def default_slow_timer
config_get_default('bfd_global', 'slow_timer')
end
|
#default_startup_timer ⇒ Object
200
201
202
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 200
def default_startup_timer
config_get_default('bfd_global', 'startup_timer')
end
|
#destroy ⇒ Object
Reset everything back to default
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 34
def destroy
return unless Feature.bfd_enabled?
[:interval,
:ipv4_interval,
:ipv6_interval,
:fabricpath_interval,
:echo_interface,
:echo_rx_interval,
:ipv4_echo_rx_interval,
:ipv6_echo_rx_interval,
:fabricpath_vlan,
:slow_timer,
:ipv4_slow_timer,
:ipv6_slow_timer,
:fabricpath_slow_timer,
:startup_timer,
].each do |prop|
send("#{prop}=", send("default_#{prop}")) if
send prop
end
set_args_keys_default
end
|
#echo_interface ⇒ Object
73
74
75
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 73
def echo_interface
config_get('bfd_global', 'echo_interface', @get_args)
end
|
#echo_interface=(val) ⇒ Object
77
78
79
80
81
82
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 77
def echo_interface=(val)
set_args_keys(intf: val ? val : echo_interface,
state: val ? '' : 'no')
config_set('bfd_global', 'echo_interface', @set_args) if
@set_args[:intf]
end
|
#echo_rx_interval ⇒ Object
88
89
90
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 88
def echo_rx_interval
config_get('bfd_global', 'echo_rx_interval', @get_args)
end
|
#echo_rx_interval=(val) ⇒ Object
92
93
94
95
96
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 92
def echo_rx_interval=(val)
set_args_keys(rxi: val,
state: val == default_echo_rx_interval ? 'no' : '')
config_set('bfd_global', 'echo_rx_interval', @set_args)
end
|
#fabricpath_interval ⇒ Object
fabricpath_interval is an array of fabricpath_interval, fabricpath_min_rx and fabricpath_multiplier CLI: bfd fabricpath interval 100 min_rx 100 multiplier 25
257
258
259
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 257
def fabricpath_interval
config_get('bfd_global', 'fabricpath_interval', @get_args)
end
|
#fabricpath_interval=(arr) ⇒ Object
fabricpath_interval is an array of fabricpath_interval, fabricpath_min_rx and fabricpath_multiplier ex: [‘100’, ‘100’, ‘25’] CLI: bfd fabricpath interval 100 min_rx 100 multiplier 25
298
299
300
301
302
303
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 298
def fabricpath_interval=(arr)
interval, min_rx, multiplier = arr
set_args_keys(interval: interval, min_rx: min_rx, multiplier: multiplier,
state: arr == default_fabricpath_interval ? 'no' : '')
config_set('bfd_global', 'fabricpath_interval', @set_args)
end
|
#fabricpath_slow_timer ⇒ Object
176
177
178
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 176
def fabricpath_slow_timer
config_get('bfd_global', 'fabricpath_slow_timer', @get_args)
end
|
#fabricpath_slow_timer=(val) ⇒ Object
180
181
182
183
184
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 180
def fabricpath_slow_timer=(val)
set_args_keys(timer: val,
state: val == default_fabricpath_slow_timer ? 'no' : '')
config_set('bfd_global', 'fabricpath_slow_timer', @set_args)
end
|
#fabricpath_vlan ⇒ Object
204
205
206
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 204
def fabricpath_vlan
config_get('bfd_global', 'fabricpath_vlan', @get_args)
end
|
#fabricpath_vlan=(val) ⇒ Object
208
209
210
211
212
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 208
def fabricpath_vlan=(val)
set_args_keys(vlan: val,
state: val == default_fabricpath_vlan ? 'no' : '')
config_set('bfd_global', 'fabricpath_vlan', @set_args)
end
|
#interval ⇒ Object
interval is an array of interval, min_rx and multiplier CLI: bfd interval 100 min_rx 100 multiplier 25
236
237
238
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 236
def interval
config_get('bfd_global', 'interval', @get_args)
end
|
#interval=(arr) ⇒ Object
interval is an array of interval, min_rx and multiplier ex: [‘100’, ‘100’, ‘25’] CLI: bfd interval 100 min_rx 100 multiplier 25
264
265
266
267
268
269
270
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 264
def interval=(arr)
return if arr == interval
interval, min_rx, multiplier = arr
set_args_keys(interval: interval, min_rx: min_rx, multiplier: multiplier,
state: arr == default_interval ? 'no' : '')
config_set('bfd_global', 'interval', @set_args)
end
|
#ipv4_echo_rx_interval ⇒ Object
102
103
104
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 102
def ipv4_echo_rx_interval
config_get('bfd_global', 'ipv4_echo_rx_interval', @get_args)
end
|
#ipv4_echo_rx_interval=(val) ⇒ Object
106
107
108
109
110
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 106
def ipv4_echo_rx_interval=(val)
set_args_keys(rxi: val,
state: val == default_ipv4_echo_rx_interval ? 'no' : '')
config_set('bfd_global', 'ipv4_echo_rx_interval', @set_args)
end
|
#ipv4_interval ⇒ Object
ipv4_interval is an array of ipv4_interval, ipv4_min_rx and ipv4_multiplier CLI: bfd ipv4 interval 100 min_rx 100 multiplier 25
243
244
245
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 243
def ipv4_interval
config_get('bfd_global', 'ipv4_interval', @get_args)
end
|
#ipv4_interval=(arr) ⇒ Object
ipv4_interval is an array of ipv4_interval, ipv4_min_rx and ipv4_multiplier ex: [‘100’, ‘100’, ‘25’] CLI: bfd ipv4 interval 100 min_rx 100 multiplier 25
276
277
278
279
280
281
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 276
def ipv4_interval=(arr)
interval, min_rx, multiplier = arr
set_args_keys(interval: interval, min_rx: min_rx, multiplier: multiplier,
state: arr == default_ipv4_interval ? 'no' : '')
config_set('bfd_global', 'ipv4_interval', @set_args)
end
|
#ipv4_slow_timer ⇒ Object
144
145
146
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 144
def ipv4_slow_timer
config_get('bfd_global', 'ipv4_slow_timer', @get_args)
end
|
#ipv4_slow_timer=(val) ⇒ Object
148
149
150
151
152
153
154
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 148
def ipv4_slow_timer=(val)
return if val == default_ipv4_slow_timer && val == ipv4_slow_timer
set_args_keys(timer: val,
state: val == default_ipv4_slow_timer ? 'no' : '')
config_set('bfd_global', 'ipv4_slow_timer', @set_args)
end
|
#ipv6_echo_rx_interval ⇒ Object
116
117
118
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 116
def ipv6_echo_rx_interval
config_get('bfd_global', 'ipv6_echo_rx_interval', @get_args)
end
|
#ipv6_echo_rx_interval=(val) ⇒ Object
120
121
122
123
124
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 120
def ipv6_echo_rx_interval=(val)
set_args_keys(rxi: val,
state: val == default_ipv6_echo_rx_interval ? 'no' : '')
config_set('bfd_global', 'ipv6_echo_rx_interval', @set_args)
end
|
#ipv6_interval ⇒ Object
ipv6_interval is an array of ipv6_interval, ipv6_min_rx and ipv6_multiplier CLI: bfd ipv6 interval 100 min_rx 100 multiplier 25
250
251
252
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 250
def ipv6_interval
config_get('bfd_global', 'ipv6_interval', @get_args)
end
|
#ipv6_interval=(arr) ⇒ Object
ipv6_interval is an array of ipv6_interval, ipv6_min_rx and ipv6_multiplier ex: [‘100’, ‘100’, ‘25’] CLI: bfd ipv6 interval 100 min_rx 100 multiplier 25
287
288
289
290
291
292
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 287
def ipv6_interval=(arr)
interval, min_rx, multiplier = arr
set_args_keys(interval: interval, min_rx: min_rx, multiplier: multiplier,
state: arr == default_ipv6_interval ? 'no' : '')
config_set('bfd_global', 'ipv6_interval', @set_args)
end
|
#ipv6_slow_timer ⇒ Object
160
161
162
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 160
def ipv6_slow_timer
config_get('bfd_global', 'ipv6_slow_timer', @get_args)
end
|
#ipv6_slow_timer=(val) ⇒ Object
164
165
166
167
168
169
170
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 164
def ipv6_slow_timer=(val)
return if val == default_ipv6_slow_timer && val == ipv6_slow_timer
set_args_keys(timer: val,
state: val == default_ipv6_slow_timer ? 'no' : '')
config_set('bfd_global', 'ipv6_slow_timer', @set_args)
end
|
#set_args_keys(hash = {}) ⇒ Object
rubocop:disable Style/AccessorMethodName
64
65
66
67
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 64
def set_args_keys(hash={})
set_args_keys_default
@set_args = @get_args.merge!(hash) unless hash.empty?
end
|
#set_args_keys_default ⇒ Object
Helper method to delete @set_args hash keys
58
59
60
61
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 58
def set_args_keys_default
keys = { state: '' }
@get_args = @set_args = keys
end
|
#slow_timer ⇒ Object
130
131
132
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 130
def slow_timer
config_get('bfd_global', 'slow_timer', @get_args)
end
|
#slow_timer=(val) ⇒ Object
134
135
136
137
138
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 134
def slow_timer=(val)
set_args_keys(timer: val,
state: val == default_slow_timer ? 'no' : '')
config_set('bfd_global', 'slow_timer', @set_args)
end
|
#startup_timer ⇒ Object
190
191
192
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 190
def startup_timer
config_get('bfd_global', 'startup_timer', @get_args)
end
|
#startup_timer=(val) ⇒ Object
194
195
196
197
198
|
# File 'lib/cisco_node_utils/bfd_global.rb', line 194
def startup_timer=(val)
set_args_keys(timer: val,
state: val == default_startup_timer ? 'no' : '')
config_set('bfd_global', 'startup_timer', @set_args)
end
|