+ dst_object, meta, self.public, **args)
+
+@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 CreateGroup(Command):
+ syntax = 'key=val [key=val] [...]'
+ description = 'create account groups'
+
+ 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('ungroup')
+class DeleteGroup(Command):
+ syntax = 'key [key] [...]'
+ description = 'delete account groups'
+
+ def execute(self, *args):
+ groups = []
+ for arg in args:
+ groups.append(arg)
+ self.client.unset_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)
+
+@cli_command('sharing')
+class SharingObject(Command):
+ syntax = 'list users sharing objects with the user'
+ description = 'list user accounts sharing objects with the user'
+
+ def add_options(self, parser):
+ parser.add_option('-l', action='store_true', dest='detail',
+ default=False, help='show detailed output')
+ parser.add_option('-n', action='store', type='int', dest='limit',
+ default=10000, help='show limited output')
+ parser.add_option('--marker', action='store', type='str',
+ dest='marker', default=None,
+ help='show output greater then marker')
+
+
+ def execute(self):
+ attrs = ['limit', 'marker']
+ args = self._build_args(attrs)
+ args['format'] = 'json' if self.detail else 'text'
+
+ print_list(self.client.list_shared_by_others(**args))
+
+@cli_command('send')
+class Send(Command):
+ syntax = '<file> <container>[/<prefix>]'
+ description = 'upload file to container (using prefix)'
+
+ def execute(self, file, path):
+ container, sep, prefix = path.partition('/')
+ upload(self.client, file, container, prefix)
+
+@cli_command('receive')
+class Receive(Command):
+ syntax = '<container>/<object> <file>'
+ description = 'download object to file'
+
+ def execute(self, path, file):
+ container, sep, object = path.partition('/')
+ download(self.client, container, object, file)