deregister_instances_from_load_balancer ( $load_balancer_name, $instances, $opt )

Deregisters instances from the LoadBalancer. Once the instance is deregistered, it will stop receiving traffic from the LoadBalancer.

In order to successfully call this API, the same account credentials as those used to create the LoadBalancer must be provided.

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.

$instances

array

Required

A list of EC2 instance IDs consisting of all instances to be deregistered.

  • x - array - Optional - This represents a simple array index.
    • InstanceId - string - Optional - Provides an EC2 instance ID.

$opt

array

Optional

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

  • 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

Deregister one or more EC2 instances from a load balancer.

$elb = new AmazonELB();

$response = $elb->deregister_instances_from_load_balancer('my-load-balancer', 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 (12 lines) | View on GitHub

public function deregister_instances_from_load_balancer($load_balancer_name, $instances, $opt = null)
{
    if (!$opt) $opt = array();
    $opt['LoadBalancerName'] = $load_balancer_name;
    
    // Required list + map
    $opt = array_merge($opt, CFComplexType::map(array(
        'Instances' => (is_array($instances) ? $instances : array($instances))
    ), 'member'));

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

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback