Пример #1
0
 /**
  * List LBaaS VIPs action (GET /lb/vips[/vip-id])
  *
  * @param   string                 $vipId  optional The ID of the VIP to show detailed info
  * @param   ListLbVipsFilter|array $filter optional The query filter.
  * @return  DefaultPaginationList|object Returns the list of the VIPs or the specified VIP
  * @throws  RestClientException
  */
 public function listLbVips($vipId = null, $filter = null)
 {
     if ($filter !== null && !$filter instanceof ListLbVipsFilter) {
         $filter = ListLbVipsFilter::initArray($filter);
     }
     return $this->getApiHandler()->listLbVips($vipId, $filter);
 }
Пример #2
0
 /**
  * List VIPs action (GET /lb/vips[/vip-id])
  *
  * @param   string               $vipId  optional The ID of the VIP to show detailed info
  * @param   ListLbVipsFilter     $filter optional The query filter.
  * @return  DefaultPaginationList|object Returns the list of the VIPs or the requested VIP
  * @throws  RestClientException
  */
 public function listLbVips($vipId = null, ListLbVipsFilter $filter = null)
 {
     $result = null;
     $detailed = $vipId !== null ? sprintf("/%s", $this->escape($vipId)) : '';
     $response = $this->getClient()->call($this->service, '/lb/vips' . $detailed . ($filter !== null ? '?' . $filter->getQueryString() : ''));
     if ($response->hasError() === false) {
         $result = json_decode($response->getContent());
         if (empty($detailed)) {
             $result = new DefaultPaginationList($this->service, 'vips', $result->vips, isset($result->vips_links) ? $result->vips_links : null);
         } else {
             $result = $result->vip;
         }
     }
     return $result;
 }