2012-02-21 11:09:26 -05:00
|
|
|
require 'fog/core/collection'
|
|
|
|
require 'fog/openstack/models/compute/tenant'
|
|
|
|
|
|
|
|
module Fog
|
|
|
|
module Compute
|
|
|
|
class OpenStack
|
|
|
|
class Tenants < Fog::Collection
|
|
|
|
model Fog::Compute::OpenStack::Tenant
|
|
|
|
|
|
|
|
def all
|
2012-12-22 18:24:36 -05:00
|
|
|
load(service.list_tenants.body['tenants'])
|
2012-02-21 11:09:26 -05:00
|
|
|
end
|
2012-03-06 01:43:02 -05:00
|
|
|
|
|
|
|
def usages(start_date = nil, end_date = nil, details = false)
|
2012-12-22 18:24:36 -05:00
|
|
|
service.list_usages(start_date, end_date, details).body['tenant_usages']
|
2012-12-04 03:06:37 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def find_by_id(id)
|
|
|
|
self.find {|tenant| tenant.id == id}
|
|
|
|
end
|
2012-02-21 11:09:26 -05:00
|
|
|
end # class Tenants
|
|
|
|
end # class OpenStack
|
|
|
|
end # module Compute
|
|
|
|
end # module Fog
|