mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00

These files were merged from github.com/racker/rackspace-monitoring-rb. The namespace was different than the convetion in fog so the namespace was modified to be compliant with the rest of the fog library.
27 lines
558 B
Ruby
27 lines
558 B
Ruby
require 'fog/core/collection'
|
|
require 'fog/rackspace/models/monitoring/metric'
|
|
|
|
module Fog
|
|
module Rackspace
|
|
class Monitoring
|
|
class Metrics < Fog::Collection
|
|
|
|
attribute :check
|
|
|
|
model Fog::Rackspace::Monitoring::Metric
|
|
|
|
def all
|
|
requires :check
|
|
data = service.list_metrics(check.entity.id, check.id).body['values']
|
|
load(data)
|
|
end
|
|
|
|
def new(attributes = {})
|
|
requires :check
|
|
super({ :check => check }.merge!(attributes))
|
|
end
|
|
|
|
end
|
|
end
|
|
end
|
|
end
|