async def create_gateway(
self,
activation_key: "capo_backup_gateway.types.activation_key.ActivationKey",
gateway_display_name: "capo_backup_gateway.types.name.Name",
gateway_type: "capo_backup_gateway.types.gateway_type.GatewayType",
*,
config_overrides: Optional[AsyncBackupGatewayClientConfig] = None,
tags: Optional["capo_backup_gateway.types.tags.Tags"] = None,
) -> "capo_backup_gateway.types.create_gateway_output.CreateGatewayOutput":
"""<p>Creates a backup gateway. After you create a gateway, you can associate it with a server using the <code>AssociateGatewayToServer</code> operation.</p>
Args:
activation_key: <p>The activation key of the created gateway.</p>
gateway_display_name: <p>The display name of the created gateway.</p>
gateway_type: <p>The type of created gateway.</p>
tags: <p>A list of up to 50 tags to assign to the gateway. Each tag is a key-value pair.</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.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_backup_gateway.types.create_gateway_input.CreateGatewayInput]",
) -> AsyncOperationResponse[
"capo_backup_gateway.types.create_gateway_output.CreateGatewayOutput"
]:
if req.options.protocol == "awsJson1_0":
import capo_backup_gateway._operations.backup_on_premises_v20210101.aws_json1_0.create_gateway
(
output,
http_response,
) = await capo_backup_gateway._operations.backup_on_premises_v20210101.aws_json1_0.create_gateway.async_create_gateway(
req.options, req.input
)
elif req.options.protocol == "rpcv2Cbor":
import capo_backup_gateway._operations.backup_on_premises_v20210101.rpcv2_cbor.create_gateway
(
output,
http_response,
) = await capo_backup_gateway._operations.backup_on_premises_v20210101.rpcv2_cbor.create_gateway.async_create_gateway(
req.options, req.input
)
else:
raise ValueError(f"unknown protocol {req.options.protocol!r}")
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CreateGateway")
)
input_: capo_backup_gateway.types.create_gateway_input.CreateGatewayInput = {
"activation_key": activation_key,
"gateway_display_name": gateway_display_name,
"gateway_type": gateway_type,
}
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