Scalr\Service\Aws\Ec2\V20140615\Ec2Api::allocateAddress PHP Метод

allocateAddress() публичный Метод

Acquires an Elastic IP address for use with your instances.
public allocateAddress ( string $domain = null ) : Scalr\Service\Aws\Ec2\DataType\AddressData
$domain string optional Set to vpc to allocate the address for use with instances in a VPC. Valid values: vpc. Condition: Required when allocating an address for use with instances in a VPC
Результат Scalr\Service\Aws\Ec2\DataType\AddressData Returns AddressData on success
    public function allocateAddress($domain = null)
    {
        $result = null;
        $options = array();
        if ($domain !== null) {
            $options['Domain'] = (string) $domain;
        }
        $response = $this->client->call(ucfirst(__FUNCTION__), $options);
        if ($response->getError() === false) {
            $sxml = simplexml_load_string($response->getRawContent());
            $result = new AddressData();
            $result->setEc2($this->ec2);
            $result->domain = (string) $sxml->domain;
            $result->publicIp = $this->exist($sxml->publicIp) ? (string) $sxml->publicIp : null;
            $result->allocationId = $this->exist($sxml->allocationId) ? (string) $sxml->allocationId : null;
        }
        return $result;
    }
Ec2Api