コード例 #1
0
def get_job_details(job_id):
    '''
    Retrieve the job details.
    To call this API, the form is:
    http://<host>:<port>/jobs/<job_id>
    Method: Get
    '''
    logger.info("Enter")
    response = None
    try:
        if not job_id:
            raise MissingDataException("Missing 'job_id'.")

        job_doc = job_service.get_job_details(job_id)
        response = make_response(json.jsonify(job_doc), 200)
    except (MissingDataException, RecordNotFoundException), e:
        response = _make_error_response(404, str(e))
コード例 #2
0
def get_job_details(job_id):
    '''
    Retrieve the job details.
    To call this API, the form is:
    http://<host>:<port>/jobs/<job_id>
    Method: Get
    '''
    logger.info("Enter")
    response = None
    try:
        if not job_id:
            raise MissingDataException("Missing 'job_id'.")

        job_doc = job_service.get_job_details(job_id)
        response = make_response(json.jsonify(job_doc), 200)
    except (MissingDataException, RecordNotFoundException), e:
        response = _make_error_response(404, str(e))
コード例 #3
0
def get_job_status(job_id):
    '''
    Retrieve the job status.
    The client should periodically call this api to get the latest job status.
    Job status includes: 'New', 'Executing', 'Failure' and 'Success'.
    To call this API, the form is:
    http://<host>:<port>/jobs/job-status/<job_id>
    Method: Get
    
    It returns a 'status' corresponding to above job_id.
    '''
    logger.info("Enter")
    response = None
    try:
        if not job_id:
            raise MissingDataException("Missing 'job_id'.")

        job_doc = job_service.get_job_details(job_id, {"_id": True, "status": True})
        response = make_response(json.jsonify(job_doc))
    except (MissingDataException, RecordNotFoundException), e:
        response = _make_error_response(404, str(e))
コード例 #4
0
def get_job_status(job_id):
    '''
    Retrieve the job status.
    The client should periodically call this api to get the latest job status.
    Job status includes: 'New', 'Executing', 'Failure' and 'Success'.
    To call this API, the form is:
    http://<host>:<port>/jobs/job-status/<job_id>
    Method: Get
    
    It returns a 'status' corresponding to above job_id.
    '''
    logger.info("Enter")
    response = None
    try:
        if not job_id:
            raise MissingDataException("Missing 'job_id'.")

        job_doc = job_service.get_job_details(job_id, {
            "_id": True,
            "status": True
        })
        response = make_response(json.jsonify(job_doc))
    except (MissingDataException, RecordNotFoundException), e:
        response = _make_error_response(404, str(e))