mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
25 lines
514 B
Ruby
25 lines
514 B
Ruby
|
require 'fog/core/collection'
|
||
|
require 'fog/rackspace/models/cdn_v2/flavor'
|
||
|
|
||
|
module Fog
|
||
|
module Rackspace
|
||
|
class CDNV2 < Fog::Service
|
||
|
class Flavors < Fog::Collection
|
||
|
model Fog::Rackspace::CDNV2::Flavor
|
||
|
|
||
|
def all
|
||
|
data = service.list_flavors.body['flavors']
|
||
|
load(data)
|
||
|
end
|
||
|
|
||
|
def get(name)
|
||
|
data = service.get_flavor(name).body
|
||
|
new(data)
|
||
|
rescue Fog::Rackspace::CDNV2::NotFound
|
||
|
nil
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|