Skip to content

deregister_game_server

deregister_game_server(
    *,
    config_overrides: Optional[GameLiftClientConfig] = None,
    game_server_group_name: Optional[GameServerGroupNameOrArn] = None,
    game_server_id: Optional[GameServerId] = None,
) -> None

This API works with the following fleet types: EC2 (FleetIQ)

Removes the game server from a game server group. As a result of this operation, the deregistered game server can no longer be claimed and will not be returned in a list of active game servers.

To deregister a game server, specify the game server group and game server ID. If successful, this operation emits a CloudWatch event with termination timestamp and reason.

Learn more

Amazon GameLift Servers FleetIQ Guide

Parameters:

  • game_server_group_name (Optional[GameServerGroupNameOrArn], default: None ) –

    A unique identifier for the game server group where the game server is running.

  • game_server_id (Optional[GameServerId], default: None ) –

    A custom string that uniquely identifies the game server to deregister.

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 deregister_game_server(
    self,
    *,
    config_overrides: Optional[GameLiftClientConfig] = None,
    game_server_group_name: Optional[
        "capo_gamelift.types.game_server_group_name_or_arn.GameServerGroupNameOrArn"
    ] = None,
    game_server_id: Optional[
        "capo_gamelift.types.game_server_id.GameServerId"
    ] = None,
) -> None:
    """<p> <b>This API works with the following fleet types:</b> EC2 (FleetIQ)</p> <p>Removes the game server from a game server group. As a result of this operation, the deregistered game server can no longer be claimed and will not be returned in a list of active game servers. </p> <p>To deregister a game server, specify the game server group and game server ID. If successful, this operation emits a CloudWatch event with termination timestamp and reason.</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 where the game server is running.</p>
        game_server_id: <p>A custom string that uniquely identifies the game server to deregister.</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.deregister_game_server_input.DeregisterGameServerInput]",
    ) -> OperationResponse[None]:
        import capo_gamelift._operations.game_lift.deregister_game_server

        output, http_response = (
            capo_gamelift._operations.game_lift.deregister_game_server.deregister_game_server(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeregisterGameServer")
    )
    input_: capo_gamelift.types.deregister_game_server_input.DeregisterGameServerInput = {}
    if game_server_group_name is not None:
        input_["game_server_group_name"] = game_server_group_name
    if game_server_id is not None:
        input_["game_server_id"] = game_server_id

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output