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

ListBuilds

Retrieves build records for all builds associated with the AWS account in use. You can limit results to builds that are in a specific status by using the Status parameter. Use the pagination parameters to retrieve results in a set of sequential pages.

Note

Build records are not listed in any particular order.

Build-related operations include:

Request Syntax

{
   "Limit": number,
   "NextToken": "string",
   "Status": "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.

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.

Required: No

Status

Build status to filter results by. To retrieve all builds, leave this parameter empty.

Possible build statuses include the following:

  • INITIALIZED -- A new build has been defined, but no files have been uploaded. You cannot create fleets for builds that are in this status. When a build is successfully created, the build status is set to this value.

  • READY -- The game build has been successfully uploaded. You can now create new fleets for this build.

  • FAILED -- The game build upload failed. You cannot create new fleets for this build.

Type: String

Valid Values: INITIALIZED | READY | FAILED

Required: No

Response Syntax

{
   "Builds": [ 
      { 
         "BuildId": "string",
         "CreationTime": number,
         "Name": "string",
         "OperatingSystem": "string",
         "SizeOnDisk": number,
         "Status": "string",
         "Version": "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.

Builds

Collection of build records that match the request.

Type: Array of Build objects

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.

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

UnauthorizedException

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

HTTP Status Code: 400

Examples

Retrieve all builds

This example retrieves game server builds in the current region. The sample request illustrates how to use the pagination parameters, Limit and NextToken, to retrieve the results in sequential sets.

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: 171
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.ListBuilds 

{
    "Limit": 2,
    "NextToken": "eyJhd3NBY2NvdW50SWQiOnsicyI6IjMwMjc3NjAxNjM5OCJ9LCJidWlsZElkIjp7InMiOiJidWlsZC00NDRlZjQxZS1hM2I1LTQ2NDYtODJmMy0zYzI4ZTgxNjVjEXAMPLE="
}

Sample Response

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

{
    "Builds": [
        {"BuildId": "build-1111aaaa-22bb-33cc-44dd-5555eeee66ff", 
            "CreationTime": 1495664528.723, 
            "Name": "My_Game_Server_Build_One", 
            "OperatingSystem": "WINDOWS_2012", 
            "SizeOnDisk": 8567781, 
            "Status": "READY", 
            "Version": "12345.678"
        }, 
        {"BuildId": "build-3333cccc-44dd-55ee-66ff-7777aaaa88bb", 
            "CreationTime": 1495528748.555, 
            "Name": "My_Game_Server_Build_Two", 
            "OperatingSystem": "AMAZON_LINUX",
            "SizeOnDisk": 8567781,
            "Status": "INITIALIZED", 
            "Version": "23456.789"
        }
    ], 
    "NextToken": "eyJhd3NBY2NvdW50SWQiOnsicyI6IjMwMjc3NjAxNjM5OCJ9LCJidWlsZElkIjp7InMiOiJidWlsZC01NWYxZTZmMS1jY2FlLTQ3YTctOWI5ZS1iYjFkYTQwMjJEXAMPLE="
}

Retrieve failed builds

This example retrieves all game server builds in the current region that failed to upload. It uses the pagination parameters to retrieve two builds at a time. With no NextToken provided, this request tries to retrieve the first two results. There is only one result, so only one build record and no NextToken is returned.

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: 42
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.ListBuilds 

{
    "Limit": 2,
    "Status": "FAILED"
}

Sample Response

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

{
    "Builds": 
    [
        {"BuildId": "build-3333cccc-44dd-55ee-66ff-7777aaaa88bb", 
            "CreationTime": 1495528748.555, 
            "Name": "My_Game_Server_Build_Two", 
            "OperatingSystem": "AMAZON_LINUX",
            "SizeOnDisk": 8567781,
            "Status": "FAILED", 
            "Version": "23456.789"
        }
    ]
}

See Also

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