Skip to content

deactivate_pipeline async

deactivate_pipeline(
    pipeline_id: id,
    *,
    config_overrides: Optional[AsyncDataPipelineClientConfig] = None,
    cancel_active: Optional[cancelActive] = None,
) -> DeactivatePipelineOutput

Deactivates the specified running pipeline. The pipeline is set to the DEACTIVATING state until the deactivation process completes.

To resume a deactivated pipeline, use ActivatePipeline. By default, the pipeline resumes from the last completed execution. Optionally, you can specify the date and time to resume the pipeline.

Parameters:

  • pipeline_id (id) –

    The ID of the pipeline.

  • cancel_active (Optional[cancelActive], default: None ) –

    Indicates whether to cancel any running objects. The default is true, which sets the state of any running objects to CANCELED. If this value is false, the pipeline is deactivated after all running objects finish.

Raises:

  • InternalServiceError –

    An internal service error occurred.

  • InvalidRequestException –

    The request was not valid. Verify that your request was properly formatted, that the signature was generated with the correct credentials, and that you haven't exceeded any of the service limits for your account.

  • PipelineDeletedException –

    The specified pipeline has been deleted.

  • PipelineNotFoundException –

    The specified pipeline was not found. Verify that you used the correct user and account identifiers.

  • UnknownServiceError –

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

Source code in docs_src/capo_data_pipeline/_services/async_data_pipeline.py
async def deactivate_pipeline(
    self,
    pipeline_id: "capo_data_pipeline.types.id.id",
    *,
    config_overrides: Optional[AsyncDataPipelineClientConfig] = None,
    cancel_active: Optional[
        "capo_data_pipeline.types.cancel_active.cancelActive"
    ] = None,
) -> "capo_data_pipeline.types.deactivate_pipeline_output.DeactivatePipelineOutput":
    """<p>Deactivates the specified running pipeline. The pipeline is set to the <code>DEACTIVATING</code> state until the deactivation process completes.</p> <p>To resume a deactivated pipeline, use <a>ActivatePipeline</a>. By default, the pipeline resumes from the last completed execution. Optionally, you can specify the date and time to resume the pipeline.</p>

    Args:
        pipeline_id: <p>The ID of the pipeline.</p>
        cancel_active: <p>Indicates whether to cancel any running objects. The default is true, which sets the state of any running objects to <code>CANCELED</code>. If this value is false, the pipeline is deactivated after all running objects finish.</p>

    Raises:
        capo_data_pipeline.errors.internal_service_error.InternalServiceError: <p>An internal service error occurred.</p>
        capo_data_pipeline.errors.invalid_request_exception.InvalidRequestException: <p>The request was not valid. Verify that your request was properly formatted, that the signature was generated with the correct credentials, and that you haven't exceeded any of the service limits for your account.</p>
        capo_data_pipeline.errors.pipeline_deleted_exception.PipelineDeletedException: <p>The specified pipeline has been deleted.</p>
        capo_data_pipeline.errors.pipeline_not_found_exception.PipelineNotFoundException: <p>The specified pipeline was not found. Verify that you used the correct user and account identifiers.</p>
        capo_data_pipeline.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_data_pipeline.types.deactivate_pipeline_input.DeactivatePipelineInput]",
    ) -> AsyncOperationResponse[
        "capo_data_pipeline.types.deactivate_pipeline_output.DeactivatePipelineOutput"
    ]:
        import capo_data_pipeline._operations.data_pipeline.deactivate_pipeline

        (
            output,
            http_response,
        ) = await capo_data_pipeline._operations.data_pipeline.deactivate_pipeline.async_deactivate_pipeline(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeactivatePipeline")
    )
    input_: capo_data_pipeline.types.deactivate_pipeline_input.DeactivatePipelineInput = {
        "pipeline_id": pipeline_id
    }
    if cancel_active is not None:
        input_["cancel_active"] = cancel_active

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output