Method: Aws::Ec2#terminate_instances

Defined in:
lib/ec2/ec2.rb

#terminate_instances(list = []) ⇒ Object

Terminates EC2 instances. Returns a list of termination params or an exception.

ec2.terminate_instances(['i-f222222d','i-f222222e']) #=>
  [{:aws_shutdown_state      => "shutting-down",
    :aws_instance_id         => "i-f222222d",
    :aws_shutdown_state_code => 32,
    :aws_prev_state          => "running",
    :aws_prev_state_code     => 16},
   {:aws_shutdown_state      => "shutting-down",
    :aws_instance_id         => "i-f222222e",
    :aws_shutdown_state_code => 32,
    :aws_prev_state          => "running",
    :aws_prev_state_code     => 16}]


618
619
620
621
622
623
# File 'lib/ec2/ec2.rb', line 618

def terminate_instances(list=[])
  link = generate_request("TerminateInstances", hash_params('InstanceId', list.to_a))
  request_info(link, QEc2TerminateInstancesParser.new(:logger => @logger))
rescue Exception
  on_exception
end