This API works with the following fleet types: EC2 (FleetIQ)
Temporarily stops activity on a game server group without terminating instances or the game server group. You can restart activity by calling ResumeGameServerGroup. You can suspend the following activity:
-
Instance type replacement - This activity evaluates the current game hosting viability of all Spot instance types that are defined for the game server group. It updates the Auto Scaling group to remove nonviable Spot Instance types, which have a higher chance of game server interruptions. It then balances capacity across the remaining viable Spot Instance types. When this activity is suspended, the Auto Scaling group continues with its current balance, regardless of viability. Instance protection, utilization metrics, and capacity scaling activities continue to be active.
To suspend activity, specify a game server group ARN and the type of activity to be suspended. If successful, a GameServerGroup object is returned showing that the activity is listed in SuspendedActions.
Learn more
Amazon GameLift Servers FleetIQ Guide
Parameters:
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 suspend_game_server_group(
self,
*,
config_overrides: Optional[AsyncGameLiftClientConfig] = None,
game_server_group_name: Optional[
"capo_gamelift.types.game_server_group_name_or_arn.GameServerGroupNameOrArn"
] = None,
suspend_actions: Optional[
"capo_gamelift.types.game_server_group_actions.GameServerGroupActions"
] = None,
) -> "capo_gamelift.types.suspend_game_server_group_output.SuspendGameServerGroupOutput":
"""<p> <b>This API works with the following fleet types:</b> EC2 (FleetIQ)</p> <p>Temporarily stops activity on a game server group without terminating instances or the game server group. You can restart activity by calling <a href="../gamelift/latest/apireference/API_ResumeGameServerGroup.html">ResumeGameServerGroup</a>. You can suspend the following activity:</p> <ul> <li> <p> <b>Instance type replacement</b> - This activity evaluates the current game hosting viability of all Spot instance types that are defined for the game server group. It updates the Auto Scaling group to remove nonviable Spot Instance types, which have a higher chance of game server interruptions. It then balances capacity across the remaining viable Spot Instance types. When this activity is suspended, the Auto Scaling group continues with its current balance, regardless of viability. Instance protection, utilization metrics, and capacity scaling activities continue to be active. </p> </li> </ul> <p>To suspend activity, specify a game server group ARN and the type of activity to be suspended. If successful, a <code>GameServerGroup</code> object is returned showing that the activity is listed in <code>SuspendedActions</code>.</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>
suspend_actions: <p>The activity to suspend for this game server group.</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.suspend_game_server_group_input.SuspendGameServerGroupInput]",
) -> AsyncOperationResponse[
"capo_gamelift.types.suspend_game_server_group_output.SuspendGameServerGroupOutput"
]:
import capo_gamelift._operations.game_lift.suspend_game_server_group
(
output,
http_response,
) = await capo_gamelift._operations.game_lift.suspend_game_server_group.async_suspend_game_server_group(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("SuspendGameServerGroup")
)
input_: capo_gamelift.types.suspend_game_server_group_input.SuspendGameServerGroupInput = {}
if game_server_group_name is not None:
input_["game_server_group_name"] = game_server_group_name
if suspend_actions is not None:
input_["suspend_actions"] = suspend_actions
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|