Method: Aws::Ec2#stop_instances

Defined in:
lib/ec2/ec2.rb

#stop_instances(list = []) ⇒ Object

Stop EBS-backed EC2 instances. Returns a list of instance state changes or an exception.

ec2.stop_instances(['i-f222222d', 'i-f222222e']) #=>
  [{:aws_instance_id         => "i-f222222d",
    :aws_current_state_code  => 64,
    :aws_current_state       => "stopping",
    :aws_prev_state_code     => 16,
    :aws_prev_state          => "running"},
   {:aws_instance_id         => "i-f222222e",
    :aws_current_state_code  => 64,
    :aws_current_state       => "stopping",
    :aws_prev_state_code     => 16,
    :aws_prev_state          => "running"}]


639
640
641
642
643
644
# File 'lib/ec2/ec2.rb', line 639

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