Skip to content

create_restore_testing_selection async

create_restore_testing_selection(
    restore_testing_plan_name: str,
    restore_testing_selection: RestoreTestingSelectionForCreate,
    *,
    config_overrides: Optional[AsyncBackupClientConfig] = None,
    creator_request_id: Optional[str] = None,
) -> CreateRestoreTestingSelectionOutput

This request can be sent after CreateRestoreTestingPlan request returns successfully. This is the second part of creating a resource testing plan, and it must be completed sequentially.

This consists of RestoreTestingSelectionName, ProtectedResourceType, and one of the following:

  • ProtectedResourceArns

  • ProtectedResourceConditions

Each protected resource type can have one single value.

A restore testing selection can include a wildcard value ("*") for ProtectedResourceArns along with ProtectedResourceConditions. Alternatively, you can include up to 30 specific protected resource ARNs in ProtectedResourceArns.

Cannot select by both protected resource types AND specific ARNs. Request will fail if both are included.

Parameters:

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

    This is an optional unique string that identifies the request and allows failed requests to be retried without the risk of running the operation twice. If used, this parameter must contain 1 to 50 alphanumeric or '-_.' characters.

  • restore_testing_plan_name (str) –

    Input the restore testing plan name that was returned from the related CreateRestoreTestingPlan request.

  • restore_testing_selection (RestoreTestingSelectionForCreate) –

    This consists of RestoreTestingSelectionName, ProtectedResourceType, and one of the following:

    • ProtectedResourceArns

    • ProtectedResourceConditions

    Each protected resource type can have one single value.

    A restore testing selection can include a wildcard value ("*") for ProtectedResourceArns along with ProtectedResourceConditions. Alternatively, you can include up to 30 specific protected resource ARNs in ProtectedResourceArns.

Raises:

Source code in docs_src/capo_backup/_services/async_backup.py
async def create_restore_testing_selection(
    self,
    restore_testing_plan_name: str,
    restore_testing_selection: "capo_backup.types.restore_testing_selection_for_create.RestoreTestingSelectionForCreate",
    *,
    config_overrides: Optional[AsyncBackupClientConfig] = None,
    creator_request_id: Optional[str] = None,
) -> "capo_backup.types.create_restore_testing_selection_output.CreateRestoreTestingSelectionOutput":
    """<p>This request can be sent after CreateRestoreTestingPlan request returns successfully. This is the second part of creating a resource testing plan, and it must be completed sequentially.</p> <p>This consists of <code>RestoreTestingSelectionName</code>, <code>ProtectedResourceType</code>, and one of the following:</p> <ul> <li> <p> <code>ProtectedResourceArns</code> </p> </li> <li> <p> <code>ProtectedResourceConditions</code> </p> </li> </ul> <p>Each protected resource type can have one single value.</p> <p>A restore testing selection can include a wildcard value ("*") for <code>ProtectedResourceArns</code> along with <code>ProtectedResourceConditions</code>. Alternatively, you can include up to 30 specific protected resource ARNs in <code>ProtectedResourceArns</code>.</p> <p>Cannot select by both protected resource types AND specific ARNs. Request will fail if both are included.</p>

    Args:
        creator_request_id: <p>This is an optional unique string that identifies the request and allows failed requests to be retried without the risk of running the operation twice. If used, this parameter must contain 1 to 50 alphanumeric or '-_.' characters.</p>
        restore_testing_plan_name: <p>Input the restore testing plan name that was returned from the related CreateRestoreTestingPlan request.</p>
        restore_testing_selection: <p>This consists of <code>RestoreTestingSelectionName</code>, <code>ProtectedResourceType</code>, and one of the following:</p> <ul> <li> <p> <code>ProtectedResourceArns</code> </p> </li> <li> <p> <code>ProtectedResourceConditions</code> </p> </li> </ul> <p>Each protected resource type can have one single value.</p> <p>A restore testing selection can include a wildcard value ("*") for <code>ProtectedResourceArns</code> along with <code>ProtectedResourceConditions</code>. Alternatively, you can include up to 30 specific protected resource ARNs in <code>ProtectedResourceArns</code>.</p>

    Raises:
        capo_backup.errors.already_exists_exception.AlreadyExistsException: <p>The required resource already exists.</p>
        capo_backup.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>Indicates that something is wrong with a parameter's value. For example, the value is out of range.</p>
        capo_backup.errors.limit_exceeded_exception.LimitExceededException: <p>A limit in the request has been exceeded; for example, a maximum number of items allowed in a request.</p>
        capo_backup.errors.missing_parameter_value_exception.MissingParameterValueException: <p>Indicates that a required parameter is missing.</p>
        capo_backup.errors.resource_not_found_exception.ResourceNotFoundException: <p>A resource that is required for the action doesn't exist.</p>
        capo_backup.errors.service_unavailable_exception.ServiceUnavailableException: <p>The request failed due to a temporary failure of the server.</p>
        capo_backup.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_backup.types.create_restore_testing_selection_input.CreateRestoreTestingSelectionInput]",
    ) -> AsyncOperationResponse[
        "capo_backup.types.create_restore_testing_selection_output.CreateRestoreTestingSelectionOutput"
    ]:
        import capo_backup._operations.cryo_controller_user_manager.create_restore_testing_selection

        (
            output,
            http_response,
        ) = await capo_backup._operations.cryo_controller_user_manager.create_restore_testing_selection.async_create_restore_testing_selection(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_backup.types.create_restore_testing_selection_input.CreateRestoreTestingSelectionInput",
    ) -> dict[str, Any]:
        import capo_backup.types.create_restore_testing_selection_input

        return capo_backup.types.create_restore_testing_selection_input.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateRestoreTestingSelection", redact_input=_redact_input
        ),
    )
    input_: capo_backup.types.create_restore_testing_selection_input.CreateRestoreTestingSelectionInput = {
        "restore_testing_plan_name": restore_testing_plan_name,
        "restore_testing_selection": restore_testing_selection,
    }
    if creator_request_id is not None:
        input_["creator_request_id"] = creator_request_id

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