Class: Fog::Compute::OpenStack::Flavors

Inherits:
OpenStack::Collection show all
Defined in:
lib/fog/compute/openstack/models/flavors.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

Instance Method Details

#all(options = {}) ⇒ Object



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

def all(options = {})
  data = service.list_flavors_detail(options)
  load_response(data, 'flavors')
end

#get(flavor_id) ⇒ Object



20
21
22
23
24
25
# File 'lib/fog/compute/openstack/models/flavors.rb', line 20

def get(flavor_id)
  data = service.get_flavor_details(flavor_id).body['flavor']
  new(data)
rescue Fog::Compute::OpenStack::NotFound
  nil
end

#summary(options = {}) ⇒ Object



15
16
17
18
# File 'lib/fog/compute/openstack/models/flavors.rb', line 15

def summary(options = {})
  data = service.list_flavors(options)
  load_response(data, 'flavors')
end