2010-10-04 17:02:08 -04:00
|
|
|
require 'fog/core/collection'
|
2011-01-14 13:41:12 -05:00
|
|
|
require 'fog/compute/models/slicehost/flavor'
|
2010-09-08 18:00:47 -04:00
|
|
|
|
|
|
|
module Fog
|
|
|
|
module Slicehost
|
|
|
|
class Compute
|
|
|
|
|
|
|
|
class Flavors < Fog::Collection
|
|
|
|
|
2010-09-09 20:50:38 -04:00
|
|
|
model Fog::Slicehost::Compute::Flavor
|
2010-09-08 18:00:47 -04:00
|
|
|
|
|
|
|
def all
|
|
|
|
data = connection.get_flavors.body['flavors']
|
|
|
|
load(data)
|
|
|
|
end
|
|
|
|
|
|
|
|
def get(flavor_id)
|
2010-09-09 20:50:38 -04:00
|
|
|
data = connection.get_flavor(flavor_id).body
|
|
|
|
new(data)
|
2010-09-08 18:00:47 -04:00
|
|
|
rescue Excon::Errors::Forbidden
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|