mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
25 lines
No EOL
548 B
Ruby
25 lines
No EOL
548 B
Ruby
require 'fog/core/collection'
|
|
require 'fog/rackspace/models/auto_scale/policy'
|
|
|
|
module Fog
|
|
module Rackspace
|
|
class AutoScale
|
|
class Policies < Fog::Collection
|
|
|
|
model Fog::Rackspace::AutoScale::Policy
|
|
|
|
def all
|
|
data = service.list_policies.body['policies']
|
|
load(data)
|
|
end
|
|
|
|
def get(policy_id)
|
|
data = service.get_policy(policy_id).body['policy']
|
|
new(data)
|
|
rescue Fog::Rackspace::AutoScale::NotFound
|
|
nil
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end |