Class: Cisco::Feature
Overview
Feature - node util class for managing common features
Class Method Summary
collapse
Methods inherited from NodeUtil
config_get, #config_get, config_get_default, #config_get_default, #config_set, config_set, #node, node, #show
Class Method Details
.bgp_enable ⇒ Object
Note that in most cases the enable methods should only enable; however, for test purposes it is sometimes convenient to support feature disablement for cleanup purposes.
26
27
28
29
|
# File 'lib/cisco_node_utils/feature.rb', line 26
def self.bgp_enable
return if bgp_enabled?
config_set('feature', 'bgp')
end
|
.bgp_enabled? ⇒ Boolean
31
32
33
|
# File 'lib/cisco_node_utils/feature.rb', line 31
def self.bgp_enabled?
config_get('feature', 'bgp')
end
|
.fabric_enable ⇒ Object
36
37
38
39
40
41
|
# File 'lib/cisco_node_utils/feature.rb', line 36
def self.fabric_enable
return if fabric_enabled?
config_set('feature', 'fabric', state: 'install') unless fabric_installed?
config_set('feature', 'fabric', state: '')
end
|
.fabric_enabled? ⇒ Boolean
43
44
45
|
# File 'lib/cisco_node_utils/feature.rb', line 43
def self.fabric_enabled?
config_get('feature', 'fabric') =~ /^enabled/
end
|
.fabric_forwarding_enable ⇒ Object
56
57
58
59
60
61
62
63
64
65
66
67
68
|
# File 'lib/cisco_node_utils/feature.rb', line 56
def self.fabric_forwarding_enable
return if fabric_forwarding_enabled?
Feature.fabric_enable if Feature.fabric_supported?
begin
config_set('feature', 'fabric_forwarding')
rescue Cisco::CliError
CiscoLogger.debug '"feature fabric forwarding" CLI was rejected'
end
end
|
.fabric_forwarding_enabled? ⇒ Boolean
70
71
72
|
# File 'lib/cisco_node_utils/feature.rb', line 70
def self.fabric_forwarding_enabled?
config_get('feature', 'fabric_forwarding')
end
|
.fabric_installed? ⇒ Boolean
47
48
49
|
# File 'lib/cisco_node_utils/feature.rb', line 47
def self.fabric_installed?
config_get('feature', 'fabric') !~ /^uninstalled/
end
|
.fabric_supported? ⇒ Boolean
51
52
53
|
# File 'lib/cisco_node_utils/feature.rb', line 51
def self.fabric_supported?
config_get('feature', 'fabric')
end
|
.nv_overlay_enable ⇒ Object
75
76
77
78
79
|
# File 'lib/cisco_node_utils/feature.rb', line 75
def self.nv_overlay_enable
return if nv_overlay_enabled?
config_set('feature', 'nv_overlay')
end
|
.nv_overlay_enabled? ⇒ Boolean
81
82
83
84
85
86
87
|
# File 'lib/cisco_node_utils/feature.rb', line 81
def self.nv_overlay_enabled?
config_get('feature', 'nv_overlay')
rescue Cisco::CliError => e
raise unless e.clierror =~ /Syntax error/
return false
end
|
.nv_overlay_evpn_enable ⇒ Object
90
91
92
93
|
# File 'lib/cisco_node_utils/feature.rb', line 90
def self.nv_overlay_evpn_enable
return if nv_overlay_evpn_enabled?
config_set('feature', 'nv_overlay_evpn')
end
|
.nv_overlay_evpn_enabled? ⇒ Boolean
95
96
97
|
# File 'lib/cisco_node_utils/feature.rb', line 95
def self.nv_overlay_evpn_enabled?
config_get('feature', 'nv_overlay_evpn')
end
|
.vn_segment_vlan_based_enable ⇒ Object
100
101
102
103
|
# File 'lib/cisco_node_utils/feature.rb', line 100
def self.vn_segment_vlan_based_enable
return if vn_segment_vlan_based_enabled?
config_set('feature', 'vn_segment_vlan_based')
end
|
.vn_segment_vlan_based_enabled? ⇒ Boolean
105
106
107
|
# File 'lib/cisco_node_utils/feature.rb', line 105
def self.vn_segment_vlan_based_enabled?
config_get('feature', 'vn_segment_vlan_based')
end
|