delete_oai ( $identity_id, $etag, $opt )

Deletes an Amazon CloudFront origin access identity (OAI). To delete an OAI, the identity must first be disassociated from all distributions (by updating each distribution’s configuration to omit the OriginAccessIdentity element). Wait until each distribution’s state is Deployed before deleting the OAI.

Access

public

Parameters

Parameter

Type

Required

Description

$identity_id

string

Required

An Identity ID for an existing OAI.

$etag

string

Required

The ETag header value retrieved from a call to get_oai().

$opt

array

Optional

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

  • 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

Delete an OAI.

// Create a new CloudFront distribution from an S3 bucket.
$cdn = new AmazonCloudFront();

$oai = $cdn->get_oai('E3HV63EQPFPPOA');

// Was the request successful?
if ($oai->isOK())
{
	$etag = $oai->header['etag'];
	$response = $cdn->delete_oai('E3HV63EQPFPPOA', $etag);

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

Related Methods

See Also

Source

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

public function delete_oai($identity_id, $etag, $opt = null)
{
    if (!$opt) $opt = array();

    $path = '/origin-access-identity/cloudfront/' . $identity_id;

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

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

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback