Skip to content

delete_compilation_job

delete_compilation_job(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    compilation_job_name: Optional[EntityName] = None,
) -> None

Deletes the specified compilation job. This action deletes only the compilation job resource in Amazon SageMaker AI. It doesn't delete other resources that are related to that job, such as the model artifacts that the job creates, the compilation logs in CloudWatch, the compiled model, or the IAM role.

You can delete a compilation job only if its current status is COMPLETED, FAILED, or STOPPED. If the job status is STARTING or INPROGRESS, stop the job, and then delete it after its status becomes STOPPED.

Parameters:

  • compilation_job_name (Optional[EntityName], default: None ) –

    The name of the compilation job to delete.

Raises:

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def delete_compilation_job(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    compilation_job_name: Optional[
        "capo_sagemaker.types.entity_name.EntityName"
    ] = None,
) -> None:
    """<p>Deletes the specified compilation job. This action deletes only the compilation job resource in Amazon SageMaker AI. It doesn't delete other resources that are related to that job, such as the model artifacts that the job creates, the compilation logs in CloudWatch, the compiled model, or the IAM role.</p> <p>You can delete a compilation job only if its current status is <code>COMPLETED</code>, <code>FAILED</code>, or <code>STOPPED</code>. If the job status is <code>STARTING</code> or <code>INPROGRESS</code>, stop the job, and then delete it after its status becomes <code>STOPPED</code>.</p>

    Args:
        compilation_job_name: <p>The name of the compilation job to delete.</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.delete_compilation_job_request.DeleteCompilationJobRequest]",
    ) -> OperationResponse[None]:
        import capo_sagemaker._operations.sage_maker.delete_compilation_job

        output, http_response = (
            capo_sagemaker._operations.sage_maker.delete_compilation_job.delete_compilation_job(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteCompilationJob")
    )
    input_: capo_sagemaker.types.delete_compilation_job_request.DeleteCompilationJobRequest = {}
    if compilation_job_name is not None:
        input_["compilation_job_name"] = compilation_job_name

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output