Module: Mackerel::Client::Host

Included in:
Mackerel::Client
Defined in:
lib/mackerel/client/host.rb

Instance Method Summary collapse

Instance Method Details

#create_host(params) ⇒ Object



14
15
16
17
# File 'lib/mackerel/client/host.rb', line 14

def create_host(params)
  response = post "hosts", params
  response.body.host
end

#host(id) ⇒ Object



9
10
11
12
# File 'lib/mackerel/client/host.rb', line 9

def host(id)
  response = get "hosts/#{id}"
  response.body.host
end

#host_metric_names(id) ⇒ Object



34
35
36
37
# File 'lib/mackerel/client/host.rb', line 34

def host_metric_names(id)
  response = get "hosts/#{id}/metric-names"
  response.body.names
end

#host_metrics(id, params) ⇒ Object



29
30
31
32
# File 'lib/mackerel/client/host.rb', line 29

def host_metrics(id, params)
  response = get "hosts/#{id}/metrics", params
  response.body
end

#hosts(options = {}) ⇒ Object



4
5
6
7
# File 'lib/mackerel/client/host.rb', line 4

def hosts(options = {})
  response = get 'hosts.json', options
  response.body.hosts
end

#retire_host(id) ⇒ Object



24
25
26
27
# File 'lib/mackerel/client/host.rb', line 24

def retire_host(id)
  response = post "hosts/#{id}/retire"
  response.body
end

#update_host(id, params) ⇒ Object



19
20
21
22
# File 'lib/mackerel/client/host.rb', line 19

def update_host(id, params)
  response = put "hosts/#{id}", params
  response.body
end