Skip to content

start_recovery async

start_recovery(
    source_servers: StartRecoveryRequestSourceServers,
    *,
    config_overrides: Optional[AsyncdrsClientConfig] = None,
    is_drill: Optional[bool] = None,
    tags: Optional[TagsMap] = None,
) -> StartRecoveryResponse

Launches Recovery Instances for the specified Source Servers. For each Source Server you may choose a point in time snapshot to launch from, or use an on demand snapshot.

Parameters:

  • source_servers (StartRecoveryRequestSourceServers) –

    The Source Servers that we want to start a Recovery Job for.

  • is_drill (Optional[bool], default: None ) –

    Whether this Source Server Recovery operation is a drill or not.

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

    The tags to be associated with the Recovery Job.

Raises:

Source code in docs_src/capo_drs/_services/async_drs.py
async def start_recovery(
    self,
    source_servers: "capo_drs.types.start_recovery_request_source_servers.StartRecoveryRequestSourceServers",
    *,
    config_overrides: Optional[AsyncdrsClientConfig] = None,
    is_drill: Optional[bool] = None,
    tags: Optional["capo_drs.types.tags_map.TagsMap"] = None,
) -> "capo_drs.types.start_recovery_response.StartRecoveryResponse":
    """<p>Launches Recovery Instances for the specified Source Servers. For each Source Server you may choose a point in time snapshot to launch from, or use an on demand snapshot.</p>

    Args:
        source_servers: <p>The Source Servers that we want to start a Recovery Job for.</p>
        is_drill: <p>Whether this Source Server Recovery operation is a drill or not.</p>
        tags: <p>The tags to be associated with the Recovery Job.</p>

    Raises:
        capo_drs.errors.conflict_exception.ConflictException: <p>The request could not be completed due to a conflict with the current state of the target resource.</p>
        capo_drs.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception or failure.</p>
        capo_drs.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request could not be completed because its exceeded the service quota.</p>
        capo_drs.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_drs.errors.uninitialized_account_exception.UninitializedAccountException: <p>The account performing the request has not been initialized.</p>
        capo_drs.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_drs.types.start_recovery_request.StartRecoveryRequest]",
    ) -> AsyncOperationResponse[
        "capo_drs.types.start_recovery_response.StartRecoveryResponse"
    ]:
        import capo_drs._operations.elastic_disaster_recovery_service.start_recovery

        (
            output,
            http_response,
        ) = await capo_drs._operations.elastic_disaster_recovery_service.start_recovery.async_start_recovery(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_drs.types.start_recovery_request.StartRecoveryRequest",
    ) -> dict[str, Any]:
        import capo_drs.types.start_recovery_request

        return capo_drs.types.start_recovery_request.redact_sensitive(input_)

    def _redact_output(
        output: "capo_drs.types.start_recovery_response.StartRecoveryResponse",
    ) -> dict[str, Any]:
        import capo_drs.types.start_recovery_response

        return capo_drs.types.start_recovery_response.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "StartRecovery",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_drs.types.start_recovery_request.StartRecoveryRequest = {
        "source_servers": source_servers
    }
    if is_drill is not None:
        input_["is_drill"] = is_drill
    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