Skip to content

stop_search_job

stop_search_job(
    search_job_identifier: GenericId,
    *,
    config_overrides: Optional[BackupSearchClientConfig] = None,
) -> StopSearchJobOutput

This operations ends a search job.

Only a search job with a status of RUNNING can be stopped.

Parameters:

  • search_job_identifier (GenericId) –

    The unique string that specifies the search job.

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action.

  • InternalServerException –

    An internal server error occurred. Retry your request.

  • ThrottlingException –

    The request was denied due to request throttling.

  • ValidationException –

    The input fails to satisfy the constraints specified by a service.

  • ConflictException –

    This exception occurs when a conflict with a previous successful operation is detected. This generally occurs when the previous operation did not have time to propagate to the host serving the current request.

    A retry (with appropriate backoff logic) is the recommended response to this exception.

  • ResourceNotFoundException –

    The resource was not found for this request.

    Confirm the resource information, such as the ARN or type is correct and exists, then retry the request.

  • UnknownServiceError –

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

Source code in docs_src/capo_backupsearch/_services/backup_search.py
def stop_search_job(
    self,
    search_job_identifier: "capo_backupsearch.types.generic_id.GenericId",
    *,
    config_overrides: Optional[BackupSearchClientConfig] = None,
) -> "capo_backupsearch.types.stop_search_job_output.StopSearchJobOutput":
    """<p>This operations ends a search job.</p> <p>Only a search job with a status of <code>RUNNING</code> can be stopped.</p>

    Args:
        search_job_identifier: <p>The unique string that specifies the search job.</p>

    Raises:
        capo_backupsearch.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_backupsearch.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry your request.</p>
        capo_backupsearch.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_backupsearch.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by a service.</p>
        capo_backupsearch.errors.conflict_exception.ConflictException: <p>This exception occurs when a conflict with a previous successful operation is detected. This generally occurs when the previous operation did not have time to propagate to the host serving the current request.</p> <p>A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
        capo_backupsearch.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource was not found for this request.</p> <p>Confirm the resource information, such as the ARN or type is correct and exists, then retry the request.</p>
        capo_backupsearch.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_backupsearch.types.stop_search_job_input.StopSearchJobInput]",
    ) -> OperationResponse[
        "capo_backupsearch.types.stop_search_job_output.StopSearchJobOutput"
    ]:
        import capo_backupsearch._operations.cryo_backup_search_service.stop_search_job

        output, http_response = (
            capo_backupsearch._operations.cryo_backup_search_service.stop_search_job.stop_search_job(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StopSearchJob")
    )
    input_: capo_backupsearch.types.stop_search_job_input.StopSearchJobInput = {
        "search_job_identifier": search_job_identifier
    }

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