Scalr\Service\Aws\Ec2\V20150415\Ec2Api::getConsoleOutput PHP 메소드

getConsoleOutput() 공개 메소드

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.
public getConsoleOutput ( string $instanceId ) : GetConsoleOutputResponseData
$instanceId string The ID of the EC2 instance.
리턴 Scalr\Service\Aws\Ec2\DataType\GetConsoleOutputResponseData Returns object which represents console output.
    public function getConsoleOutput($instanceId)
    {
        $result = null;
        $options = ['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;
    }
Ec2Api