Commit 6657ec8c authored by Stavros Sachtouris's avatar Stavros Sachtouris
Browse files

Pithos level extentions added

get_account_info now supports until parameter, and if-(un)modified-since headers
in request
parent a2ed3c3e
......@@ -141,6 +141,25 @@ class PithosClient(StorageClient):
self.set_header('X-Account-Group-'+group, '')
r = self.post(path, success=202)
def get_account_info(self, until = None, if_modified_since=None, if_unmodified_since=None):
""" @param until (string): optional timestamp
@param if_modified_since (string): Retrieve if account has changed since provided timestamp
@param if_unmodified_since (string): Retrieve if account has not changed since provided timestamp
"""
self.assert_account()
path = path4url(self.account)
path += '' if until is None else params4url({'until':until})
if if_modified_since is not None:
self.set_header('If-Modified-Since', if_modified_since)
if if_modified_since is not None:
self.set_header('If-Unmodified-Since', if_unmodified_since)
r = self.head(path, success=(204, 401))
if r.status_code == 401:
raise ClientError("No authorization")
return r.headers
def get_account_quota(self):
return filter_in(self.get_account_info(), 'X-Account-Policy-Quota', exactMatch = True)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment