suspendGameServerGroup method
This API works with the following fleet types: EC2 (FleetIQ)
Temporarily stops activity on a game server group without terminating instances or the game server group. You can restart activity by calling ResumeGameServerGroup. You can suspend the following activity:
- Instance type replacement - This activity evaluates the current game hosting viability of all Spot instance types that are defined for the game server group. It updates the Auto Scaling group to remove nonviable Spot Instance types, which have a higher chance of game server interruptions. It then balances capacity across the remaining viable Spot Instance types. When this activity is suspended, the Auto Scaling group continues with its current balance, regardless of viability. Instance protection, utilization metrics, and capacity scaling activities continue to be active.
GameServerGroup
object is returned showing that the activity is listed in
SuspendedActions.
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 suspendActions :
The activity to suspend for this game server group.
Implementation
Future<SuspendGameServerGroupOutput> suspendGameServerGroup({
required String gameServerGroupName,
required List<GameServerGroupAction> suspendActions,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'GameLift.SuspendGameServerGroup'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'GameServerGroupName': gameServerGroupName,
'SuspendActions': suspendActions.map((e) => e.value).toList(),
},
);
return SuspendGameServerGroupOutput.fromJson(jsonResponse.body);
}