예제 #1
0
 /**
  * List LBaaS Pools action (GET /lb/pools[/pool-id])
  *
  * @param   string                  $poolId  optional The ID of the Pool to show detailed info
  * @param   ListLbPoolsFilter|array $filter  optional The query filter.
  * @return  DefaultPaginationList|object Returns the list of the VIPs or the specified VIP
  * @throws  RestClientException
  */
 public function listLbPools($poolId = null, $filter = null)
 {
     if ($filter !== null && !$filter instanceof ListLbPoolsFilter) {
         $filter = ListLbPoolsFilter::initArray($filter);
     }
     return $this->getApiHandler()->listLbPools($poolId, $filter);
 }
예제 #2
0
파일: NetworkApi.php 프로젝트: scalr/scalr
 /**
  * List Pools action (GET /lb/pools[/pool-id])
  *
  * @param   string                $poolId  optional The ID of the Pool to show detailed info
  * @param   ListLbPoolsFilter     $filter  optional The query filter.
  * @return  DefaultPaginationList|object Returns the list of the Pools or the requested pool
  * @throws  RestClientException
  */
 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;
 }