describe_instance_health ( $load_balancer_name, $opt )

Returns the current state of the instances of the specified LoadBalancer. If no instances are specified, the state of all the instances for the LoadBalancer is returned.

The client must have created the specified input LoadBalancer in order to retrieve this information; the client must provide the same account credentials as those that were used to create the LoadBalancer.

Access

public

Parameters

Parameter

Type

Required

Description

$load_balancer_name

string

Required

The name associated with the LoadBalancer. The name must be unique within the client AWS account.

$opt

array

Optional

An associative array of parameters that can have the following keys:

  • Instances - array - Optional - A list of instance IDs whose states are being queried.
    • x - array - Optional - This represents a simple array index.
      • InstanceId - string - Optional - Provides an EC2 instance ID.
  • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
  • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.

Returns

Type

Description

CFResponse

A CFResponse object containing a parsed HTTP response.

Examples

Describe the health of an instance.

$elb = new AmazonELB();

$response = $elb->describe_instance_health('my-load-balancer');

// Success?
var_dump($response->isOK());
Result:
bool(true)

Describe the health of a specific set of instances.

$elb = new AmazonELB();

$response = $elb->describe_instance_health('my-load-balancer', array(
	'Instances' => array(
		array('InstanceId' => 'i-7e8d2913')
		array('InstanceId' => 'i-8f9e4217')
	)
));

// Success?
var_dump($response->isOK());
Result:
bool(true)

Related Methods

Source

Method defined in services/elb.class.php | Toggle source view (16 lines) | View on GitHub

public function describe_instance_health($load_balancer_name, $opt = null)
{
    if (!$opt) $opt = array();
    $opt['LoadBalancerName'] = $load_balancer_name;
    
    // Optional list + map
    if (isset($opt['Instances']))
    {
        $opt = array_merge($opt, CFComplexType::map(array(
            'Instances' => $opt['Instances']
        ), 'member'));
        unset($opt['Instances']);
    }

    return $this->authenticate('DescribeInstanceHealth', $opt);
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback