(ctx, **kwargs)
\b
    - DESCRIPTION:
        Download Log Files of A Specified Job.

    \b
    - USAGE:
        flow job log -j JOB_ID --output-path ./examples/
\b
    - DESCRIPTION:
        Download Log Files of A Specified Job.
\ b - DESCRIPTION : Download Log Files of A Specified Job .
def log(ctx, **kwargs):
    """
    \b
    - DESCRIPTION:
        Download Log Files of A Specified Job.

    \b
    - USAGE:
        flow job log -j JOB_ID --output-path ./examples/
    """
    config_data, dsl_data = preprocess(**kwargs)
    job_id = config_data['job_id']
    tar_file_name = 'job_{}_log.tar.gz'.format(job_id)
    extract_dir = os.path.join(config_data['output_path'], 'job_{}_log'.format(job_id))
    with closing(access_server('post', ctx, 'job/log/download', config_data, False, stream=True)) as response:
        if response.status_code == 200:
            download_from_request(http_response=response, tar_file_name=tar_file_name, extract_dir=extract_dir)
            res = {'retcode': 0,
                   'directory': extract_dir,
                   'retmsg': 'download successfully, please check {} directory'.format(extract_dir)}
        else:
            res = response.json() if isinstance(response, requests.models.Response) else response
    prettify(res)
def log ( ctx , * * kwargs ) : config_data , dsl_data = preprocess ( * * kwargs ) job_id = config_data [ 'job_id' ] tar_file_name = 'job_{}_log.tar.gz' . format ( job_id ) extract_dir = os . path . join ( config_data [ 'output_path' ] , 'job_{}_log' . format ( job_id ) ) with closing ( access_server ( 'post' , ctx , 'job/log/download' , config_data , False , stream = True ) ) as response : if response . status_code == 200 : download_from_request ( http_response = response , tar_file_name = tar_file_name , extract_dir = extract_dir ) res = { 'retcode' : 0 , 'directory' : extract_dir , 'retmsg' : 'download successfully, please check {} directory' . format ( extract_dir ) } else : res = response . json ( ) if isinstance ( response , requests . models . Response ) else response prettify ( res )