Creates a backup gateway. After you create a gateway, you can associate it with a server using the AssociateGatewayToServer operation.
Parameters:
-
activation_key
(ActivationKey)
–
The activation key of the created gateway.
-
gateway_display_name
(Name)
–
The display name of the created gateway.
-
gateway_type
(GatewayType)
–
The type of created gateway.
-
tags
(Optional[Tags], default:
None
)
–
A list of up to 50 tags to assign to the gateway. Each tag is a key-value pair.
Raises:
Source code in docs_src/capo_backup_gateway/_services/backup_gateway.py
| 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[BackupGatewayClientConfig] = 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.
"""
def _handler(
req: "OperationRequest[capo_backup_gateway.types.create_gateway_input.CreateGatewayInput]",
) -> OperationResponse[
"capo_backup_gateway.types.create_gateway_output.CreateGatewayOutput"
]:
import capo_backup_gateway._operations.backup_on_premises_v20210101.create_gateway
output, http_response = (
capo_backup_gateway._operations.backup_on_premises_v20210101.create_gateway.create_gateway(
req.options, req.input
)
)
return OperationResponse(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 = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|