2011-05-11 18:35:02 -07:00
|
|
|
require 'fog/core/collection'
|
2011-08-24 20:19:14 -05:00
|
|
|
require 'fog/ninefold/models/compute/flavor'
|
2011-05-11 18:35:02 -07:00
|
|
|
|
|
|
|
module Fog
|
2011-06-16 16:28:54 -07:00
|
|
|
module Compute
|
|
|
|
class Ninefold
|
2011-05-11 18:35:02 -07:00
|
|
|
|
|
|
|
class Flavors < Fog::Collection
|
|
|
|
|
2011-06-16 16:28:54 -07:00
|
|
|
model Fog::Compute::Ninefold::Flavor
|
2011-05-11 18:35:02 -07:00
|
|
|
|
|
|
|
def all
|
|
|
|
data = connection.list_service_offerings
|
|
|
|
load(data)
|
|
|
|
end
|
|
|
|
|
|
|
|
def get(identifier)
|
|
|
|
data = connection.list_service_offerings(:id => identifier)
|
|
|
|
if data.empty?
|
|
|
|
nil
|
|
|
|
else
|
|
|
|
new(data[0])
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|