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: {})


274
275
276
277
278
279
280
281
282
283
284
285
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/load_balancer.rb', line 274

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: {})


289
290
291
292
293
294
295
296
297
298
299
300
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/load_balancer.rb', line 289

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