/**
  * @param string $instanceId The ID of a running instance to terminate
  */
 protected function terminateAnInstance($instanceId)
 {
     self::log('Terminate the instance.');
     $this->client->getCommand('TerminateInstances', array('InstanceIds' => array($instanceId)))->execute();
     self::log('Wait until the instance is terminated.');
     $this->client->waitUntil('InstanceTerminated', array('InstanceIds' => array($instanceId)));
 }
示例#2
0
 public function testWaitsForSnapshots()
 {
     $this->setMockResponse($this->client, array('ec2/describe_snapshots_pending', 'ec2/describe_snapshots_completed', 'ec2/describe_instances_two_instances_same_state'));
     $this->client->waitUntil('SnapshotCompleted', array('SnapshotIds' => array('snap-1a2b3c4d'), 'waiter.interval' => 0));
     $this->assertEquals(2, count($this->getMockedRequests()));
 }