Scalr\Service\OpenStack\Services\Network\V2\NetworkApi::listLbPools PHP Метод

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

List Pools action (GET /lb/pools[/pool-id])
public listLbPools ( string $poolId = null, Scalr\Service\OpenStack\Services\Network\Type\ListLbPoolsFilter $filter = null ) : Scalr\Service\OpenStack\Type\DefaultPaginationList | object
$poolId string optional The ID of the Pool to show detailed info
$filter Scalr\Service\OpenStack\Services\Network\Type\ListLbPoolsFilter optional The query filter.
Результат Scalr\Service\OpenStack\Type\DefaultPaginationList | object Returns the list of the Pools or the requested pool
    public function listLbPools($poolId = null, ListLbPoolsFilter $filter = null)
    {
        $result = null;
        $detailed = $poolId !== null ? sprintf("/%s", $this->escape($poolId)) : '';
        $response = $this->getClient()->call($this->service, '/lb/pools' . $detailed . ($filter !== null ? '?' . $filter->getQueryString() : ''));
        if ($response->hasError() === false) {
            $result = json_decode($response->getContent());
            if (empty($detailed)) {
                $result = new DefaultPaginationList($this->service, 'pools', $result->pools, isset($result->pools_links) ? $result->pools_links : null);
            } else {
                $result = $result->pool;
            }
        }
        return $result;
    }