Exemple #1
0
def archive(progname, configbase, options, args):
    """
    Prepare an archive of live research object
    archive <live-RO> <archive-id> [ --asynchronous ] [ --freeze ] [ -t <token> ]
    """
    ro_config = getroconfig(configbase, options)
    ro_options = {
        "rosrs_uri":          ro_config['rosrs_uri'],
        "rosrs_access_token": ro_config['rosrs_access_token'],
    }
    if options.verbose:
        to_print = "ro archive %(copy-from)s %(target)s -t %(rosrs_access_token)s" % dict(ro_options.items() + {'copy-from':args[2], 'target':args[3]}.items())
        if options.asynchronous:
            to_print+=" --asynchronous"
        if options.freeze:
            to_print+=" --freeze"
        print to_print
    return ro_evo.copy_operation(dict(vars(options).items() + ro_options.items()), args, "ARCHIVE")
Exemple #2
0
def snapshot(progname, configbase, options, args):
    """
    Prepare a snapshot of live research object
    snapshot <live-RO> <snapshot-id> [ --asynchronous ] [ --freeze ] [ -t <token> ]
    """
    ro_config = getroconfig(configbase, options)
    ro_options = {
        "rodir":          options.rodir or "",
        "rosrs_uri":          ro_config['rosrs_uri'],
        "rosrs_access_token": ro_config['rosrs_access_token'],
    }
    if options.verbose:
        to_print = "ro snapshot %(copy-from)s %(target)s -r %(rosrs_uri)s -t %(rosrs_access_token)s" % dict(ro_options.items() + {'copy-from':args[2], 'target':args[3]}.items())
        if options.asynchronous:
            to_print+=" --asynchronous"
        if options.freeze:
            to_print+=" --freeze"
        print to_print
    return ro_evo.copy_operation(dict(vars(options).items() + ro_options.items()), args,"SNAPSHOT")