GameLift / Client / describe_game_server_instances

describe_game_server_instances#

GameLift.Client.describe_game_server_instances(**kwargs)#

This operation is used with the GameLift FleetIQ solution and game server groups.

Retrieves status information about the Amazon EC2 instances associated with a GameLift FleetIQ game server group. Use this operation to detect when instances are active or not available to host new game servers.

To request status for all instances in the game server group, provide a game server group ID only. To request status for specific instances, provide the game server group ID and one or more instance IDs. Use the pagination parameters to retrieve results in sequential segments. If successful, a collection of GameServerInstance objects is returned.

This operation is not designed to be called with every game server claim request; this practice can cause you to exceed your API limit, which results in errors. Instead, as a best practice, cache the results and refresh your cache no more than once every 10 seconds.

Learn more

GameLift FleetIQ Guide

See also: AWS API Documentation

Request Syntax

response = client.describe_game_server_instances(
    GameServerGroupName='string',
    InstanceIds=[
        'string',
    ],
    Limit=123,
    NextToken='string'
)
Parameters:
  • GameServerGroupName (string) –

    [REQUIRED]

    A unique identifier for the game server group. Use either the name or ARN value.

  • InstanceIds (list) –

    The Amazon EC2 instance IDs that you want to retrieve status on. Amazon EC2 instance IDs use a 17-character format, for example: i-1234567890abcdef0. To retrieve all instances in the game server group, leave this parameter empty.

    • (string) –

  • Limit (integer) – The maximum number of results to return. Use this parameter with NextToken to get results as a set of sequential pages.

  • NextToken (string) – A token that indicates the start of the next sequential page of results. Use the token that is returned with a previous call to this operation. To start at the beginning of the result set, do not specify a value.

Return type:

dict

Returns:

Response Syntax

{
    'GameServerInstances': [
        {
            'GameServerGroupName': 'string',
            'GameServerGroupArn': 'string',
            'InstanceId': 'string',
            'InstanceStatus': 'ACTIVE'|'DRAINING'|'SPOT_TERMINATING'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) –

    • GameServerInstances (list) –

      The collection of requested game server instances.

      • (dict) –

        This data type is used with the GameLift FleetIQ and game server groups.

        Additional properties, including status, that describe an EC2 instance in a game server group. Instance configurations are set with game server group properties (see DescribeGameServerGroup and with the EC2 launch template that was used when creating the game server group.

        Retrieve game server instances for a game server group by calling DescribeGameServerInstances.

        • GameServerGroupName (string) –

          A developer-defined identifier for the game server group that includes the game server instance. The name is unique for each Region in each Amazon Web Services account.

        • GameServerGroupArn (string) –

          A generated unique identifier for the game server group that includes the game server instance.

        • InstanceId (string) –

          The unique identifier for the instance where the game server is running. This ID is available in the instance metadata. EC2 instance IDs use a 17-character format, for example: i-1234567890abcdef0.

        • InstanceStatus (string) –

          Current status of the game server instance

    • NextToken (string) –

      A token that indicates where to resume retrieving results on the next call to this operation. If no token is returned, these results represent the end of the list.

Exceptions

  • GameLift.Client.exceptions.InvalidRequestException

  • GameLift.Client.exceptions.NotFoundException

  • GameLift.Client.exceptions.UnauthorizedException

  • GameLift.Client.exceptions.InternalServiceException