GameLift / Client / list_fleets

list_fleets#

GameLift.Client.list_fleets(**kwargs)#

Retrieves a collection of fleet resources in an Amazon Web Services Region. You can call this operation to get fleets in a previously selected default Region (see `https://docs.aws.amazon.com/credref/latest/refdocs/setting-global-region.html <https://docs.aws.amazon.com/credref/latest/refdocs/setting-global-region.html>`__or specify a Region in your request. You can filter the result set to find only those fleets that are deployed with a specific build or script. For fleets that have multiple locations, this operation retrieves fleets based on their home Region only.

This operation can be used in the following ways:

  • To get a list of all fleets in a Region, don’t provide a build or script identifier.

  • To get a list of all fleets where a specific custom game build is deployed, provide the build ID.

  • To get a list of all Realtime Servers fleets with a specific configuration script, provide the script ID.

Use the pagination parameters to retrieve results as a set of sequential pages.

If successful, a list of fleet IDs that match the request parameters is returned. A NextToken value is also returned if there are more result pages to retrieve.

Note

Fleet resources are not listed in a particular order.

Learn more

Setting up Amazon GameLift fleets

See also: AWS API Documentation

Request Syntax

response = client.list_fleets(
    BuildId='string',
    ScriptId='string',
    Limit=123,
    NextToken='string'
)
Parameters:
  • BuildId (string) – A unique identifier for the build to request fleets for. Use this parameter to return only fleets using a specified build. Use either the build ID or ARN value.

  • ScriptId (string) – A unique identifier for the Realtime script to request fleets for. Use this parameter to return only fleets using a specified script. Use either the script ID or ARN value.

  • 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

{
    'FleetIds': [
        'string',
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) –

    • FleetIds (list) –

      A set of fleet IDs that match the list request.

      • (string) –

    • 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.InternalServiceException

  • GameLift.Client.exceptions.NotFoundException

  • GameLift.Client.exceptions.InvalidRequestException

  • GameLift.Client.exceptions.UnauthorizedException