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

Class: Aws::AutoScaling::Instance::Collection

Inherits:
Resources::Collection show all
Defined in:
gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/instance.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: {})


430
431
432
433
434
435
436
437
438
439
440
441
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/instance.rb', line 430

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[:instance_ids] ||= []
    batch.each do |item|
      params[:instance_ids] << item.id
    end
    batch[0].client.attach_instances(params)
  end
  nil
end

#batch_detach(options = {}) ⇒ void

This method returns an undefined value.

Examples:

Request syntax with placeholder values


instance.batch_detach({
  should_decrement_desired_capacity: false, # required
})

Parameters:

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

Options Hash (options):

  • :should_decrement_desired_capacity (required, Boolean)

    Indicates whether the Auto Scaling group decrements the desired capacity value by the number of instances detached.



453
454
455
456
457
458
459
460
461
462
463
464
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/instance.rb', line 453

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[:instance_ids] ||= []
    batch.each do |item|
      params[:instance_ids] << item.id
    end
    batch[0].client.detach_instances(params)
  end
  nil
end

#batch_enter_standby(options = {}) ⇒ void

This method returns an undefined value.

Examples:

Request syntax with placeholder values


instance.batch_enter_standby({
  should_decrement_desired_capacity: false, # required
})

Parameters:

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

Options Hash (options):

  • :should_decrement_desired_capacity (required, Boolean)

    Indicates whether to decrement the desired capacity of the Auto Scaling group by the number of instances moved to Standby mode.



476
477
478
479
480
481
482
483
484
485
486
487
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/instance.rb', line 476

def batch_enter_standby(options = {})
  batch_enum.each do |batch|
    params = Aws::Util.copy_hash(options)
    params[:auto_scaling_group_name] = batch[0].group_name
    params[:instance_ids] ||= []
    batch.each do |item|
      params[:instance_ids] << item.id
    end
    batch[0].client.enter_standby(params)
  end
  nil
end

#batch_exit_standby(options = {}) ⇒ void

This method returns an undefined value.

Parameters:

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


491
492
493
494
495
496
497
498
499
500
501
502
# File 'gems/aws-sdk-autoscaling/lib/aws-sdk-autoscaling/instance.rb', line 491

def batch_exit_standby(options = {})
  batch_enum.each do |batch|
    params = Aws::Util.copy_hash(options)
    params[:auto_scaling_group_name] = batch[0].group_name
    params[:instance_ids] ||= []
    batch.each do |item|
      params[:instance_ids] << item.id
    end
    batch[0].client.exit_standby(params)
  end
  nil
end