Class: Cisco::NodeUtil
- Inherits:
-
Object
- Object
- Cisco::NodeUtil
- Defined in:
- lib/util/node_util.rb
Overview
NodeUtil - generic functionality for node utility subclasses to use
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
- #client ⇒ Object
- #get(**kwargs) ⇒ Object
- #ios_xr? ⇒ Boolean
- #nexus? ⇒ Boolean
- #node ⇒ Object
- #platform ⇒ Object
- #supports?(api) ⇒ Boolean
Class Method Details
.client ⇒ Object
29 30 31 |
# File 'lib/util/node_util.rb', line 29 def self.client node.client end |
.node ⇒ Object
21 22 23 |
# File 'lib/util/node_util.rb', line 21 def self.node @node ||= Cisco::Node.instance end |
.platform ⇒ Object
45 46 47 |
# File 'lib/util/node_util.rb', line 45 def self.platform client.platform end |
.supports?(api) ⇒ Boolean
37 38 39 |
# File 'lib/util/node_util.rb', line 37 def self.supports?(api) client.supports?(api) end |
Instance Method Details
#client ⇒ Object
33 34 35 |
# File 'lib/util/node_util.rb', line 33 def client node.client end |
#get(**kwargs) ⇒ Object
53 54 55 56 57 58 59 |
# File 'lib/util/node_util.rb', line 53 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
61 62 63 |
# File 'lib/util/node_util.rb', line 61 def ios_xr? platform == :ios_xr end |
#nexus? ⇒ Boolean
65 66 67 |
# File 'lib/util/node_util.rb', line 65 def nexus? platform == :nexus end |
#node ⇒ Object
25 26 27 |
# File 'lib/util/node_util.rb', line 25 def node self.class.node end |
#platform ⇒ Object
49 50 51 |
# File 'lib/util/node_util.rb', line 49 def platform client.platform end |
#supports?(api) ⇒ Boolean
41 42 43 |
# File 'lib/util/node_util.rb', line 41 def supports?(api) client.supports?(api) end |