list_invalidations ( $distribution_id, $opt )

Gets a list of invalidations. By default, the list is returned as one result. If needed, paginate the list by specifying values for the MaxItems and Marker parameters.

Access

public

Parameters

Parameter

Type

Required

Description

$distribution_id

string

Required

The distribution ID returned from create_distribution() or list_distributions().

$opt

array

Optional

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

  • Marker - string - Optional - Use this when paginating results to indicate where in the list of invalidations to begin. The results include invalidations in the list that occur after the marker. To get the next page of results, set the Marker parameter to the value of the NextMarker parameter from the current page’s response, which is also the ID of the last invalidation on that page.
  • MaxItems - integer - Optional - The maximum number of invalidations you want in the response body. A maximum value of 100 can be used.
  • 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 pending or recent invalidations.

// Update the XML content
$cdn = new AmazonCloudFront();
$response = $cdn->list_invalidations('E2L6A3OZHQT5W4');

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

Related Methods

See Also

Source

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

public function list_invalidations($distribution_id, $opt = null)
{
    if (!$opt) $opt = array();
    $opt['query_string'] = array();

    // Pass these to the query string
    foreach (array('Marker', 'MaxItems') as $option)
    {
        if (isset($opt[$option]))
        {
            $opt['query_string'][$option] = $opt[$option];
        }
    }

    $path = '/distribution/' . $distribution_id . '/invalidation';

    $opt = array_merge($opt, array('path' => $path));

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

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback