Class: MMS::Resource::Host

Inherits:
MMS::Resource show all
Defined in:
lib/mms/resource/host.rb

Instance Attribute Summary collapse

Attributes inherited from MMS::Resource

#client, #data, #id

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_enabledObject

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_enabledObject

Returns the value of attribute host_enabled.



16
17
18
# File 'lib/mms/resource/host.rb', line 16

def host_enabled
  @host_enabled
end

#hostnameObject

Returns the value of attribute hostname.



6
7
8
# File 'lib/mms/resource/host.rb', line 6

def hostname
  @hostname
end

#ip_addressObject

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_pingObject

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_enabledObject

Returns the value of attribute logs_enabled.



18
19
20
# File 'lib/mms/resource/host.rb', line 18

def logs_enabled
  @logs_enabled
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/mms/resource/host.rb', line 5

def name
  @name
end

#portObject

Returns the value of attribute port.



7
8
9
# File 'lib/mms/resource/host.rb', line 7

def port
  @port
end

#profiler_enabledObject

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_nameObject

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_nameObject

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_nameObject

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_nameObject

Returns the value of attribute type_name.



8
9
10
# File 'lib/mms/resource/host.rb', line 8

def type_name
  @type_name
end

#versionObject

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

Parameters:



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_headerObject



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

#groupMMS::Resource::Group



21
22
23
# File 'lib/mms/resource/host.rb', line 21

def group
  MMS::Resource::Group.find(@client, @data['groupId'])
end

#table_rowObject



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_sectionObject



29
30
31
# File 'lib/mms/resource/host.rb', line 29

def table_section
  [table_row]
end