Revision f63cf249 tools/store

b/tools/store
47 47
import time as _time
48 48
import os
49 49

  
50
#DEFAULT_HOST = 'pithos.dev.grnet.gr'
51
DEFAULT_HOST = '127.0.0.1:8000'
52
DEFAULT_API = 'v1'
50
DEFAULT_HOST = 'pithos.dev.grnet.gr'
51
#DEFAULT_HOST = '127.0.0.1:8000'
52
#DEFAULT_API = 'v1'
53 53

  
54 54
_cli_commands = {}
55 55

  
......
186 186
@cli_command('meta')
187 187
class Meta(Command):
188 188
    syntax = '[<container>[/<object>]]'
189
    description = 'get the metadata of an account, a container or an object'
189
    description = 'get account/container/object metadata'
190 190
    
191 191
    def add_options(self, parser):
192 192
        parser.add_option('-r', action='store_true', dest='restricted',
......
319 319

  
320 320
@cli_command('put')
321 321
class PutObject(Command):
322
    syntax = '<container>/<object> <path> [key=val] [...]'
322
    syntax = '<container>/<object> [key=val] [...]'
323 323
    description = 'create/override object'
324 324
    
325 325
    def add_options(self, parser):
......
417 417
            dst_container = src_container
418 418
            dst_object = dst
419 419
        version = getattr(self, 'version')
420
        headers = None
420 421
        if version:
421 422
            headers = {}
422 423
            headers['X_SOURCE_VERSION'] = version
......
431 432
@cli_command('set')
432 433
class SetMeta(Command):
433 434
    syntax = '[<container>[/<object>]] key=val [key=val] [...]'
434
    description = 'set metadata'
435
    description = 'set account/container/object metadata'
435 436
    
436 437
    def execute(self, path, *args):
437 438
        #in case of account fix the args
......
498 499
            headers['X_OBJECT_MANIFEST'] = self.manifest
499 500
        if self.sharing:
500 501
            headers['X_OBJECT_SHARING'] = self.sharing
501
        
502 502
        if self.no_sharing:
503 503
            headers['X_OBJECT_SHARING'] = ''
504 504
        
......
596 596
            self.client.delete_account_metadata(meta)
597 597

  
598 598
@cli_command('group')
599
class SetGroup(Command):
599
class CreateGroup(Command):
600 600
    syntax = 'key=val [key=val] [...]'
601
    description = 'set group account info'
601
    description = 'create account groups'
602 602
    
603 603
    def execute(self, *args):
604 604
        groups = {}
......
607 607
            groups[key] = val
608 608
        self.client.set_account_groups(**groups)
609 609

  
610
@cli_command('ungroup')
611
class DeleteGroup(Command):
612
    syntax = 'key [key] [...]'
613
    description = 'delete account groups'
614
    
615
    def execute(self, *args):
616
        groups = []
617
        for arg in args:
618
            groups.append(arg)
619
        self.client.unset_account_groups(groups)
620

  
610 621
@cli_command('policy')
611 622
class SetPolicy(Command):
612 623
    syntax = 'container key=val [key=val] [...]'

Also available in: Unified diff