Class: Zillabyte::API::Metrics

Inherits:
Base
  • Object
show all
Defined in:
lib/zillabyte/api/metrics.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize, #request

Constructor Details

This class inherits a constructor from Zillabyte::API::Base

Instance Method Details

#list(options = {}) ⇒ Object

GET /metrics



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/zillabyte/api/metrics.rb', line 5

def list(options = {})

  options = {
    # TODO
  }.merge(options)
  
  res = @api.request(
    :expects  => 200,
    :method   => :get,
    :path     => "/metrics"
  )
  
  res.body

end

#show(id, options = {}, block = nil) ⇒ Object

GET /metrics



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/zillabyte/api/metrics.rb', line 24

def show(id, options = {}, block = nil)
  
  
  if block
    res = @api.request(
      :expects  => 200,
      :method   => :get,
      :path     => "/metrics/#{id}?#{options.to_query}",
      :response_block => block
    )
  else
    res = @api.request(
      :expects  => 200,
      :method   => :get,
      :path     => "/metrics/#{id}?#{options.to_query}",
    )
    
  end

  res.body
  
end