get_distribution_info ( $distribution_id, $opt )

Gets distribution information for the specified distribution ID.

Standard distributions are handled separately from streaming distributions. For streaming distributions, set the Streaming option to true.

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:

  • Streaming - boolean - Optional - Whether or not this should be for a streaming distribution. A value of true will create a streaming distribution. A value of false will create a standard distribution. The default value is false.
  • 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

Get the current information from a given distribution.

// Get distribution info
$cdn = new AmazonCloudFront();

$response = $cdn->get_distribution_info('E2L6A3OZHQT5W4');

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

Get the current information from a given streaming distribution.

// Get distribution info
$cdn = new AmazonCloudFront();

$response = $cdn->get_distribution_info('E2L6A3OZHQT5W4', array(
	'Streaming' => true
));

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

Related Methods

See Also

Source

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

public function get_distribution_info($distribution_id, $opt = null)
{
    if (!$opt) $opt = array();

    $path = '/' . ((isset($opt['Streaming']) && $opt['Streaming'] == (bool) true) ? 'streaming-distribution' : 'distribution');
    $path .= '/' . $distribution_id;

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

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

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback