| « PreviousNext » | |
![]() ![]() | Did this page help you? Yes | No | Tell us about it... |
This action creates a new invalidation batch request. For more information about invalidation, go to Invalidating Objects in the Amazon CloudFront Developer Guide.
Important
You can only invalidate objects that are served by a download distribution. You cannot invalidate objects that are served by a streaming distribution.
To create an invalidation batch request, you do a POST on the
2013-05-12/distribution/
resource. The request body must include an XML document with an distribution ID/invalidationInvalidationBatch element. The response echoes
the InvalidationBatch element and returns other information about the invalidation batch.
Important
Beginning with the 2012-05-05 version of the CloudFront API, we made substantial changes to the format of the XML document
that you include in the request body when you create or update a download distribution or a streaming distribution,
and when you invalidate objects. With previous versions of the API, we discovered that it was too easy to accidentally
delete one or more values for an element that accepts multiple values, for example, CNAMEs and trusted signers.
Our changes for the 2012-05-05 release are intended to prevent these accidental deletions and to notify you when
there's a mismatch between the number of values you say you're specifying in the Quantity element and
the number of values you're actually specifying.
POST /2013-05-12/distribution/distribution ID/invalidation HTTP/1.0 Host: cloudfront.amazonaws.com Authorization:AWS authentication stringContent-Type: text/xmlOther required headers<?xml version="1.0" encoding="UTF-8"?> <InvalidationBatch xmlns="http://cloudfront.amazonaws.com/doc/2013-05-12/"> <Paths> <Quantity>number of objects to invalidate</Quantity> <Items> <Path>/path to object to invalidate</Path> </Items> </Paths> <CallerReference>unique identifier for this invalidation batch</CallerReference> </InvalidationBatch>
The request must include the headers required in all CloudFront requests. For more information, see Common REST Headers.
| Name | Description |
|---|---|
| The batch information for the invalidation. For more information, see InvalidationBatch Complex Type. Type: Default: None |
HTTP/1.0 201 Created Content-Type: text/xml Location: https://cloudfront.amazonaws.com/2013-05-12/distribution/distribution ID/invalidation/invalidation ID<Invalidation xmlns="http://cloudfront.amazonaws.com/doc/2013-05-12/"> <Id>id that CloudFront assigned to the invalidation</Id> <Status>InProgress | Completed</Status> <CreateTime>date and time of request</CreateTime> <InvalidationBatch> <Paths> <Quantity>number of objects to invalidate</Quantity> <Items> <Path>/path to object to invalidate</Path> </Items> </Paths> <CallerReference>unique identifier for this invalidation batch</CallerReference> </InvalidationBatch> </Invalidation>
| Name | Description |
|---|---|
|
The fully qualified URI of the distribution and invalidation batch request, including the Invalidation ID. Type: String |
| Name | Description |
|---|---|
| Information about the invalidation. For more information, see Invalidation Complex Type. Type: |
The following table lists the special errors returned in addition to the common errors that all actions return. For more information, see Errors.
| Error | Description | HTTP Status Code |
|---|---|---|
| You have exceeded the maximum number of allowable | 400 |
The following example request creates a new invalidation batch request. The request invalidates two image objects and a Flash movie object.
POST /2013-05-12/distribution/distribution ID/invalidation HTTP/1.0 Host: cloudfront.amazonaws.com Authorization:AWS authentication stringContent-Type: text/xml <InvalidationBatch xmlns="http://cloudfront.amazonaws.com/doc/2013-05-12/"> <Paths> <Quantity>3</Quantity> <Items> <Path>/image1.jpg</Path> <Path>/image2.jpg</Path> <Path>/videos/movie.flv</Path> </Items> </Paths> <CallerReference>20120301090001</CallerReference> </InvalidationBatch>
HTTP/1.0 201 Created Content-Type: text/xml Location: https://cloudfront.amazonaws.com/2013-05-12/distribution/distribution ID/invalidation/invalidation ID<Invalidation xmlns="http://cloudfront.amazonaws.com/doc/2013-05-12/"> <Id>IDFDVBD632BHDS5</Id> <Status>InProgress</Status> <CreateTime>2009-11-19T19:37:58Z</CreateTime> <InvalidationBatch> <Paths> <Quantity>3</Quantity> <Items> <Path>/image1.jpg</Path> <Path>/image2.jpg</Path> <Path>/videos/movie.flv</Path> </Items> </Paths> <CallerReference>20120301090001</CallerReference> </InvalidationBatch> </Invalidation>