Class: Fog::Compute::Cloudstack::Flavors

Inherits:
Fog::Collection
  • Object
show all
Defined in:
lib/fog/cloudstack/models/compute/flavors.rb

Instance Method Summary collapse

Instance Method Details

#allObject



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

def all
  data = service.list_service_offerings["listserviceofferingsresponse"]["serviceoffering"] || []
  load(data)
end

#get(flavor_id) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/fog/cloudstack/models/compute/flavors.rb', line 15

def get(flavor_id)
  if flavor = service.list_service_offerings('id' => flavor_id)["listserviceofferingsresponse"]["serviceoffering"].first
    new(flavor)
  end
rescue Fog::Compute::Cloudstack::BadRequest
  nil
end