Scalr\Service\Aws\Ec2\V20140615\Ec2Api::describeAddresses PHP Method

describeAddresses() public method

Describes one or more of the Elastic IP addresses allocated to your account. This action applies to both EC2 and VPC Elastic IP addresses.
public describeAddresses ( ListDataType $publicIpList = null, ListDataType $allocationIdList = null, Scalr\Service\Aws\Ec2\DataType\AddressFilterList $filter = null ) : Scalr\Service\Aws\Ec2\DataType\AddressList
$publicIpList Scalr\Service\Aws\DataType\ListDataType optional One or more EC2 Elastic IP addresses
$allocationIdList Scalr\Service\Aws\DataType\ListDataType optional One or more allocation IDs corresponding to the address or addresses to describe (VPC addresses only).
$filter Scalr\Service\Aws\Ec2\DataType\AddressFilterList optional The filter list.
return Scalr\Service\Aws\Ec2\DataType\AddressList Returns AddressList on success
    public function describeAddresses(ListDataType $publicIpList = null, ListDataType $allocationIdList = null, AddressFilterList $filter = null)
    {
        $result = null;
        $options = array();
        if ($publicIpList !== null) {
            $options = array_merge($options, $publicIpList->getQueryArrayBare('PublicIp'));
        }
        if ($allocationIdList !== null) {
            $options = array_merge($options, $allocationIdList->getQueryArrayBare('AllocationId'));
        }
        if (!empty($filter)) {
            $options = array_merge($options, $filter->getQueryArrayBare('Filter'));
        }
        $response = $this->client->call(ucfirst(__FUNCTION__), $options);
        if ($response->getError() === false) {
            $sxml = simplexml_load_string($response->getRawContent());
            $response = null;
            $result = new AddressList();
            $result->setEc2($this->ec2);
            $result->setRequestId($sxml->requestId);
            if (isset($sxml->addressesSet->item)) {
                foreach ($sxml->addressesSet->item as $v) {
                    $item = new AddressData();
                    $item->setEc2($this->ec2);
                    $item->allocationId = $this->exist($v->allocationId) ? (string) $v->allocationId : null;
                    $item->associationId = $this->exist($v->associationId) ? (string) $v->associationId : null;
                    $item->domain = $this->exist($v->domain) ? (string) $v->domain : null;
                    $item->instanceId = $this->exist($v->instanceId) ? (string) $v->instanceId : null;
                    $item->publicIp = $this->exist($v->publicIp) ? (string) $v->publicIp : null;
                    $item->privateIpAddress = $this->exist($v->privateIpAddress) ? (string) $v->privateIpAddress : null;
                    $item->networkInterfaceId = $this->exist($v->networkInterfaceId) ? (string) $v->networkInterfaceId : null;
                    $item->networkInterfaceOwnerId = $this->exist($v->networkInterfaceOwnerId) ? (string) $v->networkInterfaceOwnerId : null;
                    $result->append($item);
                    unset($item);
                }
            }
        }
        return $result;
    }
Ec2Api