Skip to content

update_restore_testing_selection async

update_restore_testing_selection(
    restore_testing_plan_name: str,
    restore_testing_selection: RestoreTestingSelectionForUpdate,
    restore_testing_selection_name: str,
    *,
    config_overrides: Optional[AsyncBackupClientConfig] = None,
) -> UpdateRestoreTestingSelectionOutput

Updates the specified restore testing selection.

Most elements except the RestoreTestingSelectionName can be updated with this request.

You can use either protected resource ARNs or conditions, but not both.

Parameters:

  • restore_testing_plan_name (str) –

    The restore testing plan name is required to update the indicated testing plan.

  • restore_testing_selection (RestoreTestingSelectionForUpdate) –

    To update your restore testing selection, you can use either protected resource ARNs or conditions, but not both. That is, if your selection has ProtectedResourceArns, requesting an update with the parameter ProtectedResourceConditions will be unsuccessful.

  • restore_testing_selection_name (str) –

    The required restore testing selection name of the restore testing selection you wish to update.

Raises:

Source code in docs_src/capo_backup/_services/async_backup.py
async def update_restore_testing_selection(
    self,
    restore_testing_plan_name: str,
    restore_testing_selection: "capo_backup.types.restore_testing_selection_for_update.RestoreTestingSelectionForUpdate",
    restore_testing_selection_name: str,
    *,
    config_overrides: Optional[AsyncBackupClientConfig] = None,
) -> "capo_backup.types.update_restore_testing_selection_output.UpdateRestoreTestingSelectionOutput":
    """<p>Updates the specified restore testing selection.</p> <p>Most elements except the <code>RestoreTestingSelectionName</code> can be updated with this request.</p> <p>You can use either protected resource ARNs or conditions, but not both.</p>

    Args:
        restore_testing_plan_name: <p>The restore testing plan name is required to update the indicated testing plan.</p>
        restore_testing_selection: <p>To update your restore testing selection, you can use either protected resource ARNs or conditions, but not both. That is, if your selection has <code>ProtectedResourceArns</code>, requesting an update with the parameter <code>ProtectedResourceConditions</code> will be unsuccessful.</p>
        restore_testing_selection_name: <p>The required restore testing selection name of the restore testing selection you wish to update.</p>

    Raises:
        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.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.update_restore_testing_selection_input.UpdateRestoreTestingSelectionInput]",
    ) -> AsyncOperationResponse[
        "capo_backup.types.update_restore_testing_selection_output.UpdateRestoreTestingSelectionOutput"
    ]:
        import capo_backup._operations.cryo_controller_user_manager.update_restore_testing_selection

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

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

        return capo_backup.types.update_restore_testing_selection_input.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "UpdateRestoreTestingSelection", redact_input=_redact_input
        ),
    )
    input_: capo_backup.types.update_restore_testing_selection_input.UpdateRestoreTestingSelectionInput = {
        "restore_testing_plan_name": restore_testing_plan_name,
        "restore_testing_selection": restore_testing_selection,
        "restore_testing_selection_name": restore_testing_selection_name,
    }

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