stopFleetActions method
Suspends activity on a fleet. Currently, this operation is used to stop a fleet's auto-scaling activity. It is used to temporarily stop triggering scaling events. The policies can be retained and auto-scaling activity can be restarted using StartFleetActions. You can view a fleet's stopped actions using DescribeFleetAttributes.
To stop fleet actions, specify the fleet ID and the type of actions to suspend. When auto-scaling fleet actions are stopped, Amazon GameLift no longer initiates scaling events except in response to manual changes using UpdateFleetCapacity.
Learn more
Related operations
- CreateFleet
- ListFleets
- DeleteFleet
- DescribeFleetAttributes
- UpdateFleetAttributes
- StartFleetActions or StopFleetActions
May throw InternalServiceException. May throw InvalidRequestException. May throw UnauthorizedException. May throw NotFoundException.
Parameter actions
:
List of actions to suspend on the fleet.
Parameter fleetId
:
A unique identifier for a fleet to stop actions on. You can use either the
fleet ID or ARN value.
Implementation
Future<void> stopFleetActions({
required List<FleetAction> actions,
required String fleetId,
}) async {
ArgumentError.checkNotNull(actions, 'actions');
ArgumentError.checkNotNull(fleetId, 'fleetId');
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'GameLift.StopFleetActions'
};
await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'Actions': actions.map((e) => e.toValue()).toList(),
'FleetId': fleetId,
},
);
}