Deletes a job. This operation is idempotent. If the job is currently running, you must stop it before deleting it by calling StopJob.
The following operations are related to DeleteJob:
-
CreateJob
-
StopJob
-
DescribeJob
Parameters:
Raises:
Source code in docs_src/capo_sagemaker/_services/sage_maker.py
| def delete_job(
self,
*,
config_overrides: Optional[SageMakerClientConfig] = None,
job_name: Optional["capo_sagemaker.types.job_name.JobName"] = None,
job_category: Optional["capo_sagemaker.types.job_category.JobCategory"] = None,
) -> "capo_sagemaker.types.delete_job_response.DeleteJobResponse":
"""<p>Deletes a job. This operation is idempotent. If the job is currently running, you must stop it before deleting it by calling <code>StopJob</code>.</p> <p>The following operations are related to <code>DeleteJob</code>:</p> <ul> <li> <p> <code>CreateJob</code> </p> </li> <li> <p> <code>StopJob</code> </p> </li> <li> <p> <code>DescribeJob</code> </p> </li> </ul>
Args:
job_name: <p>The name of the job to delete.</p>
job_category: <p>The category of the job to delete.</p>
Raises:
capo_sagemaker.errors.resource_in_use.ResourceInUse: <p>Resource being accessed is in use.</p>
capo_sagemaker.errors.resource_not_found.ResourceNotFound: <p>Resource being access is not found.</p>
capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_sagemaker.types.delete_job_request.DeleteJobRequest]",
) -> OperationResponse[
"capo_sagemaker.types.delete_job_response.DeleteJobResponse"
]:
import capo_sagemaker._operations.sage_maker.delete_job
output, http_response = (
capo_sagemaker._operations.sage_maker.delete_job.delete_job(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteJob")
)
input_: capo_sagemaker.types.delete_job_request.DeleteJobRequest = {}
if job_name is not None:
input_["job_name"] = job_name
if job_category is not None:
input_["job_category"] = job_category
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|