Menu
Amazon GameLift Service
API Reference (API Version 2015-10-01)

ListFleets

Retrieves a collection of fleet records for this AWS account. You can filter the result set by build ID. Use the pagination parameters to retrieve results in sequential pages.

Note

Fleet records are not listed in any particular order.

Fleet-related operations include:

Request Syntax

{
   "BuildId": "string",
   "Limit": number,
   "NextToken": "string"
}

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

Note

In the following list, the required parameters are described first.

BuildId

Unique identifier for a build to return fleets for. Use this parameter to return only fleets using the specified build. To retrieve all fleets, leave this parameter empty.

Type: String

Pattern: ^build-\S+

Required: No

Limit

Maximum number of results to return. Use this parameter with NextToken to get results as a set of sequential pages.

Type: Integer

Valid Range: Minimum value of 1.

Required: No

NextToken

Token that indicates the start of the next sequential page of results. Use the token that is returned with a previous call to this action. To start at the beginning of the result set, do not specify a value.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 1024.

Required: No

Response Syntax

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

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

FleetIds

Set of fleet IDs matching the list request. You can retrieve additional information about all returned fleets by passing this result set to a call to DescribeFleetAttributes, DescribeFleetCapacity, or DescribeFleetUtilization.

Type: Array of strings

Array Members: Minimum number of 1 item.

Pattern: ^fleet-\S+

NextToken

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

Type: String

Length Constraints: Minimum length of 1. Maximum length of 1024.

Errors

For information about the errors that are common to all actions, see Common Errors.

InternalServiceException

The service encountered an unrecoverable internal failure while processing the request. Clients can retry such requests immediately or after a waiting period.

HTTP Status Code: 500

InvalidRequestException

One or more parameter values in the request are invalid. Correct the invalid parameter values before retrying.

HTTP Status Code: 400

NotFoundException

A service resource associated with the request could not be found. Clients should not retry such requests.

HTTP Status Code: 400

UnauthorizedException

The client failed authentication. Clients should not retry such requests.

HTTP Status Code: 400

Examples

List all fleets in the region

This example retrieves the fleet IDs of all existing fleets, regardless of build and status, and uses the pagination parameters to retrieve two fleet IDs at a time. This request illustrates how to retrieve a subsequent set of results by using a NextToken token that was returned with a previous request. The example response also includes a NextToken, which indicates that there are still more results to retrieve. To get more information on an individual fleet, use the Describe Fleet operations with a fleet ID.

HTTP requests are authenticated using an AWS Signature Version 4 signature in the Authorization header field.

Sample Request

POST / HTTP/1.1
Host: gamelift.us-west-2.amazonaws.com;
Accept-Encoding: identity
Content-Length: 208
User-Agent: aws-cli/1.11.36 Python/2.7.9 Windows/7 botocore/1.4.93
Content-Type: application/x-amz-json-1.0
Authorization: AWS4-HMAC-SHA256  Credential=AKIAIOSFODNN7EXAMPLE/20170406/us-west-2/gamelift/aws4_request, SignedHeaders=content-type;host;x-amz-date;x-amz-target, Signature=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
X-Amz-Date: 20170406T004805Z
X-Amz-Target: GameLift.ListFleets 

{
    "Limit": 2
    "NextToken": "eyJhd3NBY2NvdW50SWQiOnsicyI6IjMwMjc3NjAxNjM5OCJ9LCJidWlsZElkIjp7InMiOiJidWlsZC01NWYxZTZmMS1jY2FlLTQ3YTctOWI5ZS1iYjFkYTQwMjEXAMPLE1"
}

Sample Response

HTTP/1.1 200 OK
x-amzn-RequestId: b34f8665-EXAMPLE
Content-Type: application/x-amz-json-1.1
Content-Length: 264
Date: Thu, 06 Apr 2017 00:48:07 GMT

{
    "FleetIds": ["fleet-2222bbbb-33cc-44dd-55ee-6666ffff77aa", "fleet-9999ffff-88ee-77dd-66cc-5555bbbb44aa"], 
    "NextToken": "eyJhd3NBY2NvdW50SWQiOnsicyI6IjMwMjc3NjAxNjM5OCJ9LCJidWlsZElkIjp7InMiOiJidWlsZC01NWYxZTZmMS1jY2FlLTQ3YTctOWI5ZS1iYjFkYTQwMjEXAMPLE2"
}

List all fleets in the region for a specific build

This example retrieves the IDs of fleets that are deployed with a specified game build, regardless of status. This request does not use the pagination parameters. Without a limit, up to 16 results may be returned with any request. In this case, there is only one fleet. To get more information on an individual fleet, call the DescribeFleet operations with the fleet ID.

HTTP requests are authenticated using an AWS Signature Version 4 signature in the Authorization header field.

Sample Request

POST / HTTP/1.1
Host: gamelift.us-west-2.amazonaws.com;
Accept-Encoding: identity
Content-Length: 63
User-Agent: aws-cli/1.11.36 Python/2.7.9 Windows/7 botocore/1.4.93
Content-Type: application/x-amz-json-1.0
Authorization: AWS4-HMAC-SHA256  Credential=AKIAIOSFODNN7EXAMPLE/20170406/us-west-2/gamelift/aws4_request, SignedHeaders=content-type;host;x-amz-date;x-amz-target, Signature=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
X-Amz-Date: 20170406T004805Z
X-Amz-Target: GameLift.ListFleets 

{
    "Build": "build-1111aaaa-22bb-33cc-44dd-5555eeee66ff"
}

Sample Response

HTTP/1.1 200 OK
x-amzn-RequestId: b34f8665-EXAMPLE
Content-Type: application/x-amz-json-1.1
Content-Length: 66
Date: Thu, 06 Apr 2017 00:48:07 GMT

{
    "FleetIds": ["fleet-2222bbbb-33cc-44dd-55ee-6666ffff77aa"]
}

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: