You are viewing documentation for version 3 of the AWS SDK for Ruby. Version 2 documentation can be found here.

Class: Aws::AutoScaling::LoadBalancer::Collection

Inherits:
Resources::Collection show all
Defined in:
gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/load_balancer.rb

Batch Actions collapse

Methods inherited from Resources::Collection

#each, #first, #limit, #size

Instance Method Details

#batch_attach(options = {}) ⇒ void

This method returns an undefined value.

Parameters:

  • options ({}) (defaults to: {})


270
271
272
273
274
275
276
277
278
279
280
281
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/load_balancer.rb', line 270

def batch_attach(options = {})
  batch_enum.each do |batch|
    params = Aws::Util.copy_hash(options)
    params[:auto_scaling_group_name] = batch[0].group_name
    params[:load_balancer_names] ||= []
    batch.each do |item|
      params[:load_balancer_names] << item.name
    end
    batch[0].client.attach_load_balancers(params)
  end
  nil
end

#batch_detach(options = {}) ⇒ void

This method returns an undefined value.

Parameters:

  • options ({}) (defaults to: {})


285
286
287
288
289
290
291
292
293
294
295
296
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/load_balancer.rb', line 285

def batch_detach(options = {})
  batch_enum.each do |batch|
    params = Aws::Util.copy_hash(options)
    params[:auto_scaling_group_name] = batch[0].group_name
    params[:load_balancer_names] ||= []
    batch.each do |item|
      params[:load_balancer_names] << item.name
    end
    batch[0].client.detach_load_balancers(params)
  end
  nil
end