Skip to content

create_restore_testing_plan async

create_restore_testing_plan(
    restore_testing_plan: RestoreTestingPlanForCreate,
    *,
    config_overrides: Optional[AsyncBackupClientConfig] = None,
    creator_request_id: Optional[str] = None,
    tags: Optional[SensitiveStringMap] = None,
) -> CreateRestoreTestingPlanOutput

Creates a restore testing plan.

The first of two steps to create a restore testing plan. After this request is successful, finish the procedure using CreateRestoreTestingSelection.

Parameters:

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

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

  • restore_testing_plan (RestoreTestingPlanForCreate) –

    A restore testing plan must contain a unique RestoreTestingPlanName string you create and must contain a ScheduleExpression cron. You may optionally include a StartWindowHours integer and a CreatorRequestId string.

    The RestoreTestingPlanName is a unique string that is the name of the restore testing plan. This cannot be changed after creation, and it must consist of only alphanumeric characters and underscores.

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

    The tags to assign to the restore testing plan.

Raises:

Source code in docs_src/capo_backup/_services/async_backup.py
async def create_restore_testing_plan(
    self,
    restore_testing_plan: "capo_backup.types.restore_testing_plan_for_create.RestoreTestingPlanForCreate",
    *,
    config_overrides: Optional[AsyncBackupClientConfig] = None,
    creator_request_id: Optional[str] = None,
    tags: Optional[
        "capo_backup.types.sensitive_string_map.SensitiveStringMap"
    ] = None,
) -> "capo_backup.types.create_restore_testing_plan_output.CreateRestoreTestingPlanOutput":
    """<p>Creates a restore testing plan.</p> <p>The first of two steps to create a restore testing plan. After this request is successful, finish the procedure using CreateRestoreTestingSelection.</p>

    Args:
        creator_request_id: <p>This is a unique string that identifies the request and allows failed requests to be retriedwithout the risk of running the operation twice. This parameter is optional. If used, this parameter must contain 1 to 50 alphanumeric or '-_.' characters.</p>
        restore_testing_plan: <p>A restore testing plan must contain a unique <code>RestoreTestingPlanName</code> string you create and must contain a <code>ScheduleExpression</code> cron. You may optionally include a <code>StartWindowHours</code> integer and a <code>CreatorRequestId</code> string.</p> <p>The <code>RestoreTestingPlanName</code> is a unique string that is the name of the restore testing plan. This cannot be changed after creation, and it must consist of only alphanumeric characters and underscores.</p>
        tags: <p>The tags to assign to the restore testing plan.</p>

    Raises:
        capo_backup.errors.already_exists_exception.AlreadyExistsException: <p>The required resource already exists.</p>
        capo_backup.errors.conflict_exception.ConflictException: <p>Backup can't perform the action that you requested until it finishes performing a previous action. Try again later.</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.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_plan_input.CreateRestoreTestingPlanInput]",
    ) -> AsyncOperationResponse[
        "capo_backup.types.create_restore_testing_plan_output.CreateRestoreTestingPlanOutput"
    ]:
        import capo_backup._operations.cryo_controller_user_manager.create_restore_testing_plan

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

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

        return capo_backup.types.create_restore_testing_plan_input.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateRestoreTestingPlan", redact_input=_redact_input),
    )
    input_: capo_backup.types.create_restore_testing_plan_input.CreateRestoreTestingPlanInput = {
        "restore_testing_plan": restore_testing_plan
    }
    if creator_request_id is not None:
        input_["creator_request_id"] = creator_request_id
    if tags is not None:
        input_["tags"] = tags

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