1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/lib/fog/rackspace/models/servers/flavors.rb

29 lines
517 B
Ruby
Raw Normal View History

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