Smaws_Client_GameLift.SearchGameSessionsThis API works with the following fleet types: EC2, Anywhere, Container
Retrieves all active game sessions that match a set of search criteria and sorts them into a specified order.
This operation is not designed to continually track game session status because that practice can cause you to exceed your API limit and generate errors. Instead, configure an Amazon Simple Notification Service (Amazon SNS) topic to receive notifications from a matchmaker or a game session placement queue.
When searching for game sessions, you specify exactly where you want to search and provide a search filter expression, a sort expression, or both. A search request can search only one fleet, but it can search all of a fleet's locations.
This operation can be used in the following ways:
Use the pagination parameters to retrieve results as a set of sequential pages.
If successful, a GameSession object is returned for each game session that matches the request. Search finds game sessions that are in ACTIVE status only. To retrieve information on game sessions in other statuses, use DescribeGameSessions.
To set search and sort criteria, create a filter expression using the following game session attributes. For game session search examples, see the Examples section of this topic.
gameSessionProperties -- A set of key-value pairs that can store custom data in a game session. For example: {"Key": "difficulty", "Value": "novice"}. The filter expression must specify the https://docs.aws.amazon.com/gamelift/latest/apireference/API_GameProperty -- a Key and a string Value to search for the game sessions.
For example, to search for the above key-value pair, specify the following search filter: gameSessionProperties.difficulty = "novice". All game property values are searched as strings.
For examples of searching game sessions, see the ones below, and also see Search game sessions by game property.
Returned values for playerSessionCount and hasAvailablePlayerSessions change quickly as players join sessions and others drop out. Results should be considered a snapshot in time. Be sure to refresh search results often, and handle sessions that fill up before a player can join.
val error_to_string :
[ Smaws_Lib.Protocols.AwsJson.error
| `InternalServiceException of Types.internal_service_exception
| `InvalidRequestException of Types.invalid_request_exception
| `NotFoundException of Types.not_found_exception
| `TerminalRoutingStrategyException of
Types.terminal_routing_strategy_exception
| `UnauthorizedException of Types.unauthorized_exception
| `UnsupportedRegionException of Types.unsupported_region_exception ] ->
stringval request :
'http_type Smaws_Lib.Context.t ->
Types.search_game_sessions_input ->
(Types.search_game_sessions_output,
[> Smaws_Lib.Protocols.AwsJson.error
| `InternalServiceException of Types.internal_service_exception
| `InvalidRequestException of Types.invalid_request_exception
| `NotFoundException of Types.not_found_exception
| `TerminalRoutingStrategyException of
Types.terminal_routing_strategy_exception
| `UnauthorizedException of Types.unauthorized_exception
| `UnsupportedRegionException of Types.unsupported_region_exception ])
Stdlib.resultval request_with_metadata :
'http_type Smaws_Lib.Context.t ->
Types.search_game_sessions_input ->
(Types.search_game_sessions_output Smaws_Lib.Response.t,
[> Smaws_Lib.Protocols.AwsJson.error
| `InternalServiceException of Types.internal_service_exception
| `InvalidRequestException of Types.invalid_request_exception
| `NotFoundException of Types.not_found_exception
| `TerminalRoutingStrategyException of
Types.terminal_routing_strategy_exception
| `UnauthorizedException of Types.unauthorized_exception
| `UnsupportedRegionException of Types.unsupported_region_exception ]
* Smaws_Lib.Response.metadata)
Stdlib.result