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

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

Instance Attribute Summary

Attributes inherited from OpenStack::Collection

#response

Instance Method Summary collapse

Methods inherited from OpenStack::Collection

#destroy, #find_by_id, #load_response, #summary

Instance Method Details

#allObject


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

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

#get(id) ⇒ Object


18
19
20
# File 'lib/fog/compute/openstack/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/compute/openstack/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