Example #1
0
 /**
  * Lists load balancer rules.
  *
  * @param ListBalancerRulesData|array $filter    List load balancer rules request data
  * @param PaginationType        $pagination     Pagination data
  * @return BalancerResponseList|null
  */
 public function listRules($filter = null, PaginationType $pagination = null)
 {
     if ($filter !== null && !$filter instanceof ListBalancerRulesData) {
         $filter = ListBalancerRulesData::initArray($filter);
     }
     return $this->getApiHandler()->listLoadBalancerRules($filter, $pagination);
 }
Example #2
0
 /**
  * Lists load balancer rules.
  *
  * @param ListBalancerRulesData $requestData    List load balancer rules request data
  * @param PaginationType        $pagination     Pagination data
  * @return BalancerResponseList|null
  */
 public function listLoadBalancerRules(ListBalancerRulesData $requestData = null, PaginationType $pagination = null)
 {
     $result = null;
     $args = array();
     if ($requestData !== null) {
         $args = $requestData->toArray();
     }
     if ($pagination !== null) {
         $args = array_merge($args, $pagination->toArray());
     }
     $response = $this->getClient()->call('listLoadBalancerRules', $args);
     if ($response->hasError() === false) {
         $resultObject = $response->getResult();
         if (!empty($resultObject) && property_exists($resultObject, 'count') && $resultObject->count > 0) {
             $result = $this->_loadBalancerResponseList($resultObject->loadbalancerrule);
         }
     }
     return $result;
 }