updateRuntimeConfiguration method

Future<UpdateRuntimeConfigurationOutput> updateRuntimeConfiguration({
  1. required String fleetId,
  2. required RuntimeConfiguration runtimeConfiguration,
})

This API works with the following fleet types: EC2

Updates the runtime configuration for the specified fleet. The runtime configuration tells Amazon GameLift Servers how to launch server processes on computes in managed EC2 and Anywhere fleets. You can update a fleet's runtime configuration at any time after the fleet is created; it does not need to be in ACTIVE status.

To update runtime configuration, specify the fleet ID and provide a RuntimeConfiguration with an updated set of server process configurations.

If successful, the fleet's runtime configuration settings are updated. Fleet computes that run game server processes regularly check for and receive updated runtime configurations. The computes immediately take action to comply with the new configuration by launching new server processes or by not replacing existing processes when they shut down. Updating a fleet's runtime configuration never affects existing server processes.

Learn more

Setting up Amazon GameLift Servers fleets

May throw InternalServiceException. May throw InvalidFleetStatusException. May throw InvalidRequestException. May throw LimitExceededException. May throw NotFoundException. May throw UnauthorizedException.

Parameter fleetId : A unique identifier for the fleet to update runtime configuration for. You can use either the fleet ID or ARN value.

Parameter runtimeConfiguration : Instructions for launching server processes on fleet computes. Server processes run either a custom game build executable or a Amazon GameLift Servers Realtime script. The runtime configuration lists the types of server processes to run, how to launch them, and the number of processes to run concurrently.

Implementation

Future<UpdateRuntimeConfigurationOutput> updateRuntimeConfiguration({
  required String fleetId,
  required RuntimeConfiguration runtimeConfiguration,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'GameLift.UpdateRuntimeConfiguration'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'FleetId': fleetId,
      'RuntimeConfiguration': runtimeConfiguration,
    },
  );

  return UpdateRuntimeConfigurationOutput.fromJson(jsonResponse.body);
}