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

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

Describes one or more of your subnets.
public describeSubnets ( ListDataType $subnetIdList = null, Scalr\Service\Aws\Ec2\DataType\SubnetFilterList $filter = null ) : Scalr\Service\Aws\Ec2\DataType\SubnetList
$subnetIdList Scalr\Service\Aws\DataType\ListDataType optional A subnet ID list.
$filter Scalr\Service\Aws\Ec2\DataType\SubnetFilterList optional The list of the filters.
Результат Scalr\Service\Aws\Ec2\DataType\SubnetList Returns the list of found subnets on success.
    public function describeSubnets(ListDataType $subnetIdList = null, SubnetFilterList $filter = null)
    {
        $result = null;
        $options = array();
        if ($subnetIdList !== null) {
            $options = array_merge($options, $subnetIdList->getQueryArrayBare('SubnetId'));
        }
        if ($filter !== null) {
            $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 SubnetList();
            $result->setEc2($this->ec2);
            $result->setRequestId((string) $sxml->requestId);
            if (isset($sxml->subnetSet->item)) {
                foreach ($sxml->subnetSet->item as $v) {
                    $item = $this->_loadSubnetData($v);
                    $result->append($item);
                    unset($item);
                }
            }
        }
        return $result;
    }
Ec2Api