deleteGameServerGroup method
- required String gameServerGroupName,
- GameServerGroupDeleteOption? deleteOption,
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:
- The game server group
- The corresponding Auto Scaling group
- All game servers that are currently running in the group
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
May throw InternalServiceException.
May throw InvalidRequestException.
May throw NotFoundException.
May throw UnauthorizedException.
Parameter gameServerGroupName :
A unique identifier for the game server group. Use either the name or ARN
value.
Parameter deleteOption :
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 inUTILIZEDstatus. -
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.
Implementation
Future<DeleteGameServerGroupOutput> deleteGameServerGroup({
required String gameServerGroupName,
GameServerGroupDeleteOption? deleteOption,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'GameLift.DeleteGameServerGroup'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'GameServerGroupName': gameServerGroupName,
if (deleteOption != null) 'DeleteOption': deleteOption.value,
},
);
return DeleteGameServerGroupOutput.fromJson(jsonResponse.body);
}