Class: Fog::AWS::AutoScaling::Policy
- Inherits:
-
Model
- Object
- Model
- Fog::AWS::AutoScaling::Policy
- Defined in:
- lib/fog/aws/models/auto_scaling/policy.rb
Instance Method Summary collapse
- #destroy ⇒ Object
-
#initialize(attributes) ⇒ Policy
constructor
A new instance of Policy.
-
#save ⇒ Object
TODO: implement #alarms TODO: implement #auto_scaling_group.
Constructor Details
#initialize(attributes) ⇒ Policy
Returns a new instance of Policy.
14 15 16 17 18 |
# File 'lib/fog/aws/models/auto_scaling/policy.rb', line 14 def initialize(attributes) attributes['AdjustmentType'] ||= 'ChangeInCapacity' attributes['ScalingAdjustment'] ||= 1 super end |
Instance Method Details
#destroy ⇒ Object
36 37 38 39 40 |
# File 'lib/fog/aws/models/auto_scaling/policy.rb', line 36 def destroy requires :id requires :auto_scaling_group_name service.delete_policy(auto_scaling_group_name, id) end |
#save ⇒ Object
TODO: implement #alarms TODO: implement #auto_scaling_group
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/fog/aws/models/auto_scaling/policy.rb', line 23 def save requires :id requires :adjustment_type requires :auto_scaling_group_name requires :scaling_adjustment = Hash[self.class.aliases.map { |key, value| [key, send(value)] }] .delete_if { |key, value| value.nil? } service.put_scaling_policy(adjustment_type, auto_scaling_group_name, id, scaling_adjustment, ) reload end |