lib/fog/openstack/models/compute/tenants.rb in fog-1.8.0 vs lib/fog/openstack/models/compute/tenants.rb in fog-1.9.0
- old
+ new
@@ -6,15 +6,19 @@
class OpenStack
class Tenants < Fog::Collection
model Fog::Compute::OpenStack::Tenant
def all
- load(connection.list_tenants.body['tenants'])
+ load(service.list_tenants.body['tenants'])
end
def usages(start_date = nil, end_date = nil, details = false)
- connection.list_usages(start_date, end_date, details).body['tenant_usages']
- end
+ service.list_usages(start_date, end_date, details).body['tenant_usages']
+ end
+
+ def find_by_id(id)
+ self.find {|tenant| tenant.id == id}
+ end
end # class Tenants
end # class OpenStack
end # module Compute
end # module Fog