/** * 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; }