Exemplo n.º 1
0
def get_log(args):
    """Print log"""
    status = resources.get_job_status(args.id)
    if status != "DONE" and status != "ERROR":
        print "Cannot get log until the job is done. Job status: %s." % status
        return
    log = resources.get_log(args.id)
    if log == "":
        print "No data returned"
        return
    print log
Exemplo n.º 2
0
def get_log(args):
    """Print log"""
    status = resources.get_job_status(args.id)
    if status != "DONE" and status != "ERROR":
        print "Cannot get log until the job is done. Job status: %s." % status
        return
    log = resources.get_log(args.id)
    if log == "":
        print "No data returned"
        return
    print log
Exemplo n.º 3
0
def delete_job(args):
    """Delete a job"""
    status = resources.get_job_status(args.id)
    if status != "DONE" and status != "ERROR":
        print "Cannot delete until the job is done. Job status: %s." % status
        return
    
    result = resources.delete_job(args.id)
    if result != None:
        print "Job deleted"
    else:
        print "Error deleting job"
Exemplo n.º 4
0
def delete_job(args):
    """Delete a job"""
    status = resources.get_job_status(args.id)
    if status != "DONE" and status != "ERROR":
        print "Cannot delete until the job is done. Job status: %s." % status
        return

    result = resources.delete_job(args.id)
    if result != None:
        print "Job deleted"
    else:
        print "Error deleting job"
Exemplo n.º 5
0
def get_log(job_id):
    """Print log"""
    if job_id == None or job_id == "":
        print "ID required"
        return
    status = resources.get_job_status(job_id)
    if status != "DONE":
        print "Cannot get log until the job is done. Job status: %s." % status
        return
    log = resources.get_log(job_id)
    if log == "":
        print "No data returned"
        return
    print log
Exemplo n.º 6
0
def get_result(args):
    """Write the job result to disk"""
    status = resources.get_job_status(args.id)
    if status != "DONE":
        print "Cannot get result until the job is done. Job status: %s." % status
        return
    
    response = resources.get_result(args.id)
    if response == None:
        print "No data returned"
        return
    
    path = "/tmp/%s.zip" % args.id
    zipfile = open(path, "wb")
    zipfile.write(response)
    zipfile.close()
Exemplo n.º 7
0
def delete_job(job_id):
    """Delete a job"""
    if job_id == None or job_id == "":
        print "ID required"
        return
    
    status = resources.get_job_status(job_id)
    if status != "DONE":
        print "Cannot delete until the job is done. Job status: %s." % status
        return
    
    result = resources.delete_job(job_id)
    if result != None:
        print "Job deleted"
    else:
        print "Error deleting job"
Exemplo n.º 8
0
def get_result(args):
    """Write the job result to disk"""
    status = resources.get_job_status(args.id)
    if status != "DONE":
        print "Cannot get result until the job is done. Job status: %s." % status
        return

    response = resources.get_result(args.id)
    if response == None:
        print "No data returned"
        return

    path = "/tmp/%s.zip" % args.id
    zipfile = open(path, "wb")
    zipfile.write(response)
    zipfile.close()