This API works with the following fleet types: EC2 (FleetIQ)
Terminates a game server group and permanently deletes the game server group record. You have several options for how these resources are impacted when deleting the game server group. Depending on the type of delete operation selected, this operation might affect these resources:
To delete a game server group, identify the game server group to delete and specify the type of delete operation to initiate. Game server groups can only be deleted if they are in ACTIVE or ERROR status.
If the delete request is successful, a series of operations are kicked off. The game server group status is changed to DELETE_SCHEDULED, which prevents new game servers from being registered and stops automatic scaling activity. Once all game servers in the game server group are deregistered, Amazon GameLift Servers FleetIQ can begin deleting resources. If any of the delete operations fail, the game server group is placed in ERROR status.
Amazon GameLift Servers FleetIQ emits delete events to Amazon CloudWatch.
Learn more
Amazon GameLift Servers FleetIQ Guide
Parameters:
-
game_server_group_name
(Optional[GameServerGroupNameOrArn], default:
None
)
–
A unique identifier for the game server group. Use either the name or ARN value.
-
delete_option
(Optional[GameServerGroupDeleteOption], default:
None
)
–
The type of delete to perform. Options include the following:
-
SAFE_DELETE – (default) Terminates the game server group and Amazon EC2 Auto Scaling group only when it has no game servers that are in UTILIZED status.
-
FORCE_DELETE – Terminates the game server group, including all active game servers regardless of their utilization status, and the Amazon EC2 Auto Scaling group.
-
RETAIN – Does a safe delete of the game server group but retains the Amazon EC2 Auto Scaling group as is.
Raises:
-
InternalServiceException
–
The service encountered an unrecoverable internal failure while processing the request. Clients can retry such requests immediately or after a waiting period.
-
InvalidRequestException
–
One or more parameter values in the request are invalid. Correct the invalid parameter values before retrying.
-
NotFoundException
–
The requested resource was not found. The resource was either not created yet or deleted.
-
UnauthorizedException
–
The client failed authentication. Clients should not retry such requests.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_gamelift/_services/async_game_lift.py
| async def delete_game_server_group(
self,
*,
config_overrides: Optional[AsyncGameLiftClientConfig] = None,
game_server_group_name: Optional[
"capo_gamelift.types.game_server_group_name_or_arn.GameServerGroupNameOrArn"
] = None,
delete_option: Optional[
"capo_gamelift.types.game_server_group_delete_option.GameServerGroupDeleteOption"
] = None,
) -> "capo_gamelift.types.delete_game_server_group_output.DeleteGameServerGroupOutput":
"""<p> <b>This API works with the following fleet types:</b> EC2 (FleetIQ)</p> <p>Terminates a game server group and permanently deletes the game server group record. You have several options for how these resources are impacted when deleting the game server group. Depending on the type of delete operation selected, this operation might affect these resources:</p> <ul> <li> <p>The game server group</p> </li> <li> <p>The corresponding Auto Scaling group</p> </li> <li> <p>All game servers that are currently running in the group</p> </li> </ul> <p>To delete a game server group, identify the game server group to delete and specify the type of delete operation to initiate. Game server groups can only be deleted if they are in <code>ACTIVE</code> or <code>ERROR</code> status.</p> <p>If the delete request is successful, a series of operations are kicked off. The game server group status is changed to <code>DELETE_SCHEDULED</code>, which prevents new game servers from being registered and stops automatic scaling activity. Once all game servers in the game server group are deregistered, Amazon GameLift Servers FleetIQ can begin deleting resources. If any of the delete operations fail, the game server group is placed in <code>ERROR</code> status.</p> <p>Amazon GameLift Servers FleetIQ emits delete events to Amazon CloudWatch.</p> <p> <b>Learn more</b> </p> <p> <a href="https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/gsg-intro.html">Amazon GameLift Servers FleetIQ Guide</a> </p>
Args:
game_server_group_name: <p>A unique identifier for the game server group. Use either the name or ARN value.</p>
delete_option: <p>The type of delete to perform. Options include the following:</p> <ul> <li> <p> <code>SAFE_DELETE</code> – (default) Terminates the game server group and Amazon EC2 Auto Scaling group only when it has no game servers that are in <code>UTILIZED</code> status.</p> </li> <li> <p> <code>FORCE_DELETE</code> – Terminates the game server group, including all active game servers regardless of their utilization status, and the Amazon EC2 Auto Scaling group. </p> </li> <li> <p> <code>RETAIN</code> – Does a safe delete of the game server group but retains the Amazon EC2 Auto Scaling group as is.</p> </li> </ul>
Raises:
capo_gamelift.errors.internal_service_exception.InternalServiceException: <p>The service encountered an unrecoverable internal failure while processing the request. Clients can retry such requests immediately or after a waiting period.</p>
capo_gamelift.errors.invalid_request_exception.InvalidRequestException: <p>One or more parameter values in the request are invalid. Correct the invalid parameter values before retrying.</p>
capo_gamelift.errors.not_found_exception.NotFoundException: <p>The requested resource was not found. The resource was either not created yet or deleted.</p>
capo_gamelift.errors.unauthorized_exception.UnauthorizedException: <p>The client failed authentication. Clients should not retry such requests.</p>
capo_gamelift.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_gamelift.types.delete_game_server_group_input.DeleteGameServerGroupInput]",
) -> AsyncOperationResponse[
"capo_gamelift.types.delete_game_server_group_output.DeleteGameServerGroupOutput"
]:
import capo_gamelift._operations.game_lift.delete_game_server_group
(
output,
http_response,
) = await capo_gamelift._operations.game_lift.delete_game_server_group.async_delete_game_server_group(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteGameServerGroup")
)
input_: capo_gamelift.types.delete_game_server_group_input.DeleteGameServerGroupInput = {}
if game_server_group_name is not None:
input_["game_server_group_name"] = game_server_group_name
if delete_option is not None:
input_["delete_option"] = delete_option
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|