Class: Fog::OpenStack::Compute::Tenants

Inherits:
Fog::OpenStack::Collection show all
Defined in:
lib/fog/openstack/compute/models/tenants.rb

Instance Attribute Summary

Attributes inherited from Fog::OpenStack::Collection

#response

Instance Method Summary collapse

Methods inherited from Fog::OpenStack::Collection

#destroy, #find_by_id, #load_response, #summary

Instance Method Details

#allObject



10
11
12
# File 'lib/fog/openstack/compute/models/tenants.rb', line 10

def all
  load_response(service.list_tenants, 'tenants')
end

#get(id) ⇒ Object



18
19
20
# File 'lib/fog/openstack/compute/models/tenants.rb', line 18

def get(id)
  find { |tenant| tenant.id == id }
end

#usages(start_date = nil, end_date = nil, details = false) ⇒ Object



14
15
16
# File 'lib/fog/openstack/compute/models/tenants.rb', line 14

def usages(start_date = nil, end_date = nil, details = false)
  service.list_usages(start_date, end_date, details).body['tenant_usages']
end