+ dst_object, public, headers)
+
+@cli_command('remove')
+class TrashObject(Command):
+ syntax = '<container>/<object>'
+ description = 'trash an object'
+
+ def execute(self, src):
+ src_container, sep, src_object = src.partition('/')
+
+ self.client.trash_object(src_container, src_object)
+
+@cli_command('restore')
+class RestoreObject(Command):
+ syntax = '<container>/<object>'
+ description = 'restore a trashed object'
+
+ def execute(self, src):
+ src_container, sep, src_object = src.partition('/')
+
+ self.client.restore_object(src_container, src_object)
+
+@cli_command('unset')
+class UnsetObject(Command):
+ syntax = '<container>/[<object>] key [key] [...]'
+ description = 'delete metadata info'
+
+ def execute(self, path, *args):
+ #in case of account fix the args
+ if len(args) == 0:
+ args = list(args)
+ args.append(path)
+ args = tuple(args)
+ path = ''
+ meta = []
+ for key in args:
+ meta.append(key)
+ container, sep, object = path.partition('/')
+ if object:
+ self.client.delete_object_metadata(container, object, meta)
+ elif container:
+ self.client.delete_container_metadata(container, meta)
+ else:
+ self.client.delete_account_metadata(meta)
+
+@cli_command('group')
+class SetGroup(Command):
+ syntax = 'key=val [key=val] [...]'
+ description = 'set group account info'
+
+ def execute(self, *args):
+ groups = {}
+ for arg in args:
+ key, sep, val = arg.partition('=')
+ groups[key] = val
+ self.client.set_account_groups(**groups)
+
+@cli_command('policy')
+class SetPolicy(Command):
+ syntax = 'container key=val [key=val] [...]'
+ description = 'set container policies'
+
+ def execute(self, path, *args):
+ if path.find('=') != -1:
+ raise Fault('Missing container argument')
+
+ container, sep, object = path.partition('/')
+
+ if object:
+ raise Fault('Only containers have policies')
+
+ policies = {}
+ for arg in args:
+ key, sep, val = arg.partition('=')
+ policies[key] = val
+
+ self.client.set_container_policies(container, **policies)
+
+@cli_command('publish')
+class PublishObject(Command):
+ syntax = '<container>/<object>'
+ description = 'publish an object'
+
+ def execute(self, src):
+ src_container, sep, src_object = src.partition('/')
+
+ self.client.publish_object(src_container, src_object)
+
+@cli_command('unpublish')
+class UnpublishObject(Command):
+ syntax = '<container>/<object>'
+ description = 'unpublish an object'
+
+ def execute(self, src):
+ src_container, sep, src_object = src.partition('/')
+
+ self.client.unpublish_object(src_container, src_object)