describeGameServer method

Future<DescribeGameServerOutput> describeGameServer({
  1. required String gameServerGroupName,
  2. required String gameServerId,
})

This API works with the following fleet types: EC2 (FleetIQ)

Retrieves information for a registered game server. Information includes game server status, health check info, and the instance that the game server is running on.

To retrieve game server information, specify the game server ID. If successful, the requested game server object is returned.

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 where the game server is running.

Parameter gameServerId : A custom string that uniquely identifies the game server information to be retrieved.

Implementation

Future<DescribeGameServerOutput> describeGameServer({
  required String gameServerGroupName,
  required String gameServerId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'GameLift.DescribeGameServer'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'GameServerGroupName': gameServerGroupName,
      'GameServerId': gameServerId,
    },
  );

  return DescribeGameServerOutput.fromJson(jsonResponse.body);
}