AbortJob

abort_job(public_api_client, job_id)
Expand source code
abort_job(public_api_client, job_id):
"""
Description
-----------
To abort submitted job.
Args
----
public_api_client: QDC api client object.
job_id: Job id which needs to be aborted.
Returns
-------
string: State of the job id.
None: In case of any failure.
Usages
------
job_id = "1234"
abort_job = qdc_api.abort_job(public_api_client, job_id)
"""
abort = post_jobs_job_id_abort.sync_detailed(client=get_client_with_headers_added(public_api_client), job_id=job_id)
if abort.status_code == 200:
response_data = abort.content.decode('utf-8')
print(f"Abortjob: {job_id} is successful, response: {response_data}")
return abort.parsed.result

Description

To abort submitted job.

Arguments

  • public_api_client: QDC api client object.
  • job_id: Job id which needs to be aborted.

Returns

  • string: State of the job id.
  • None: In case of any failure.

Usages

job_id = "1234"
abort_job = qdc_api.abort_job(public_api_client, job_id)