This API works with the following fleet types: EC2, Anywhere, Container
Retrieves information, including current status, about a game session placement request.
To get game session placement details, specify the placement ID.
This operation is not designed to be continually called to track game session status. This practice can cause you to exceed your API limit, which results in errors. Instead, you must configure an Amazon Simple Notification Service (SNS) topic to receive notifications from FlexMatch or queues. Continuously polling with DescribeGameSessionPlacement should only be used for games in development with low game session usage. For a reference implementation of event-based game session placement tracking, see Event-based game session placement guidance in the Amazon GameLift Toolkit.
Parameters:
-
placement_id
(Optional[IdStringModel], default:
None
)
–
A unique identifier for a game session placement to retrieve.
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.
-
NotFoundException
–
The requested resource was not found. The resource was either not created yet or deleted.
-
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/game_lift.py
| def describe_game_session_placement(
self,
*,
config_overrides: Optional[GameLiftClientConfig] = None,
placement_id: Optional[
"capo_gamelift.types.id_string_model.IdStringModel"
] = None,
) -> "capo_gamelift.types.describe_game_session_placement_output.DescribeGameSessionPlacementOutput":
"""<p> <b>This API works with the following fleet types:</b> EC2, Anywhere, Container</p> <p>Retrieves information, including current status, about a game session placement request. </p> <p>To get game session placement details, specify the placement ID.</p> <p>This operation is not designed to be continually called to track game session status. This practice can cause you to exceed your API limit, which results in errors. Instead, you must configure an Amazon Simple Notification Service (SNS) topic to receive notifications from FlexMatch or queues. Continuously polling with <code>DescribeGameSessionPlacement</code> should only be used for games in development with low game session usage. For a reference implementation of event-based game session placement tracking, see <a href="https://github.com/amazon-gamelift/amazon-gamelift-toolkit/tree/main/event-based-session-placement"> Event-based game session placement guidance</a> in the Amazon GameLift Toolkit.</p>
Args:
placement_id: <p>A unique identifier for a game session placement to retrieve.</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.not_found_exception.NotFoundException: <p>The requested resource was not found. The resource was either not created yet or deleted.</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.
"""
def _handler(
req: "OperationRequest[capo_gamelift.types.describe_game_session_placement_input.DescribeGameSessionPlacementInput]",
) -> OperationResponse[
"capo_gamelift.types.describe_game_session_placement_output.DescribeGameSessionPlacementOutput"
]:
import capo_gamelift._operations.game_lift.describe_game_session_placement
output, http_response = (
capo_gamelift._operations.game_lift.describe_game_session_placement.describe_game_session_placement(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
def _redact_output(
output: "capo_gamelift.types.describe_game_session_placement_output.DescribeGameSessionPlacementOutput",
) -> dict[str, Any]:
import capo_gamelift.types.describe_game_session_placement_output
return capo_gamelift.types.describe_game_session_placement_output.redact_sensitive(
output
)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging(
"DescribeGameSessionPlacement", redact_output=_redact_output
),
)
input_: capo_gamelift.types.describe_game_session_placement_input.DescribeGameSessionPlacementInput = {}
if placement_id is not None:
input_["placement_id"] = placement_id
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|