С версии: 17.07.2013
Автор: Vitaliy Demidov (vitaliy@scalr.com)
Наследование: extends Scalr\Service\Aws\Ec2\AbstractEc2DataType
Пример #1
0
 /**
  * GetPasswordData action
  *
  * 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.
  *
  * @param   string      $instanceId       A Windows instance ID.
  * @return  GetPasswordDataResponseData      Returns object which represents console output.
  * @throws  ClientException
  * @throws  Ec2Exception
  */
 public function getPasswordData($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 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;
 }