コード例 #1
0
 public function testModifyingAnInstanceAttribute()
 {
     self::log("\n[#4] Modify the attributes of an instance.");
     $instanceId = $this->runAnInstance();
     self::log('Stop the instance.');
     $this->client->getCommand('StopInstances', array('InstanceIds' => array($instanceId)))->execute();
     self::log('Wait until the instance is stopped.');
     $this->client->waitUntilInstanceStopped(array('InstanceIds' => array($instanceId)));
     self::log('Change the stopped instance from a micro to a small.');
     $this->client->getCommand('ModifyInstanceAttribute', array('InstanceId' => $instanceId, 'Attribute' => 'instanceType', 'Value' => InstanceType::M1_SMALL))->execute();
     self::log('Start the instance back up.');
     $this->client->getCommand('StartInstances', array('InstanceIds' => array($instanceId)))->execute();
     self::log('Wait until the instance is running.');
     $this->client->waitUntilInstanceRunning(array('InstanceIds' => array($instanceId)));
     $this->terminateAnInstance($instanceId);
 }