startFleetActions method

Future<void> startFleetActions({
  1. required List<FleetAction> actions,
  2. required String fleetId,
})

Resumes activity on a fleet that was suspended with StopFleetActions. Currently, this operation is used to restart a fleet's auto-scaling activity.

To start fleet actions, specify the fleet ID and the type of actions to restart. When auto-scaling fleet actions are restarted, Amazon GameLift once again initiates scaling events as triggered by the fleet's scaling policies. If actions on the fleet were never stopped, this operation will have no effect. You can view a fleet's stopped actions using DescribeFleetAttributes.

Learn more

Setting up GameLift Fleets

Related operations

May throw InternalServiceException. May throw InvalidRequestException. May throw UnauthorizedException. May throw NotFoundException.

Parameter actions : List of actions to restart on the fleet.

Parameter fleetId : A unique identifier for a fleet to start actions on. You can use either the fleet ID or ARN value.

Implementation

Future<void> startFleetActions({
  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.StartFleetActions'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'Actions': actions.map((e) => e.toValue()).toList(),
      'FleetId': fleetId,
    },
  );
}