Class: Cisco::EvpnMultisite
Overview
node_utils class for 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(multisiteid, instantiate = true) ⇒ EvpnMultisite
Returns a new instance of EvpnMultisite.
26
27
28
29
30
31
32
33
34
|
# File 'lib/cisco_node_utils/evpn_multisite.rb', line 26
def initialize(multisiteid, instantiate=true)
err_msg = "multisiteid must be either a 'String' or an" \
" 'Integer' object"
fail ArgumentError, err_msg unless multisiteid.is_a?(Integer) ||
multisiteid.is_a?(String)
@multisiteid = multisiteid.to_i
@get_args = @set_args = { multisiteid: @multisiteid }
create if instantiate
end
|
Instance Attribute Details
#multisiteid ⇒ Object
Returns the value of attribute multisiteid.
24
25
26
|
# File 'lib/cisco_node_utils/evpn_multisite.rb', line 24
def multisiteid
@multisiteid
end
|
#time ⇒ Object
Returns the value of attribute time.
24
25
26
|
# File 'lib/cisco_node_utils/evpn_multisite.rb', line 24
def time
@time
end
|
Class Method Details
.multisite ⇒ Object
54
55
56
57
58
59
|
# File 'lib/cisco_node_utils/evpn_multisite.rb', line 54
def self.multisite
nu_obj = nil
ms_id = config_get('evpn_multisite', 'multisite')
nu_obj = EvpnMultisite.new(ms_id, false) if ms_id
nu_obj
end
|
Instance Method Details
#create ⇒ Object
36
37
38
39
40
41
42
43
44
|
# File 'lib/cisco_node_utils/evpn_multisite.rb', line 36
def create
config_set('feature', 'nv_overlay', state: '')
sleep 1
@set_args[:state] = ''
config_set('evpn_multisite', 'multisite', @set_args)
end
|
#default_delay_restore ⇒ Object
92
93
94
|
# File 'lib/cisco_node_utils/evpn_multisite.rb', line 92
def default_delay_restore
config_get_default('evpn_multisite', 'delay_restore')
end
|
#delay_restore ⇒ Object
75
76
77
|
# File 'lib/cisco_node_utils/evpn_multisite.rb', line 75
def delay_restore
config_get('evpn_multisite', 'delay_restore', @get_args)
end
|
#delay_restore=(time) ⇒ Object
79
80
81
82
83
84
85
86
87
88
89
90
|
# File 'lib/cisco_node_utils/evpn_multisite.rb', line 79
def delay_restore=(time)
dummy_time = 30
if time == default_delay_restore
@set_args[:state] = 'no'
@set_args[:time] = dummy_time
else
@set_args[:time] = time
@set_args[:state] = '' unless @set_args[:state]
end
config_set('evpn_multisite', 'delay_restore', @set_args)
end
|
#destroy ⇒ Object
46
47
48
49
50
51
52
|
# File 'lib/cisco_node_utils/evpn_multisite.rb', line 46
def destroy
@set_args[:state] = 'no'
@set_args[:time] = 30
config_set('evpn_multisite', 'delay_restore', @set_args)
config_set('evpn_multisite', 'multisite', @set_args)
end
|
#multisite ⇒ Object
61
62
63
|
# File 'lib/cisco_node_utils/evpn_multisite.rb', line 61
def multisite
config_get('evpn_multisite', 'multisite')
end
|
#multisite=(multisiteid) ⇒ Object
65
66
67
68
69
70
71
72
73
|
# File 'lib/cisco_node_utils/evpn_multisite.rb', line 65
def multisite=(multisiteid)
err_msg = "multisiteid must be either a 'String' or an" \
" 'Integer' object"
fail ArgumentError, err_msg unless multisiteid.is_a?(Integer) ||
multisiteid.is_a?(String)
@multisiteid = multisiteid.to_i
@set_args[:multisiteid] = @multisiteid
config_set('evpn_multisite', 'multisite', @set_args)
end
|