С версии: 31.01.2013
Автор: Vitaliy Demidov (vitaliy@scalr.com)
Наследование: extends Scalr\Service\Aws\Ec2\AbstractEc2DataType
Пример #1
0
 /**
  * GetConsoleOutput action
  *
  * Retrieves console output for the specified instance.
  * Instance console output is buffered and posted shortly after instance boot, reboot, and termination.
  * Amazon EC2 preserves the most recent 64 KB output which will be available for at least one hour after
  * the most recent post.
  *
  * @param   string      $instanceId       The ID of the EC2 instance.
  * @return  GetConsoleOutputResponseData  Returns object which represents console output.
  * @throws  ClientException
  * @throws  Ec2Exception
  */
 public function getConsoleOutput($instanceId)
 {
     $result = null;
     $options = array('InstanceId' => (string) $instanceId);
     $response = $this->client->call(ucfirst(__FUNCTION__), $options);
     if ($response->getError() === false) {
         $sxml = simplexml_load_string($response->getRawContent());
         $response = null;
         $result = new GetConsoleOutputResponseData();
         $result->setEc2($this->ec2);
         $result->output = (string) $sxml->output;
         $result->timestamp = new DateTime((string) $sxml->timestamp, new DateTimeZone('UTC'));
         $result->instanceId = (string) $sxml->instanceId;
         $result->setRequestId((string) $sxml->requestId);
     }
     return $result;
 }