"""Create a container"""
def main(self, container):
- if self.options.account:
- self.client.account = self.options.account
+ super(store_create, self).main()
self.client.create_container(container)
"""Get container info"""
def main(self, container):
- if self.options.account:
- self.client.account = self.options.account
+ super(store_container, self).main()
reply = self.client.get_container_meta(container)
print_dict(reply)
self.client.delete_object(path)
+@command(api='storage')
+class store_purge(_store_account_command):
+ """Purge a container"""
+
+ def main(self, container):
+ super(store_purge, self).main()
+ self.client.purge_container(container)
+
+
@command(api='astakos')
class astakos_authenticate(object):
"""Authenticate a user"""
import hashlib
import os
+from time import time
+
from ..utils import OrderedDict
from .storage import StorageClient
class PithosClient(StorageClient):
"""GRNet Pithos API client"""
-
+
+ def purge_container(self, container):
+ self.assert_account()
+
+ path = '/%s/%s' % (self.account, container)
+ params = {'until': int(time())}
+ self.delete(path, params=params, success=204)
+
def put_block(self, data, hash):
path = '/%s/%s' % (self.account, self.container)
params = {'update': ''}