Class: GraylogAPI::System::Cluster

Inherits:
Object
  • Object
show all
Defined in:
lib/graylogapi/system/cluster.rb

Overview

class for get system information of a node

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Cluster

Returns a new instance of Cluster.



5
6
7
# File 'lib/graylogapi/system/cluster.rb', line 5

def initialize(client)
  @client = client
end

Instance Method Details

#nodeObject



9
10
11
# File 'lib/graylogapi/system/cluster.rb', line 9

def node
  @client.request(:get, '/system/cluster/node')
end

#node_by_hostname(hostname) ⇒ Object



21
22
23
# File 'lib/graylogapi/system/cluster.rb', line 21

def node_by_hostname(hostname)
  nodes['nodes'].find { |n| n['hostname'] == hostname }
end

#node_by_id(id) ⇒ Object



17
18
19
# File 'lib/graylogapi/system/cluster.rb', line 17

def node_by_id(id)
  @client.request(:get, "/system/cluster/nodes/#{id}")
end

#nodesObject



13
14
15
# File 'lib/graylogapi/system/cluster.rb', line 13

def nodes
  @client.request(:get, '/system/cluster/nodes')
end