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

Inherits:
Resources::Collection
  • Object
show all
Defined in:
sig/instance.rbs,
lib/aws-sdk-autoscaling/instance.rb

Batch Actions collapse

Instance Method Details

#batch_attach(options = {}) ⇒ void

This method returns an undefined value.

Parameters:

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


511
512
513
514
515
516
517
518
519
520
521
522
523
524
# File 'lib/aws-sdk-autoscaling/instance.rb', line 511

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



536
537
538
539
540
541
542
543
544
545
546
547
548
549
# File 'lib/aws-sdk-autoscaling/instance.rb', line 536

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



561
562
563
564
565
566
567
568
569
570
571
572
573
574
# File 'lib/aws-sdk-autoscaling/instance.rb', line 561

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

#batch_exit_standby(options = {}) ⇒ void

This method returns an undefined value.

Parameters:

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


578
579
580
581
582
583
584
585
586
587
588
589
590
591
# File 'lib/aws-sdk-autoscaling/instance.rb', line 578

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