Module: DeltacloudVM::Client::Methods::Metric

Included in:
Connection, DeltacloudVM::Client::Metric
Defined in:
lib/deltacloud_vm/client/methods/metric.rb

Instance Method Summary collapse

Instance Method Details

#metric(metric_id) ⇒ Object

Retrieve the single metric entity

  • metric_id -> Metric entity to retrieve



35
36
37
38
# File 'lib/deltacloud_vm/client/methods/metric.rb', line 35

def metric(metric_id)
  from_resource :metric,
    connection.get(api_uri("metrics/#{metric_id}"))
end

#metrics(filter_opts = {}) ⇒ Object

Retrieve list of all metric entities

Filter options:

  • :id -> Filter entities using ‘id’ attribute



26
27
28
29
# File 'lib/deltacloud_vm/client/methods/metric.rb', line 26

def metrics(filter_opts={})
  from_collection :metrics,
  connection.get(api_uri('metrics'), filter_opts)
end