Class: Cisco::NodeUtil
- Inherits:
-
Object
show all
- Defined in:
- lib/cisco_node_utils/node_util.rb
Overview
NodeUtil - generic functionality for node utility subclasses to use
Direct Known Subclasses
AaaAuthenticationLogin, AaaAuthenticationLoginService, AaaAuthorizationService, Ace, Acl, Banner, BfdGlobal, BridgeDomain, BridgeDomainVNI, DhcpRelayGlobal, DnsDomain, DomainName, Encapsulation, EvpnMulticast, EvpnMultisite, EvpnStormcontrol, EvpnVni, FabricpathGlobal, FabricpathTopo, Feature, HostName, HsrpGlobal, Interface, InterfaceChannelGroup, InterfaceEvpnMultisite, InterfaceHsrpGroup, InterfaceOspf, InterfacePortChannel, InterfaceServiceVni, IpMulticast, ItdDeviceGroup, ItdService, NameServer, NtpAuthKey, NtpConfig, NtpServer, ObjectGroup, ObjectGroupEntry, OverlayGlobal, Pim, PimGroupList, PimRpAddress, Platform, PortChannelGlobal, RadiusGlobal, RadiusServer, RadiusServerGroup, RouteMap, RouterBgp, RouterBgpAF, RouterBgpAFAggrAddr, RouterBgpNeighbor, RouterBgpNeighborAF, RouterOspf, RouterOspfArea, RouterOspfAreaVirtualLink, RouterOspfVrf, SnmpCommunity, SnmpGroup, SnmpNotification, SnmpNotificationReceiver, SnmpServer, SnmpUser, SpanSession, StpGlobal, SyslogFacility, SyslogServer, SyslogSettings, TacacsGlobal, TacacsServer, TacacsServerGroup, TacacsServerHost, Upgrade, Vdc, Vlan, Vpc, Vrf, VrfAF, Vtp, VxlanVtep, VxlanVtepVni, Yum
Class Method Summary
collapse
Instance Method Summary
collapse
Class Method Details
.client ⇒ Object
31
32
33
|
# File 'lib/cisco_node_utils/node_util.rb', line 31
def self.client
node.client
end
|
.config_get(*args) ⇒ Object
39
40
41
42
43
44
45
|
# File 'lib/cisco_node_utils/node_util.rb', line 39
def self.config_get(*args)
node.config_get(*args)
rescue Cisco::RequestFailed => e
e2 = e.class.new("[#{self}] #{e}", **e.kwargs)
e2.set_backtrace(e.backtrace)
raise e2
end
|
.config_get_default(*args) ⇒ Object
55
56
57
|
# File 'lib/cisco_node_utils/node_util.rb', line 55
def self.config_get_default(*args)
node.config_get_default(*args)
end
|
.config_set(*args) ⇒ Object
63
64
65
66
67
68
69
|
# File 'lib/cisco_node_utils/node_util.rb', line 63
def self.config_set(*args)
node.config_set(*args)
rescue Cisco::RequestFailed => e
e2 = e.class.new("[#{self}] #{e}", **e.kwargs)
e2.set_backtrace(e.backtrace)
raise e2
end
|
.node ⇒ Object
23
24
25
|
# File 'lib/cisco_node_utils/node_util.rb', line 23
def self.node
Cisco::Node.instance
end
|
87
88
89
|
# File 'lib/cisco_node_utils/node_util.rb', line 87
def self.platform
client.platform
end
|
.supports?(api) ⇒ Boolean
79
80
81
|
# File 'lib/cisco_node_utils/node_util.rb', line 79
def self.supports?(api)
client.supports?(api)
end
|
Instance Method Details
#client ⇒ Object
35
36
37
|
# File 'lib/cisco_node_utils/node_util.rb', line 35
def client
node.client
end
|
#config_get(*args) ⇒ Object
47
48
49
50
51
52
53
|
# File 'lib/cisco_node_utils/node_util.rb', line 47
def config_get(*args)
node.config_get(*args)
rescue Cisco::RequestFailed => e
e2 = e.class.new("[#{self}] #{e}", **e.kwargs)
e2.set_backtrace(e.backtrace)
raise e2
end
|
#config_get_default(*args) ⇒ Object
59
60
61
|
# File 'lib/cisco_node_utils/node_util.rb', line 59
def config_get_default(*args)
node.config_get_default(*args)
end
|
#config_set(*args) ⇒ Object
71
72
73
74
75
76
77
|
# File 'lib/cisco_node_utils/node_util.rb', line 71
def config_set(*args)
node.config_set(*args)
rescue Cisco::RequestFailed => e
e2 = e.class.new("[#{self}] #{e}", **e.kwargs)
e2.set_backtrace(e.backtrace)
raise e2
end
|
#get(**kwargs) ⇒ Object
95
96
97
98
99
100
101
|
# File 'lib/cisco_node_utils/node_util.rb', line 95
def get(**kwargs)
node.get(**kwargs)
rescue Cisco::RequestFailed => e
e2 = e.class.new("[#{self}] #{e}", **e.kwargs)
e2.set_backtrace(e.backtrace)
raise e2
end
|
#ios_xr? ⇒ Boolean
103
104
105
|
# File 'lib/cisco_node_utils/node_util.rb', line 103
def ios_xr?
platform == :ios_xr
end
|
#nexus? ⇒ Boolean
107
108
109
|
# File 'lib/cisco_node_utils/node_util.rb', line 107
def nexus?
platform == :nexus
end
|
#node ⇒ Object
27
28
29
|
# File 'lib/cisco_node_utils/node_util.rb', line 27
def node
self.class.node
end
|
91
92
93
|
# File 'lib/cisco_node_utils/node_util.rb', line 91
def platform
client.platform
end
|
#supports?(api) ⇒ Boolean
83
84
85
|
# File 'lib/cisco_node_utils/node_util.rb', line 83
def supports?(api)
client.supports?(api)
end
|