Class: GraylogAPI::System::Cluster
- Inherits:
-
Object
- Object
- GraylogAPI::System::Cluster
- Defined in:
- lib/graylogapi/system/cluster.rb
Overview
class for get system information of a node
Instance Method Summary collapse
-
#initialize(client) ⇒ Cluster
constructor
A new instance of Cluster.
- #node ⇒ Object
- #node_by_hostname(hostname) ⇒ Object
- #node_by_id(id) ⇒ Object
- #nodes ⇒ Object
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
#node ⇒ Object
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 |
#nodes ⇒ Object
13 14 15 |
# File 'lib/graylogapi/system/cluster.rb', line 13 def nodes @client.request(:get, '/system/cluster/nodes') end |