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

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

Batch Actions collapse

Instance Method Details

#batch_attach(options = {}) ⇒ void

This method returns an undefined value.

Parameters:

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


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

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
    Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
      batch[0].client.attach_load_balancers(params)
    end
  end
  nil
end

#batch_detach(options = {}) ⇒ void

This method returns an undefined value.

Parameters:

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


299
300
301
302
303
304
305
306
307
308
309
310
311
312
# File 'lib/aws-sdk-autoscaling/load_balancer.rb', line 299

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
    Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
      batch[0].client.detach_load_balancers(params)
    end
  end
  nil
end