Class: Fog::Rackspace::AutoScale::Policies
- Inherits:
-
Collection
- Object
- Collection
- Fog::Rackspace::AutoScale::Policies
- Defined in:
- lib/fog/rackspace/models/auto_scale/policies.rb
Instance Attribute Summary collapse
-
#group ⇒ Object
Returns the value of attribute group.
Instance Method Summary collapse
-
#all ⇒ Fog::Rackspace::AutoScale::Policies
Returns list of autoscale policies.
-
#create(attributes = {}) ⇒ Fog::Rackspace::AutoScale::Policy
Create an autoscale policy.
-
#get(policy_id) ⇒ Fog::Rackspace::AutoScale::Group
Returns an individual autoscale policy.
- #new(attributes = {}) ⇒ Object
Instance Attribute Details
#group ⇒ Object
Returns the value of attribute group.
10 11 12 |
# File 'lib/fog/rackspace/models/auto_scale/policies.rb', line 10 def group @group end |
Instance Method Details
#all ⇒ Fog::Rackspace::AutoScale::Policies
Returns list of autoscale policies
22 23 24 25 |
# File 'lib/fog/rackspace/models/auto_scale/policies.rb', line 22 def all data = service.list_policies(group.id).body['policies'] load(data) end |
#create(attributes = {}) ⇒ Fog::Rackspace::AutoScale::Policy
Create an autoscale policy
55 56 57 |
# File 'lib/fog/rackspace/models/auto_scale/policies.rb', line 55 def create(attributes = {}) super(attributes) end |
#get(policy_id) ⇒ Fog::Rackspace::AutoScale::Group
Returns an individual autoscale policy
38 39 40 41 42 43 |
# File 'lib/fog/rackspace/models/auto_scale/policies.rb', line 38 def get(policy_id) data = service.get_policy(group.id, policy_id).body['policy'] new(data) rescue Fog::Rackspace::AutoScale::NotFound nil end |
#new(attributes = {}) ⇒ Object
59 60 61 |
# File 'lib/fog/rackspace/models/auto_scale/policies.rb', line 59 def new(attributes = {}) super({:group => group}.merge(attributes)) end |