mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
28 lines
517 B
Ruby
28 lines
517 B
Ruby
module Fog
|
|
module Rackspace
|
|
class Servers
|
|
|
|
def flavors
|
|
Fog::Rackspace::Servers::Flavors.new(:connection => self)
|
|
end
|
|
|
|
class Flavors < Fog::Collection
|
|
|
|
model Fog::Rackspace::Servers::Flavor
|
|
|
|
def all
|
|
data = connection.list_flavors_detail.body['flavors']
|
|
load(data)
|
|
end
|
|
|
|
def get(flavor_id)
|
|
connection.get_flavor_details(flavor_id)
|
|
rescue Excon::Errors::NotFound
|
|
nil
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
end
|
|
end
|