Class: AsgDetailer::Infra
- Inherits:
-
Object
- Object
- AsgDetailer::Infra
- Defined in:
- lib/asg-detailer/infra.rb
Instance Method Summary collapse
-
#initialize ⇒ Infra
constructor
A new instance of Infra.
- #query_asg(name) ⇒ Object
- #query_instance_health(name) ⇒ Object
- #query_instances(ids) ⇒ Object
- #query_lc(name) ⇒ Object
Constructor Details
#initialize ⇒ Infra
Returns a new instance of Infra.
5 6 7 |
# File 'lib/asg-detailer/infra.rb', line 5 def initialize @asg = nil end |
Instance Method Details
#query_asg(name) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/asg-detailer/infra.rb', line 9 def query_asg(name) # we save the asg because it's used more than once @asg = Aws::AutoScaling::Client.new @asg.describe_auto_scaling_groups ({ auto_scaling_group_names: [ name, ], }) end |
#query_instance_health(name) ⇒ Object
27 28 29 30 |
# File 'lib/asg-detailer/infra.rb', line 27 def query_instance_health(name) elb = Aws::ElasticLoadBalancing::Client.new elb.describe_instance_health({load_balancer_name: name}) end |
#query_instances(ids) ⇒ Object
32 33 34 35 |
# File 'lib/asg-detailer/infra.rb', line 32 def query_instances(ids) ec2 = Aws::EC2::Client.new ec2.describe_instances({ instance_ids: ids }) end |
#query_lc(name) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/asg-detailer/infra.rb', line 19 def query_lc(name) @asg.describe_launch_configurations({ launch_configuration_names: [ name, ], }) end |