Skip to content

Commit

Permalink
Merge pull request #209 from flipkin/patch-1
Browse files Browse the repository at this point in the history
added function to request the status of a cloudfront invalidation request
  • Loading branch information
garnaat committed May 24, 2011
2 parents 46a69bc + 60033dc commit 6003090
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions boto/cloudfront/__init__.py
Expand Up @@ -246,3 +246,16 @@ def create_invalidation_request(self, distribution_id, paths,
else:
raise CloudFrontServerError(response.status, response.reason, body)

def invalidation_request_status (self, distribution_id, request_id, caller_reference=None):
uri = '/%s/distribution/%s/invalidation/%s' % (self.Version, distribution_id, request_id )
response = self.make_request('GET', uri, {'Content-Type' : 'text/xml'})
body = response.read()
if response.status == 200:
paths = InvalidationBatch([])
h = handler.XmlHandler(paths, self)
xml.sax.parseString(body, h)
return paths
else:
raise CloudFrontServerError(response.status, response.reason, body)


0 comments on commit 6003090

Please sign in to comment.