Skip to content

start_source_network_recovery

start_source_network_recovery(
    source_networks: StartSourceNetworkRecoveryRequestNetworkEntries,
    *,
    config_overrides: Optional[drsClientConfig] = None,
    deploy_as_new: Optional[bool] = None,
    tags: Optional[TagsMap] = None,
) -> StartSourceNetworkRecoveryResponse

Deploy VPC for the specified Source Network and modify launch templates to use this network. The VPC will be deployed using a dedicated CloudFormation stack.

Parameters:

  • source_networks (StartSourceNetworkRecoveryRequestNetworkEntries) –

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

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

    Don't update existing CloudFormation Stack, recover the network using a new stack.

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

    The tags to be associated with the Source Network recovery Job.

Raises:

Source code in docs_src/capo_drs/_services/drs.py
def start_source_network_recovery(
    self,
    source_networks: "capo_drs.types.start_source_network_recovery_request_network_entries.StartSourceNetworkRecoveryRequestNetworkEntries",
    *,
    config_overrides: Optional[drsClientConfig] = None,
    deploy_as_new: Optional[bool] = None,
    tags: Optional["capo_drs.types.tags_map.TagsMap"] = None,
) -> "capo_drs.types.start_source_network_recovery_response.StartSourceNetworkRecoveryResponse":
    """<p>Deploy VPC for the specified Source Network and modify launch templates to use this network. The VPC will be deployed using a dedicated CloudFormation stack.</p>

    Args:
        source_networks: <p>The Source Networks that we want to start a Recovery Job for.</p>
        deploy_as_new: <p>Don't update existing CloudFormation Stack, recover the network using a new stack.</p>
        tags: <p>The tags to be associated with the Source Network 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.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by the AWS service.</p>
        capo_drs.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_drs.types.start_source_network_recovery_request.StartSourceNetworkRecoveryRequest]",
    ) -> OperationResponse[
        "capo_drs.types.start_source_network_recovery_response.StartSourceNetworkRecoveryResponse"
    ]:
        import capo_drs._operations.elastic_disaster_recovery_service.start_source_network_recovery

        output, http_response = (
            capo_drs._operations.elastic_disaster_recovery_service.start_source_network_recovery.start_source_network_recovery(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

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

        return (
            capo_drs.types.start_source_network_recovery_request.redact_sensitive(
                input_
            )
        )

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

        return (
            capo_drs.types.start_source_network_recovery_response.redact_sensitive(
                output
            )
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "StartSourceNetworkRecovery",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_drs.types.start_source_network_recovery_request.StartSourceNetworkRecoveryRequest = {
        "source_networks": source_networks
    }
    if deploy_as_new is not None:
        input_["deploy_as_new"] = deploy_as_new
    if tags is not None:
        input_["tags"] = tags

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