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

getPasswordData() 공개 메소드

Retrieves the encrypted administrator password for an instance running Windows. Note! The Windows password is only generated the first time an AMI is launched. It is not generated for rebundled AMIs or after the password is changed on an instance. The password is encrypted using the key pair that you provided.
public getPasswordData ( string $instanceId ) : GetPasswordDataResponseData
$instanceId string A Windows instance ID.
리턴 Scalr\Service\Aws\Ec2\DataType\GetPasswordDataResponseData Returns object which represents console output.
    public function getPasswordData($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 GetPasswordDataResponseData();
            $result->setEc2($this->ec2);
            $result->passwordData = (string) $sxml->passwordData;
            $result->timestamp = new DateTime((string) $sxml->timestamp, new DateTimeZone('UTC'));
            $result->instanceId = (string) $sxml->instanceId;
            $result->setRequestId((string) $sxml->requestId);
        }
        return $result;
    }
Ec2Api