2010-11-08 12:21:31 +00:00
|
|
|
require 'fog/core/collection'
|
2011-08-24 20:31:12 -05:00
|
|
|
require 'fog/brightbox/models/compute/flavor'
|
2010-11-08 12:21:31 +00:00
|
|
|
|
|
|
|
module Fog
|
2011-06-16 16:28:54 -07:00
|
|
|
module Compute
|
|
|
|
class Brightbox
|
2010-11-08 12:21:31 +00:00
|
|
|
|
|
|
|
class Flavors < Fog::Collection
|
|
|
|
|
2011-06-16 16:28:54 -07:00
|
|
|
model Fog::Compute::Brightbox::Flavor
|
2010-11-08 12:21:31 +00:00
|
|
|
|
|
|
|
def all
|
2010-11-09 17:40:04 +00:00
|
|
|
data = connection.list_server_types
|
|
|
|
load(data)
|
2010-11-08 12:21:31 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def get(identifier)
|
2010-11-09 17:40:04 +00:00
|
|
|
data = connection.get_server_type(identifier)
|
|
|
|
new(data)
|
2010-11-08 12:21:31 +00:00
|
|
|
rescue Excon::Errors::NotFound
|
|
|
|
nil
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|