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

CreateGameSessionQueue

Establishes a new queue for processing requests to place new game sessions. A queue identifies where new game sessions can be hosted -- by specifying a list of destinations (fleets or aliases) -- and how long requests can wait in the queue before timing out. You can set up a queue to try to place game sessions on fleets in multiple regions. To add placement requests to a queue, call StartGameSessionPlacement and reference the queue name.

Destination order. When processing a request for a game session, Amazon GameLift tries each destination in order until it finds one with available resources to host the new game session. A queue's default order is determined by how destinations are listed. The default order is overridden when a game session placement request provides player latency information. Player latency information enables Amazon GameLift to prioritize destinations where players report the lowest average latency, as a result placing the new game session where the majority of players will have the best possible gameplay experience.

Player latency policies. For placement requests containing player latency information, use player latency policies to protect individual players from very high latencies. With a latency cap, even when a destination can deliver a low latency for most players, the game is not placed where any individual player is reporting latency higher than a policy's maximum. A queue can have multiple latency policies, which are enforced consecutively starting with the policy with the lowest latency cap. Use multiple policies to gradually relax latency controls; for example, you might set a policy with a low latency cap for the first 60 seconds, a second policy with a higher cap for the next 60 seconds, etc.

To create a new queue, provide a name, timeout value, a list of destinations and, if desired, a set of latency policies. If successful, a new queue object is returned.

Queue-related operations include:

Request Syntax

Copy
{ "Destinations": [ { "DestinationArn": "string" } ], "Name": "string", "PlayerLatencyPolicies": [ { "MaximumIndividualPlayerLatencyMilliseconds": number, "PolicyDurationSeconds": number } ], "TimeoutInSeconds": number }

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.

Name

Descriptive label that is associated with game session queue. Queue names must be unique within each region.

Type: String

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

Pattern: [a-zA-Z0-9-]+

Required: Yes

Destinations

List of fleets that can be used to fulfill game session placement requests in the queue. Fleets are identified by either a fleet ARN or a fleet alias ARN. Destinations are listed in default preference order.

Type: Array of GameSessionQueueDestination objects

Required: No

PlayerLatencyPolicies

Collection of latency policies to apply when processing game sessions placement requests with player latency information. Multiple policies are evaluated in order of the maximum latency value, starting with the lowest latency values. With just one policy, it is enforced at the start of the game session placement for the duration period. With multiple policies, each policy is enforced consecutively for its duration period. For example, a queue might enforce a 60-second policy followed by a 120-second policy, and then no policy for the remainder of the placement. A player latency policy must set a value for MaximumIndividualPlayerLatencyMilliseconds; if none is set, this API requests will fail.

Type: Array of PlayerLatencyPolicy objects

Required: No

TimeoutInSeconds

Maximum time, in seconds, that a new game session placement request remains in the queue. When a request exceeds this time, the game session placement changes to a TIMED_OUT status.

Type: Integer

Valid Range: Minimum value of 0.

Required: No

Response Syntax

Copy
{ "GameSessionQueue": { "Destinations": [ { "DestinationArn": "string" } ], "GameSessionQueueArn": "string", "Name": "string", "PlayerLatencyPolicies": [ { "MaximumIndividualPlayerLatencyMilliseconds": number, "PolicyDurationSeconds": number } ], "TimeoutInSeconds": number } }

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.

GameSessionQueue

Object that describes the newly created game session queue.

Type: GameSessionQueue object

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

LimitExceededException

The requested operation would cause the resource to exceed the allowed service limit. Resolve the issue before retrying.

HTTP Status Code: 400

UnauthorizedException

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

HTTP Status Code: 400

Example

Create and configure a game session queue

This example creates a new game session queue with destinations in two different regions and a timeout of 10 minutes. It configures two latency policies, which are enforced consecutively starting with the one with the lowest maximum latency value. In this example, the 100ms latency cap is enforced during the first 60 seconds of a game session placement, followed by the 200ms cap for rest of the placement duration.

Sample Request

Copy
JSON syntax: { "Destinations": [ { "DestinationArn": "arn:aws:gamelift:us-west-2::fleet/fleet-1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d" }, { "DestinationArn": "arn:aws:gamelift:us-east-1::fleet/fleet-5c6d3c4d-5e6f-7a8b-9c0d-1e2f3a4b5a2b" } ], "Name": "matchmaker-queue", "PlayerLatencyPolicies": [ { "MaximumIndividualPlayerLatencyMilliseconds": 200 }, { "MaximumIndividualPlayerLatencyMilliseconds": 100, "PolicyDurationSeconds": 60 } ], "TimeoutInSeconds": 600 }

See Also

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