list_stacks ( $opt )

Returns the summary information for stacks whose status matches the specified StackStatusFilter. Summary information for stacks that have been deleted is kept for 90 days after the stack is deleted. If no StackStatusFilter is specified, summary information for all stacks is returned (including existing stacks and stacks that have been deleted).

Access

public

Parameters

Parameter

Type

Required

Description

$opt

array

Optional

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

  • NextToken - string - Optional - String that identifies the start of the next list of stacks, if there is one. Default: There is no default value.
  • StackStatusFilter - string|array - Optional - Stack status to use as a filter. Specify one or more stack status codes to list only stacks with the specified status codes. For a complete list of stack status codes, see the StackStatus parameter of the Stack data type. Pass a string for a single value, or an indexed array for multiple values.
  • 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

List all stacks.

$stack = new AmazonCloudFormation();

$response = $stack->list_stacks();

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

List specific stacks.

$stack = new AmazonCloudFormation();

// Get a list of stacks that match a particular stack status
$response = $stack->list_stacks(array(
	'StackStatusFilter' => array('CREATE_COMPLETE')
));

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

Source

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

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

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

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback