Class: Fog::Compute::RackspaceV2::Flavors

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

Instance Method Summary collapse

Instance Method Details

#allFog::Compute::RackspaceV2::Flavors

Note:

Fog’s currentl implementation only returns 1000 flavors.

Retrieves information for all available flavors

Returns:

Raises:



17
18
19
20
# File 'lib/fog/rackspace/models/compute_v2/flavors.rb', line 17

def all
  data = service.list_flavors_detail.body['flavors']
  load(data)
end

#get(flavor_id) ⇒ Fog::Compute::RackspaceV2::Flavor

Retrieve image

Parameters:

  • flavor_id (String)

    id of flavor

Returns:

Raises:

See Also:



30
31
32
33
34
35
# File 'lib/fog/rackspace/models/compute_v2/flavors.rb', line 30

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