This API works with the following fleet types: EC2 (FleetIQ)
Retrieves status information about the Amazon EC2 instances associated with a Amazon GameLift Servers FleetIQ game server group. Use this operation to detect when instances are active or not available to host new game servers.
To request status for all instances in the game server group, provide a game server group ID only. To request status for specific instances, provide the game server group ID and one or more instance IDs. Use the pagination parameters to retrieve results in sequential segments. If successful, a collection of GameServerInstance objects is returned.
This operation is not designed to be called with every game server claim request; this practice can cause you to exceed your API limit, which results in errors. Instead, as a best practice, cache the results and refresh your cache no more than once every 10 seconds.
Learn more
Amazon GameLift Servers FleetIQ Guide
Parameters:
-
game_server_group_name
(Optional[GameServerGroupNameOrArn], default:
None
)
–
A unique identifier for the game server group. Use either the name or ARN value.
-
instance_ids
(Optional[GameServerInstanceIds], default:
None
)
–
The Amazon EC2 instance IDs that you want to retrieve status on. Amazon EC2 instance IDs use a 17-character format, for example: i-1234567890abcdef0. To retrieve all instances in the game server group, leave this parameter empty.
-
limit
(Optional[PositiveInteger], default:
None
)
–
The maximum number of results to return. Use this parameter with NextToken to get results as a set of sequential pages.
-
next_token
(Optional[NonZeroAndMaxString], default:
None
)
–
A token that indicates the start of the next sequential page of results. Use the token that is returned with a previous call to this operation. To start at the beginning of the result set, do not specify a value.
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/async_game_lift.py
| async def describe_game_server_instances(
self,
*,
config_overrides: Optional[AsyncGameLiftClientConfig] = None,
game_server_group_name: Optional[
"capo_gamelift.types.game_server_group_name_or_arn.GameServerGroupNameOrArn"
] = None,
instance_ids: Optional[
"capo_gamelift.types.game_server_instance_ids.GameServerInstanceIds"
] = None,
limit: Optional["capo_gamelift.types.positive_integer.PositiveInteger"] = None,
next_token: Optional[
"capo_gamelift.types.non_zero_and_max_string.NonZeroAndMaxString"
] = None,
) -> "capo_gamelift.types.describe_game_server_instances_output.DescribeGameServerInstancesOutput":
"""<p> <b>This API works with the following fleet types:</b> EC2 (FleetIQ)</p> <p>Retrieves status information about the Amazon EC2 instances associated with a Amazon GameLift Servers FleetIQ game server group. Use this operation to detect when instances are active or not available to host new game servers.</p> <p>To request status for all instances in the game server group, provide a game server group ID only. To request status for specific instances, provide the game server group ID and one or more instance IDs. Use the pagination parameters to retrieve results in sequential segments. If successful, a collection of <code>GameServerInstance</code> objects is returned. </p> <p>This operation is not designed to be called with every game server claim request; this practice can cause you to exceed your API limit, which results in errors. Instead, as a best practice, cache the results and refresh your cache no more than once every 10 seconds.</p> <p> <b>Learn more</b> </p> <p> <a href="https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/gsg-intro.html">Amazon GameLift Servers FleetIQ Guide</a> </p>
Args:
game_server_group_name: <p>A unique identifier for the game server group. Use either the name or ARN value.</p>
instance_ids: <p>The Amazon EC2 instance IDs that you want to retrieve status on. Amazon EC2 instance IDs use a 17-character format, for example: <code>i-1234567890abcdef0</code>. To retrieve all instances in the game server group, leave this parameter empty. </p>
limit: <p>The maximum number of results to return. Use this parameter with <code>NextToken</code> to get results as a set of sequential pages.</p>
next_token: <p>A token that indicates the start of the next sequential page of results. Use the token that is returned with a previous call to this operation. To start at the beginning of the result set, do not specify a value.</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.
"""
async def _handler(
req: "AsyncOperationRequest[capo_gamelift.types.describe_game_server_instances_input.DescribeGameServerInstancesInput]",
) -> AsyncOperationResponse[
"capo_gamelift.types.describe_game_server_instances_output.DescribeGameServerInstancesOutput"
]:
import capo_gamelift._operations.game_lift.describe_game_server_instances
(
output,
http_response,
) = await capo_gamelift._operations.game_lift.describe_game_server_instances.async_describe_game_server_instances(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DescribeGameServerInstances")
)
input_: capo_gamelift.types.describe_game_server_instances_input.DescribeGameServerInstancesInput = {}
if game_server_group_name is not None:
input_["game_server_group_name"] = game_server_group_name
if instance_ids is not None:
input_["instance_ids"] = instance_ids
if limit is not None:
input_["limit"] = limit
if next_token is not None:
input_["next_token"] = next_token
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|