stopFleetActions method
This API works with the following fleet types: EC2, Container
Suspends certain types of activity in a fleet location. Currently, this operation is used to stop auto-scaling activity. For multi-location fleets, fleet actions are managed separately for each location.
Stopping fleet actions has several potential purposes. It allows you to temporarily stop auto-scaling activity but retain your scaling policies for use in the future. For multi-location fleets, you can set up fleet-wide auto-scaling, and then opt out of it for certain locations.
This operation can be used in the following ways:
- To stop actions on instances in the fleet's home Region, provide a fleet ID and the type of actions to suspend.
- To stop actions on instances in one of the fleet's remote locations, provide a fleet ID, a location name, and the type of actions to suspend.
Learn more
Setting up Amazon GameLift Servers Fleets
May throw InternalServiceException.
May throw InvalidRequestException.
May throw NotFoundException.
May throw UnauthorizedException.
May throw UnsupportedRegionException.
Parameter actions :
List of actions to suspend on the fleet.
Parameter fleetId :
A unique identifier for the fleet to stop actions on. You can use either
the fleet ID or ARN value.
Parameter location :
The fleet location to stop fleet actions for. Specify a location in the
form of an Amazon Web Services Region code, such as
us-west-2.
Implementation
Future<StopFleetActionsOutput> stopFleetActions({
required List<FleetAction> actions,
required String fleetId,
String? location,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'GameLift.StopFleetActions'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'Actions': actions.map((e) => e.value).toList(),
'FleetId': fleetId,
if (location != null) 'Location': location,
},
);
return StopFleetActionsOutput.fromJson(jsonResponse.body);
}