This API works with the following fleet types: EC2, Anywhere, Container
Creates a placement queue that processes requests for new game sessions. A queue uses FleetIQ algorithms to locate the best available placement locations for a new game session, and then prompts the game server process to start a new game session.
A game session queue is configured with a set of destinations (Amazon GameLift Servers fleets or aliases) that determine where the queue can place new game sessions. These destinations can span multiple Amazon Web Services Regions, can use different instance types, and can include both Spot and On-Demand fleets. If the queue includes multi-location fleets, the queue can place game sessions in any of a fleet's remote locations.
You can configure a queue to determine how it selects the best available placement for a new game session. Queues can prioritize placement decisions based on a combination of location, hosting cost, and player latency. You can set up the queue to use the default prioritization or provide alternate instructions using PriorityConfiguration.
Request options
Use this operation to make these common types of requests.
-
Create a queue with the minimum required parameters.
-
Create a queue with placement notification. Queues that have high placement activity must use a notification system, such as with Amazon Simple Notification Service (Amazon SNS) or Amazon CloudWatch.
-
Create a queue with custom prioritization settings. These custom settings replace the default prioritization configuration for a queue.
-
Create a queue with special rules for processing player latency data.
Results
If successful, this operation returns a new GameSessionQueue object with an assigned queue ARN. Use the queue's name or ARN when submitting new game session requests with StartGameSessionPlacement or StartMatchmaking.
Learn more
Design a game session queue
Create a game session queue
Related actions
CreateGameSessionQueue | DescribeGameSessionQueues | UpdateGameSessionQueue | DeleteGameSessionQueue | All APIs by task
Parameters:
-
name
(Optional[GameSessionQueueName], default:
None
)
–
A descriptive label that is associated with game session queue. Queue names must be unique within each Region.
-
timeout_in_seconds
(Optional[WholeNumber], default:
None
)
–
The 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. If you don't specify a request timeout, the queue uses a default value.
The minimum value is 10 and the maximum value is 600.
-
player_latency_policies
(Optional[PlayerLatencyPolicyList], default:
None
)
–
A set of policies that enforce a sliding cap on player latency when processing game sessions placement requests. Use multiple policies to gradually relax the cap over time if Amazon GameLift Servers can't make a placement. Policies are evaluated in order starting with the lowest maximum latency value.
-
destinations
(Optional[GameSessionQueueDestinationList], default:
None
)
–
A list of fleets and/or fleet aliases that can be used to fulfill game session placement requests in the queue. Destinations are identified by either a fleet ARN or a fleet alias ARN, and are listed in order of placement preference.
-
filter_configuration
(Optional[FilterConfiguration], default:
None
)
–
A list of locations where a queue is allowed to place new game sessions. Locations are specified in the form of Amazon Web Services Region codes, such as us-west-2. If this parameter is not set, game sessions can be placed in any queue location.
-
priority_configuration
(Optional[PriorityConfiguration], default:
None
)
–
Custom settings to use when prioritizing destinations and locations for game session placements. This configuration replaces the FleetIQ default prioritization process. Priority types that are not explicitly named will be automatically applied at the end of the prioritization process.
-
custom_event_data
(Optional[QueueCustomEventData], default:
None
)
–
Information to be added to all events that are related to this game session queue.
-
notification_target
(Optional[QueueSnsArnStringModel], default:
None
)
–
-
tags
(Optional[TagList], default:
None
)
–
A list of labels to assign to the new game session queue resource. Tags are developer-defined key-value pairs. Tagging Amazon Web Services resources is useful for resource management, access management and cost allocation. For more information, see Tagging Amazon Web Services Resources in the Amazon Web Services General Reference.
Raises:
-
InternalServiceException
–
The service encountered an unrecoverable internal failure while processing the request. Clients can retry such requests immediately or after a waiting period.
-
InvalidRequestException
–
One or more parameter values in the request are invalid. Correct the invalid parameter values before retrying.
-
LimitExceededException
–
The requested operation would cause the resource to exceed the allowed service limit. Resolve the issue before retrying.
-
NotFoundException
–
The requested resource was not found. The resource was either not created yet or deleted.
-
TaggingFailedException
–
The requested tagging operation did not succeed. This may be due to invalid tag format or the maximum tag limit may have been exceeded. Resolve the issue before retrying.
-
UnauthorizedException
–
The client failed authentication. Clients should not retry such requests.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_gamelift/_services/async_game_lift.py
| async def create_game_session_queue(
self,
*,
config_overrides: Optional[AsyncGameLiftClientConfig] = None,
name: Optional[
"capo_gamelift.types.game_session_queue_name.GameSessionQueueName"
] = None,
timeout_in_seconds: Optional[
"capo_gamelift.types.whole_number.WholeNumber"
] = None,
player_latency_policies: Optional[
"capo_gamelift.types.player_latency_policy_list.PlayerLatencyPolicyList"
] = None,
destinations: Optional[
"capo_gamelift.types.game_session_queue_destination_list.GameSessionQueueDestinationList"
] = None,
filter_configuration: Optional[
"capo_gamelift.types.filter_configuration.FilterConfiguration"
] = None,
priority_configuration: Optional[
"capo_gamelift.types.priority_configuration.PriorityConfiguration"
] = None,
custom_event_data: Optional[
"capo_gamelift.types.queue_custom_event_data.QueueCustomEventData"
] = None,
notification_target: Optional[
"capo_gamelift.types.queue_sns_arn_string_model.QueueSnsArnStringModel"
] = None,
tags: Optional["capo_gamelift.types.tag_list.TagList"] = None,
) -> "capo_gamelift.types.create_game_session_queue_output.CreateGameSessionQueueOutput":
"""<p> <b>This API works with the following fleet types:</b> EC2, Anywhere, Container</p> <p>Creates a placement queue that processes requests for new game sessions. A queue uses FleetIQ algorithms to locate the best available placement locations for a new game session, and then prompts the game server process to start a new game session.</p> <p>A game session queue is configured with a set of destinations (Amazon GameLift Servers fleets or aliases) that determine where the queue can place new game sessions. These destinations can span multiple Amazon Web Services Regions, can use different instance types, and can include both Spot and On-Demand fleets. If the queue includes multi-location fleets, the queue can place game sessions in any of a fleet's remote locations.</p> <p>You can configure a queue to determine how it selects the best available placement for a new game session. Queues can prioritize placement decisions based on a combination of location, hosting cost, and player latency. You can set up the queue to use the default prioritization or provide alternate instructions using <code>PriorityConfiguration</code>.</p> <p> <b>Request options</b> </p> <p>Use this operation to make these common types of requests. </p> <ul> <li> <p>Create a queue with the minimum required parameters.</p> <ul> <li> <p> <code>Name</code> </p> </li> <li> <p> <code>Destinations</code> (This parameter isn't required, but a queue can't make placements without at least one destination.)</p> </li> </ul> </li> <li> <p>Create a queue with placement notification. Queues that have high placement activity must use a notification system, such as with Amazon Simple Notification Service (Amazon SNS) or Amazon CloudWatch.</p> <ul> <li> <p>Required parameters <code>Name</code> and <code>Destinations</code> </p> </li> <li> <p> <code>NotificationTarget</code> </p> </li> </ul> </li> <li> <p>Create a queue with custom prioritization settings. These custom settings replace the default prioritization configuration for a queue.</p> <ul> <li> <p>Required parameters <code>Name</code> and <code>Destinations</code> </p> </li> <li> <p> <code>PriorityConfiguration</code> </p> </li> </ul> </li> <li> <p>Create a queue with special rules for processing player latency data.</p> <ul> <li> <p>Required parameters <code>Name</code> and <code>Destinations</code> </p> </li> <li> <p> <code>PlayerLatencyPolicies</code> </p> </li> </ul> </li> </ul> <p> <b>Results</b> </p> <p>If successful, this operation returns a new <code>GameSessionQueue</code> object with an assigned queue ARN. Use the queue's name or ARN when submitting new game session requests with <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_StartGameSessionPlacement.html">StartGameSessionPlacement</a> or <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_StartMatchmaking.html">StartMatchmaking</a>. </p> <p> <b>Learn more</b> </p> <p> <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/queues-design.html"> Design a game session queue</a> </p> <p> <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/queues-creating.html"> Create a game session queue</a> </p> <p> <b>Related actions</b> </p> <p> <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_CreateGameSessionQueue.html">CreateGameSessionQueue</a> | <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_DescribeGameSessionQueues.html">DescribeGameSessionQueues</a> | <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_UpdateGameSessionQueue.html">UpdateGameSessionQueue</a> | <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_DeleteGameSessionQueue.html">DeleteGameSessionQueue</a> | <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-awssdk.html#reference-awssdk-resources-fleets">All APIs by task</a> </p>
Args:
name: <p>A descriptive label that is associated with game session queue. Queue names must be unique within each Region.</p>
timeout_in_seconds: <p>The 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 <code>TIMED_OUT</code> status. If you don't specify a request timeout, the queue uses a default value.</p> <note> <p>The minimum value is 10 and the maximum value is 600.</p> </note>
player_latency_policies: <p>A set of policies that enforce a sliding cap on player latency when processing game sessions placement requests. Use multiple policies to gradually relax the cap over time if Amazon GameLift Servers can't make a placement. Policies are evaluated in order starting with the lowest maximum latency value.</p>
destinations: <p>A list of fleets and/or fleet aliases that can be used to fulfill game session placement requests in the queue. Destinations are identified by either a fleet ARN or a fleet alias ARN, and are listed in order of placement preference.</p>
filter_configuration: <p>A list of locations where a queue is allowed to place new game sessions. Locations are specified in the form of Amazon Web Services Region codes, such as <code>us-west-2</code>. If this parameter is not set, game sessions can be placed in any queue location. </p>
priority_configuration: <p>Custom settings to use when prioritizing destinations and locations for game session placements. This configuration replaces the FleetIQ default prioritization process. Priority types that are not explicitly named will be automatically applied at the end of the prioritization process. </p>
custom_event_data: <p>Information to be added to all events that are related to this game session queue.</p>
notification_target: <p>An SNS topic ARN that is set up to receive game session placement notifications. See <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/queue-notification.html"> Setting up notifications for game session placement</a>.</p>
tags: <p>A list of labels to assign to the new game session queue resource. Tags are developer-defined key-value pairs. Tagging Amazon Web Services resources is useful for resource management, access management and cost allocation. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html"> Tagging Amazon Web Services Resources</a> in the <i>Amazon Web Services General Reference</i>.</p>
Raises:
capo_gamelift.errors.internal_service_exception.InternalServiceException: <p>The service encountered an unrecoverable internal failure while processing the request. Clients can retry such requests immediately or after a waiting period.</p>
capo_gamelift.errors.invalid_request_exception.InvalidRequestException: <p>One or more parameter values in the request are invalid. Correct the invalid parameter values before retrying.</p>
capo_gamelift.errors.limit_exceeded_exception.LimitExceededException: <p>The requested operation would cause the resource to exceed the allowed service limit. Resolve the issue before retrying.</p>
capo_gamelift.errors.not_found_exception.NotFoundException: <p>The requested resource was not found. The resource was either not created yet or deleted.</p>
capo_gamelift.errors.tagging_failed_exception.TaggingFailedException: <p>The requested tagging operation did not succeed. This may be due to invalid tag format or the maximum tag limit may have been exceeded. Resolve the issue before retrying.</p>
capo_gamelift.errors.unauthorized_exception.UnauthorizedException: <p>The client failed authentication. Clients should not retry such requests.</p>
capo_gamelift.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_gamelift.types.create_game_session_queue_input.CreateGameSessionQueueInput]",
) -> AsyncOperationResponse[
"capo_gamelift.types.create_game_session_queue_output.CreateGameSessionQueueOutput"
]:
import capo_gamelift._operations.game_lift.create_game_session_queue
(
output,
http_response,
) = await capo_gamelift._operations.game_lift.create_game_session_queue.async_create_game_session_queue(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
def _redact_input(
input_: "capo_gamelift.types.create_game_session_queue_input.CreateGameSessionQueueInput",
) -> dict[str, Any]:
import capo_gamelift.types.create_game_session_queue_input
return capo_gamelift.types.create_game_session_queue_input.redact_sensitive(
input_
)
def _redact_output(
output: "capo_gamelift.types.create_game_session_queue_output.CreateGameSessionQueueOutput",
) -> dict[str, Any]:
import capo_gamelift.types.create_game_session_queue_output
return (
capo_gamelift.types.create_game_session_queue_output.redact_sensitive(
output
)
)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging(
"CreateGameSessionQueue",
redact_input=_redact_input,
redact_output=_redact_output,
),
)
input_: capo_gamelift.types.create_game_session_queue_input.CreateGameSessionQueueInput = {}
if name is not None:
input_["name"] = name
if timeout_in_seconds is not None:
input_["timeout_in_seconds"] = timeout_in_seconds
if player_latency_policies is not None:
input_["player_latency_policies"] = player_latency_policies
if destinations is not None:
input_["destinations"] = destinations
if filter_configuration is not None:
input_["filter_configuration"] = filter_configuration
if priority_configuration is not None:
input_["priority_configuration"] = priority_configuration
if custom_event_data is not None:
input_["custom_event_data"] = custom_event_data
if notification_target is not None:
input_["notification_target"] = notification_target
if tags is not None:
input_["tags"] = tags
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|