Stops a running job. When you call StopJob, Amazon SageMaker sets the job status to Stopping. After the job stops, the status changes to Stopped. Partial results may be available in the output location if the job was in progress. To delete a stopped job, call DeleteJob.
The following operations are related to StopJob:
-
CreateJob
-
DescribeJob
-
DeleteJob
Parameters:
Raises:
Source code in docs_src/capo_sagemaker/_services/sage_maker.py
| def stop_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.stop_job_response.StopJobResponse":
"""<p>Stops a running job. When you call <code>StopJob</code>, Amazon SageMaker sets the job status to <code>Stopping</code>. After the job stops, the status changes to <code>Stopped</code>. Partial results may be available in the output location if the job was in progress. To delete a stopped job, call <code>DeleteJob</code>.</p> <p>The following operations are related to <code>StopJob</code>:</p> <ul> <li> <p> <code>CreateJob</code> </p> </li> <li> <p> <code>DescribeJob</code> </p> </li> <li> <p> <code>DeleteJob</code> </p> </li> </ul>
Args:
job_name: <p>The name of the job to stop.</p>
job_category: <p>The category of the job to stop.</p>
Raises:
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.stop_job_request.StopJobRequest]",
) -> OperationResponse[
"capo_sagemaker.types.stop_job_response.StopJobResponse"
]:
import capo_sagemaker._operations.sage_maker.stop_job
output, http_response = (
capo_sagemaker._operations.sage_maker.stop_job.stop_job(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("StopJob")
)
input_: capo_sagemaker.types.stop_job_request.StopJobRequest = {}
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
|