DownloadJobLogFiles
download_job_log_files(public_api_client, file_path, local_zip_file)
Expand source code
download_job_log_files(public_api_client, file_path, local_zip_file):
"""
Description
-----------
To download the job log file in .zip format
Args
----
public_api_client: QDC api client object.
file_path: file path to download returned by get_job_log_files API.
local_zip_file: local path where to download the file.
Returns
-------
True: if download is success
None: In case of failure.
Usages
------
qdc_api.download_job_log_files(public_api_client, "file path to download returned by get_job_log_files API", "c:\\temp\\file.zip")
"""
download_job_log_response = get_jobs_downloadlogs.sync_detailed(client=_get_client_with_new_trace_header(public_api_client), path=file_path)
if download_job_log_response.status_code == 200:
print(f"download job logs success: {file_path} to {local_zip_file}")
with open(local_zip_file, 'wb') as f:
f.write(download_job_log_response.content)
return True
else:
print(f"download job logs file failed: {file_path}")
return None
Description
To download the job log file in .zip format
Arguments
public_api_client: QDC api client object.
file_path: file path to download returned by get_job_log_files API.
local_zip_file: local path where to download the file.
Returns
True: if download is success
None: In case of failure.
Usages
qdc_api.download_job_log_files(public_api_client, "file path to download returned by get_job_log_files API", "c:\\temp\\file.zip")