Skip to content

start_search_job

start_search_job(
    search_scope: SearchScope,
    *,
    config_overrides: Optional[BackupSearchClientConfig] = None,
    tags: Optional[TagMap] = None,
    name: Optional[str] = None,
    encryption_key_arn: Optional[EncryptionKeyArn] = None,
    client_token: Optional[str] = None,
    item_filters: Optional[ItemFilters] = None,
) -> StartSearchJobOutput

This operation creates a search job which returns recovery points filtered by SearchScope and items filtered by ItemFilters.

You can optionally include ClientToken, EncryptionKeyArn, Name, and/or Tags.

Parameters:

  • tags (Optional[TagMap], default: None ) –

    List of tags returned by the operation.

  • name (Optional[str], default: None ) –

    Include alphanumeric characters to create a name for this search job.

  • encryption_key_arn (Optional[EncryptionKeyArn], default: None ) –

    The encryption key for the specified search job.

  • client_token (Optional[str], default: None ) –

    Include this parameter to allow multiple identical calls for idempotency.

    A client token is valid for 8 hours after the first request that uses it is completed. After this time, any request with the same token is treated as a new request.

  • search_scope (SearchScope) –

    This object can contain BackupResourceTypes, BackupResourceArns, BackupResourceCreationTime, BackupResourceTags, and SourceResourceArns to filter the recovery points returned by the search job.

  • item_filters (Optional[ItemFilters], default: None ) –

    Item Filters represent all input item properties specified when the search was created.

    Contains either EBSItemFilters or S3ItemFilters

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.

  • ServiceQuotaExceededException –

    The request denied due to exceeding the quota limits permitted.

  • UnknownServiceError –

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

Source code in docs_src/capo_backupsearch/_services/backup_search.py
def start_search_job(
    self,
    search_scope: "capo_backupsearch.types.search_scope.SearchScope",
    *,
    config_overrides: Optional[BackupSearchClientConfig] = None,
    tags: Optional["capo_backupsearch.types.tag_map.TagMap"] = None,
    name: Optional[str] = None,
    encryption_key_arn: Optional[
        "capo_backupsearch.types.encryption_key_arn.EncryptionKeyArn"
    ] = None,
    client_token: Optional[str] = None,
    item_filters: Optional[
        "capo_backupsearch.types.item_filters.ItemFilters"
    ] = None,
) -> "capo_backupsearch.types.start_search_job_output.StartSearchJobOutput":
    """<p>This operation creates a search job which returns recovery points filtered by SearchScope and items filtered by ItemFilters.</p> <p>You can optionally include ClientToken, EncryptionKeyArn, Name, and/or Tags.</p>

    Args:
        tags: <p>List of tags returned by the operation.</p>
        name: <p>Include alphanumeric characters to create a name for this search job.</p>
        encryption_key_arn: <p>The encryption key for the specified search job.</p>
        client_token: <p>Include this parameter to allow multiple identical calls for idempotency.</p> <p>A client token is valid for 8 hours after the first request that uses it is completed. After this time, any request with the same token is treated as a new request.</p>
        search_scope: <p>This object can contain BackupResourceTypes, BackupResourceArns, BackupResourceCreationTime, BackupResourceTags, and SourceResourceArns to filter the recovery points returned by the search job.</p>
        item_filters: <p>Item Filters represent all input item properties specified when the search was created.</p> <p>Contains either EBSItemFilters or S3ItemFilters</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.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request denied due to exceeding the quota limits permitted.</p>
        capo_backupsearch.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_backupsearch.types.start_search_job_input.StartSearchJobInput]",
    ) -> OperationResponse[
        "capo_backupsearch.types.start_search_job_output.StartSearchJobOutput"
    ]:
        import capo_backupsearch._operations.cryo_backup_search_service.start_search_job

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("StartSearchJob")
    )
    input_: capo_backupsearch.types.start_search_job_input.StartSearchJobInput = {
        "search_scope": search_scope
    }
    if tags is not None:
        input_["tags"] = tags
    if name is not None:
        input_["name"] = name
    if encryption_key_arn is not None:
        input_["encryption_key_arn"] = encryption_key_arn
    if client_token is not None:
        input_["client_token"] = client_token
    if item_filters is not None:
        input_["item_filters"] = item_filters

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