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 formatArgs----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 successNone: 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_headers_added(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:# Write the byte content to the filef.write(download_job_log_response.content)return Trueelse: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 successNone
: 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")