Skip to content

delete_pipeline

delete_pipeline(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    pipeline_name: Optional[PipelineName] = None,
    client_request_token: Optional[IdempotencyToken] = None,
) -> DeletePipelineResponse

Deletes a pipeline if there are no running instances of the pipeline. To delete a pipeline, you must stop all running instances of the pipeline using the StopPipelineExecution API. When you delete a pipeline, all instances of the pipeline are deleted.

Parameters:

  • pipeline_name (Optional[PipelineName], default: None ) –

    The name of the pipeline to delete.

  • client_request_token (Optional[IdempotencyToken], default: None ) –

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the operation. An idempotent operation completes no more than one time.

Raises:

  • ConflictException –

    There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceNotFound –

    Resource being access is not found.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def delete_pipeline(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    pipeline_name: Optional[
        "capo_sagemaker.types.pipeline_name.PipelineName"
    ] = None,
    client_request_token: Optional[
        "capo_sagemaker.types.idempotency_token.IdempotencyToken"
    ] = None,
) -> "capo_sagemaker.types.delete_pipeline_response.DeletePipelineResponse":
    """<p>Deletes a pipeline if there are no running instances of the pipeline. To delete a pipeline, you must stop all running instances of the pipeline using the <code>StopPipelineExecution</code> API. When you delete a pipeline, all instances of the pipeline are deleted.</p>

    Args:
        pipeline_name: <p>The name of the pipeline to delete.</p>
        client_request_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the operation. An idempotent operation completes no more than one time.</p>

    Raises:
        capo_sagemaker.errors.conflict_exception.ConflictException: <p>There was a conflict when you attempted to modify a SageMaker entity such as an <code>Experiment</code> or <code>Artifact</code>.</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_pipeline_request.DeletePipelineRequest]",
    ) -> OperationResponse[
        "capo_sagemaker.types.delete_pipeline_response.DeletePipelineResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.delete_pipeline

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeletePipeline")
    )
    input_: capo_sagemaker.types.delete_pipeline_request.DeletePipelineRequest = {}
    if pipeline_name is not None:
        input_["pipeline_name"] = pipeline_name
    if client_request_token is None:
        client_request_token = str(uuid.uuid4())
    input_["client_request_token"] = client_request_token

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