describe_auto_scaling_groups ( $opt )

Returns a full description of each Auto Scaling group in the given list. This includes all Amazon EC2 instances that are members of the group. If a list of names is not provided, the service returns the full details of all Auto Scaling groups.

This action supports pagination by returning a token if there are more pages to retrieve. To get the next page, call this action again with the returned token as the NextToken parameter.

Access

public

Parameters

Parameter

Type

Required

Description

$opt

array

Optional

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

  • AutoScalingGroupNames - string|array - Optional - A list of Auto Scaling group names. Pass a string for a single value, or an indexed array for multiple values.
  • NextToken - string - Optional - A string that marks the start of the next batch of returned results. [Constraints: The value must match the following regular expression pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*]
  • MaxRecords - integer - Optional - The maximum number of records to return.
  • 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 all auto scaling groups.

// Instantiate the class
$as = new AmazonAS();

$response = $as->describe_auto_scaling_groups();

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

Describe specific scaling groups.

// Instantiate the class
$as = new AmazonAS();

// Fetch list of all LaunchConfigurationName that contain the word "Test".
$response = $as->describe_auto_scaling_groups();
$list_of_group_names = $response->body->query('//AutoScalingGroupName[contains(., "Test")]')->map_string();

// Pass the list (array) into a new request.
$response = $as->describe_auto_scaling_groups(array(
	'AutoScalingGroupNames' => $list_of_group_names
));

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

Related Methods

Source

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

public function describe_auto_scaling_groups($opt = null)
{
    if (!$opt) $opt = array();
            
    // Optional list (non-map)
    if (isset($opt['AutoScalingGroupNames']))
    {
        $opt = array_merge($opt, CFComplexType::map(array(
            'AutoScalingGroupNames' => (is_array($opt['AutoScalingGroupNames']) ? $opt['AutoScalingGroupNames'] : array($opt['AutoScalingGroupNames']))
        ), 'member'));
        unset($opt['AutoScalingGroupNames']);
    }

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

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback