Class: Cisco::SnmpGroup
- Defined in:
- lib/cisco_node_utils/snmpgroup.rb
Overview
SnmpGroup - node utility class for SNMP group configuration management
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name) ⇒ SnmpGroup
constructor
A new instance of SnmpGroup.
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(name) ⇒ SnmpGroup
Returns a new instance of SnmpGroup.
31 32 33 34 |
# File 'lib/cisco_node_utils/snmpgroup.rb', line 31 def initialize(name) fail TypeError unless name.is_a?(String) @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
29 30 31 |
# File 'lib/cisco_node_utils/snmpgroup.rb', line 29 def name @name end |
Class Method Details
.exists?(group) ⇒ Boolean
47 48 49 50 51 52 |
# File 'lib/cisco_node_utils/snmpgroup.rb', line 47 def self.exists?(group) fail ArgumentError if group.empty? fail TypeError unless group.is_a? String groups = config_get('snmp_group', 'group') (!groups.nil? && groups.include?(group)) end |