Example #1
0
 /**
  * DescribeLoadBalancers action
  *
  * Returns detailed configuration information for the specified LoadBalancers. If no LoadBalancers are
  * specified, the operation returns configuration information for all LoadBalancers created by the caller.
  *
  * @param  array|ListDataType $loadBalancerNamesList optional A list of names associated
  *                                  with the LoadBalancers at creation time.
  * @param  string  $marker optional An optional parameter reserved for future use.
  * @return LoadBalancerDescriptionList Returns the list of LoadBalancerDescriptionData.
  * @throws ClientException
  */
 public function describeLoadBalancers(ListDataType $loadBalancerNamesList = null, $marker = null)
 {
     $result = null;
     if ($loadBalancerNamesList !== null) {
         $options = $loadBalancerNamesList->getQueryArray('LoadBalancerNames');
     } else {
         $options = array();
     }
     if ($marker !== null) {
         $options['Marker'] = $marker;
     }
     $response = $this->client->call('DescribeLoadBalancers', $options);
     if ($response->getError() === false) {
         //Success
         $loader = new DescribeLoadBalancersLoader($this->elb);
         $loader->load($response->getRawContent());
         $result = $loader->getResult();
         if ($result instanceof LoadBalancerDescriptionList) {
             $em = $this->getEntityManager();
             foreach ($result as $loadBalancerDescription) {
                 $em->attach($loadBalancerDescription);
             }
         }
     }
     return $result;
 }