Skip to content

associate_gateway_to_server

associate_gateway_to_server(
    gateway_arn: GatewayArn,
    server_arn: ServerArn,
    *,
    config_overrides: Optional[BackupGatewayClientConfig] = None,
) -> AssociateGatewayToServerOutput

Associates a backup gateway with your server. After you complete the association process, you can back up and restore your VMs through the gateway.

Parameters:

  • gateway_arn (GatewayArn) –

    The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation to return a list of gateways for your account and Amazon Web Services Region.

  • server_arn (ServerArn) –

    The Amazon Resource Name (ARN) of the server that hosts your virtual machines.

Raises:

  • InternalServerException –

    The operation did not succeed because an internal error occurred. Try again later.

  • ThrottlingException –

    TPS has been limited to protect against intentional or unintentional high request volumes.

  • ValidationException –

    The operation did not succeed because a validation error occurred.

  • ConflictException –

    The operation cannot proceed because it is not supported.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_backup_gateway/_services/backup_gateway.py
def associate_gateway_to_server(
    self,
    gateway_arn: "capo_backup_gateway.types.gateway_arn.GatewayArn",
    server_arn: "capo_backup_gateway.types.server_arn.ServerArn",
    *,
    config_overrides: Optional[BackupGatewayClientConfig] = None,
) -> "capo_backup_gateway.types.associate_gateway_to_server_output.AssociateGatewayToServerOutput":
    """<p>Associates a backup gateway with your server. After you complete the association process, you can back up and restore your VMs through the gateway.</p>

    Args:
        gateway_arn: <p>The Amazon Resource Name (ARN) of the gateway. Use the <code>ListGateways</code> operation to return a list of gateways for your account and Amazon Web Services Region.</p>
        server_arn: <p>The Amazon Resource Name (ARN) of the server that hosts your virtual machines.</p>

    Raises:
        capo_backup_gateway.errors.internal_server_exception.InternalServerException: <p>The operation did not succeed because an internal error occurred. Try again later.</p>
        capo_backup_gateway.errors.throttling_exception.ThrottlingException: <p>TPS has been limited to protect against intentional or unintentional high request volumes.</p>
        capo_backup_gateway.errors.validation_exception.ValidationException: <p>The operation did not succeed because a validation error occurred.</p>
        capo_backup_gateway.errors.conflict_exception.ConflictException: <p>The operation cannot proceed because it is not supported.</p>
        capo_backup_gateway.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_backup_gateway.types.associate_gateway_to_server_input.AssociateGatewayToServerInput]",
    ) -> OperationResponse[
        "capo_backup_gateway.types.associate_gateway_to_server_output.AssociateGatewayToServerOutput"
    ]:
        import capo_backup_gateway._operations.backup_on_premises_v20210101.associate_gateway_to_server

        output, http_response = (
            capo_backup_gateway._operations.backup_on_premises_v20210101.associate_gateway_to_server.associate_gateway_to_server(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("AssociateGatewayToServer")
    )
    input_: capo_backup_gateway.types.associate_gateway_to_server_input.AssociateGatewayToServerInput = {
        "gateway_arn": gateway_arn,
        "server_arn": server_arn,
    }

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