Gets a list of origin access identity (OAI) summaries. By default, the list is returned as one result.
If needed, paginate the list by specifying values for the MaxItems
and Marker
parameters.
Access
Parameters
Parameter |
Type |
Required |
Description |
$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 your list of distributions to begin. The results include distributions in the list that occur after the marker. To get the next page of results, set the Marker to the value of the NextMarker from the current page’s response (which is also the ID of the last distribution on that page).MaxItems - integer - Optional - The maximum number of distributions you want in the response body. Maximum of 100.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
Examples
List all OAIs.
// Create a new CloudFront distribution from an S3 bucket.
$cdn = new AmazonCloudFront();
$response = $cdn->list_oais();
// Success?
var_dump($response->isOK());
Result:
bool(true)
List a single OAI.
// Create a new CloudFront distribution from an S3 bucket.
$cdn = new AmazonCloudFront();
$response = $cdn->list_oais(array(
'MaxItems' => 1
));
// 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_oais($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 = '/origin-access-identity/cloudfront';
$opt = array_merge($opt, array('path' => $path));
return $this->authenticate('GET', $opt);
}