CDN object services operations#

You can perform the operation described in this section on objects in your Cloud Files CDN-enabled containers.

The examples in this section use sample values for the following:

  • account — for example, MossoCloudFS_0672d7fa-9f85-4a81-a3ab-adb66a880123

  • X-Auth-Token — for example, f064c46a782c444cb4ba4b6434288f7c

  • container — for example, MyContainer

  • object — for example, MyObject

For your own requests, you must use your own account information, authentication token, container names, and object names. For more information, see Authenticate to the Rackspace Cloud. Your authentication token and your account information are in the service catalog that is produced.

Warning

You request this operation against a CDN management services URI, such as https://cdn2.clouddrive.com/v1/MossoCloudFS_aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee/, as shown in the table “Regionalized service endpoints for CDN management services” in the Service access endpoints section. If you use a Storage management services URI by mistake, you delete your object.

Delete CDN-enabled object#

DELETE /v1/{account}/{container}/{object}

This operation purges an object from the CDN.

When you find it necessary to remove a CDN-enabled object from public access before the TTL expires, you can perform a DELETE operation against the object, or you can create a support ticket to purge the entire container.

To delete containers that have been CDN-enabled in the past and are now disabled, but are still showing up when you use the List CDN-enabled containers operation, send a DELETE request with an x-remove-cdn-container: t header to remove them from the listing.

Warning

You request this operation against a CDN management services URI, such as https://cdn2.clouddrive.com/v1/MossoCloudFS_aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee/, as shown in the table “Regionalized service endpoints for CDN management service” in the Service Access endpoints section. If you use a Storage management services URI by mistake, you delete your object.

Note

You should limit object purges to situations in which serious personal, business, or security consequences could occur if the object remained publicly accessible on the CDN (for example, when someone publishes your company’s quarterly earnings too early).

You can purge objects from the CDN in the following ways:

By using DELETE in the API

You can manually purge CDN-enabled objects without having to wait for the TTL to expire, and you can optionally be notified by email that the object has been purged.

You can use the DELETE operation against a maximum of 25 objects per day by using the API.

An attempt to delete more objects results in a 498 (Rate Limited) status code.

Here is an example response for hitting the purge rate limit:

$ curl -i -XDELETE -H'x-auth-token: f064c46a782c444cb4ba4b6434288f7c' https://cdn1.clouddrive.com/v1/MossoCloudFS_0672d7fa-9f85-4a81-a3ab-adb66a880123/MyContainter/MyObject
HTTP/1.1 498 Rate Limited
Content-Length: 42
Content-Type: text/html; charset=UTF-8
X-Trans-Id: txb63f31d26bf84c058542b-0055101cd0dfw1
Date: Mon, 23 Mar 2015 14:01:52 GMT

By creating a support ticket to purge an entire container

The 25-object limit does not apply when purging an entire container through Support.

Note

To prevent the container from going back to the CDN, first change the X-CDN-Enabled flag to False as shown in CDN-enable and CDN-disable a container.

The system purges the object from the CDN and sends an email to the indicated address or addresses. If you want to notify more than one person about the deletion, you can enter a comma-separated list of addresses. The email address is optional.

A status code of 204 (No Content) indicates success. Status code 498 (Rate Limited) indicates that the account has reached its 25 object daily purge limit for CDN-enabled objects. Status code 403 (Forbidden) indicates that an authorization problem occurred.

Because there are so many edge servers around the world, purging objects might take a long time. Be patient while waiting for a response.

This table shows the possible response codes for this operation:

Response Code

Name

Description

204

No Content

The server fulfilled the request but does not need to return a body.

403

Forbidden

The server refused to respond to request.

498

Rate Limited

The account has reached the 25 object daily purge limit for CDN- enabled objects.

Request#

This table shows the URI parameters for the request:

Name

Type

Description

{account}

String

Your unique account identifier.

{container}

String

The unique identifier of the container.

{object}

String

The unique identifier of the object.

This operation does not accept a request body.

Example: Delete CDN-enabled object HTTP request

DELETE /v1/MossoCloudFS_0672d7fa-9f85-4a81-a3ab-adb66a880123/MyContainer/MyObject HTTP/1.1
Host: cdn2.clouddrive.com
X-Auth-Token: f064c46a782c444cb4ba4b6434288f7c
X-Purge-Email: user@domain.com, user2@domain.com

Response#

This operation does not return a response body.

Example: Delete CDN-enabled object HTTP response

HTTP/1.1 204 No Content
Content-Type: text/html; charset=UTF-8
Content-Length: 0
X-Trans-Id: txd57d75dcd51e4a79a886d-0055101ecford1
Date: Mon, 23 Mar 2015 14:10:25 GMT