Class: MMS::Resource::Host
- Inherits:
-
MMS::Resource
- Object
- MMS::Resource
- MMS::Resource::Host
- Defined in:
- lib/mms/resource/host.rb
Instance Attribute Summary collapse
-
#alerts_enabled ⇒ Object
Returns the value of attribute alerts_enabled.
-
#host_enabled ⇒ Object
Returns the value of attribute host_enabled.
-
#hostname ⇒ Object
Returns the value of attribute hostname.
-
#ip_address ⇒ Object
Returns the value of attribute ip_address.
-
#last_ping ⇒ Object
Returns the value of attribute last_ping.
-
#logs_enabled ⇒ Object
Returns the value of attribute logs_enabled.
-
#name ⇒ Object
Returns the value of attribute name.
-
#port ⇒ Object
Returns the value of attribute port.
-
#profiler_enabled ⇒ Object
Returns the value of attribute profiler_enabled.
-
#replica_state_name ⇒ Object
Returns the value of attribute replica_state_name.
-
#replicaset_name ⇒ Object
Returns the value of attribute replicaset_name.
-
#shard_name ⇒ Object
Returns the value of attribute shard_name.
-
#type_name ⇒ Object
Returns the value of attribute type_name.
-
#version ⇒ Object
Returns the value of attribute version.
Attributes inherited from MMS::Resource
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from MMS::Resource
#_load, find, #from_hash, #invalidate_cache, #set_client, #set_data, #to_hash
Instance Attribute Details
#alerts_enabled ⇒ Object
Returns the value of attribute alerts_enabled.
15 16 17 |
# File 'lib/mms/resource/host.rb', line 15 def alerts_enabled @alerts_enabled end |
#host_enabled ⇒ Object
Returns the value of attribute host_enabled.
16 17 18 |
# File 'lib/mms/resource/host.rb', line 16 def host_enabled @host_enabled end |
#hostname ⇒ Object
Returns the value of attribute hostname.
6 7 8 |
# File 'lib/mms/resource/host.rb', line 6 def hostname @hostname end |
#ip_address ⇒ Object
Returns the value of attribute ip_address.
10 11 12 |
# File 'lib/mms/resource/host.rb', line 10 def ip_address @ip_address end |
#last_ping ⇒ Object
Returns the value of attribute last_ping.
9 10 11 |
# File 'lib/mms/resource/host.rb', line 9 def last_ping @last_ping end |
#logs_enabled ⇒ Object
Returns the value of attribute logs_enabled.
18 19 20 |
# File 'lib/mms/resource/host.rb', line 18 def logs_enabled @logs_enabled end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/mms/resource/host.rb', line 5 def name @name end |
#port ⇒ Object
Returns the value of attribute port.
7 8 9 |
# File 'lib/mms/resource/host.rb', line 7 def port @port end |
#profiler_enabled ⇒ Object
Returns the value of attribute profiler_enabled.
17 18 19 |
# File 'lib/mms/resource/host.rb', line 17 def profiler_enabled @profiler_enabled end |
#replica_state_name ⇒ Object
Returns the value of attribute replica_state_name.
14 15 16 |
# File 'lib/mms/resource/host.rb', line 14 def replica_state_name @replica_state_name end |
#replicaset_name ⇒ Object
Returns the value of attribute replicaset_name.
13 14 15 |
# File 'lib/mms/resource/host.rb', line 13 def replicaset_name @replicaset_name end |
#shard_name ⇒ Object
Returns the value of attribute shard_name.
12 13 14 |
# File 'lib/mms/resource/host.rb', line 12 def shard_name @shard_name end |
#type_name ⇒ Object
Returns the value of attribute type_name.
8 9 10 |
# File 'lib/mms/resource/host.rb', line 8 def type_name @type_name end |
#version ⇒ Object
Returns the value of attribute version.
11 12 13 |
# File 'lib/mms/resource/host.rb', line 11 def version @version end |
Class Method Details
._find(client, group_id, id) ⇒ Object
40 41 42 |
# File 'lib/mms/resource/host.rb', line 40 def self._find(client, group_id, id) client.get('/groups/' + group_id + '/hosts/' + id) end |
.table_header ⇒ Object
33 34 35 |
# File 'lib/mms/resource/host.rb', line 33 def self.table_header ['Group', 'Type', 'Hostname', 'IP', 'Port', 'Last ping', 'Alerts enabled', 'HostId', 'Shard', 'Replica'] end |
Instance Method Details
#group ⇒ MMS::Resource::Group
21 22 23 |
# File 'lib/mms/resource/host.rb', line 21 def group MMS::Resource::Group.find(@client, @data['groupId']) end |
#table_row ⇒ Object
25 26 27 |
# File 'lib/mms/resource/host.rb', line 25 def table_row [group.name, @type_name, @name, @ip_address, @port, @last_ping, @alerts_enabled, @id, @shard_name, @replicaset_name] end |
#table_section ⇒ Object
29 30 31 |
# File 'lib/mms/resource/host.rb', line 29 def table_section [table_row] end |