Class: Asg::Rebooter::Wrappers::AutoScalingGroup
- Inherits:
-
Object
- Object
- Asg::Rebooter::Wrappers::AutoScalingGroup
- Defined in:
- lib/asg/rebooter/wrappers/auto_scaling_group.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name) ⇒ AutoScalingGroup
constructor
A new instance of AutoScalingGroup.
- #instances ⇒ Object
- #min_size ⇒ Object
- #reboot ⇒ Object
- #resume_processes(processes) ⇒ Object
- #suspend_processes(processes) ⇒ Object
- #suspended_processes ⇒ Object
- #target_groups ⇒ Object
- #update_min_size(new_min_size) ⇒ Object
Constructor Details
#initialize(name) ⇒ AutoScalingGroup
Returns a new instance of AutoScalingGroup.
9 10 11 12 13 |
# File 'lib/asg/rebooter/wrappers/auto_scaling_group.rb', line 9 def initialize(name) raise AutoScalingGroupNameRequiredError unless name @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/asg/rebooter/wrappers/auto_scaling_group.rb', line 7 def name @name end |
Instance Method Details
#instances ⇒ Object
41 42 43 44 45 |
# File 'lib/asg/rebooter/wrappers/auto_scaling_group.rb', line 41 def instances asg.instances.map do |instance| Asg::Rebooter::Wrappers::Instance.new(instance) end end |
#min_size ⇒ Object
27 28 29 |
# File 'lib/asg/rebooter/wrappers/auto_scaling_group.rb', line 27 def min_size asg.min_size end |
#reboot ⇒ Object
47 48 49 |
# File 'lib/asg/rebooter/wrappers/auto_scaling_group.rb', line 47 def reboot Asg::Rebooter::InstanceRebooter.new(self).execute end |
#resume_processes(processes) ⇒ Object
23 24 25 |
# File 'lib/asg/rebooter/wrappers/auto_scaling_group.rb', line 23 def resume_processes(processes) asg.resume_processes(scaling_processes: processes) end |
#suspend_processes(processes) ⇒ Object
19 20 21 |
# File 'lib/asg/rebooter/wrappers/auto_scaling_group.rb', line 19 def suspend_processes(processes) asg.suspend_processes(scaling_processes: processes) end |
#suspended_processes ⇒ Object
15 16 17 |
# File 'lib/asg/rebooter/wrappers/auto_scaling_group.rb', line 15 def suspended_processes asg.suspended_processes end |
#target_groups ⇒ Object
35 36 37 38 39 |
# File 'lib/asg/rebooter/wrappers/auto_scaling_group.rb', line 35 def target_groups asg.target_group_arns.map do |arn| Asg::Rebooter::Wrappers::TargetGroup.new(arn) end end |
#update_min_size(new_min_size) ⇒ Object
31 32 33 |
# File 'lib/asg/rebooter/wrappers/auto_scaling_group.rb', line 31 def update_min_size(new_min_size) asg.update(min_size: new_min_size) end |