disable_availability_zones_for_load_balancer ( $load_balancer_name, $availability_zones, $opt )

Removes the specified EC2 Availability Zones from the set of configured Availability Zones for the LoadBalancer.

There must be at least one Availability Zone registered with a LoadBalancer at all times. A client cannot remove all the Availability Zones from a LoadBalancer. Once an Availability Zone is removed, all the instances registered with the LoadBalancer that are in the removed Availability Zone go into the OutOfService state. Upon Availability Zone removal, the LoadBalancer attempts to equally balance the traffic among its remaining usable Availability Zones. Trying to remove an Availability Zone that was not associated with the LoadBalancer does nothing.

In order for this call to be successful, the client must have created the LoadBalancer. 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.

$availability_zones

string
array

Required

A list of Availability Zones to be removed from the LoadBalancer.

There must be at least one Availability Zone registered with a LoadBalancer at all times. The client cannot remove all the Availability Zones from a LoadBalancer. Specified Availability Zones must be in the same Region.

Pass a string for a single value, or an indexed array for multiple values.

$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

Disable availability zones for a load balancer.

$elb = new AmazonELB();

$response = $elb->disable_availability_zones_for_load_balancer('my-load-balancer', 'us-east-1b');

// 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 disable_availability_zones_for_load_balancer($load_balancer_name, $availability_zones, $opt = null)
{
    if (!$opt) $opt = array();
    $opt['LoadBalancerName'] = $load_balancer_name;
    
    // Required list (non-map)
    $opt = array_merge($opt, CFComplexType::map(array(
        'AvailabilityZones' => (is_array($availability_zones) ? $availability_zones : array($availability_zones))
    ), 'member'));

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

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback