Skip to content

delete_location

delete_location(
    *,
    config_overrides: Optional[GameLiftClientConfig] = None,
    location_name: Optional[CustomLocationNameOrArnModel] = None,
) -> DeleteLocationOutput

This API works with the following fleet types: Anywhere

Deletes a custom location.

Before deleting a custom location, review any fleets currently using the custom location and deregister the location if it is in use. For more information, see DeregisterCompute.

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.

  • UnsupportedRegionException –

    The requested operation is not supported in the Region specified.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_gamelift/_services/game_lift.py
def delete_location(
    self,
    *,
    config_overrides: Optional[GameLiftClientConfig] = None,
    location_name: Optional[
        "capo_gamelift.types.custom_location_name_or_arn_model.CustomLocationNameOrArnModel"
    ] = None,
) -> "capo_gamelift.types.delete_location_output.DeleteLocationOutput":
    """<p> <b>This API works with the following fleet types:</b> Anywhere</p> <p>Deletes a custom location.</p> <p>Before deleting a custom location, review any fleets currently using the custom location and deregister the location if it is in use. For more information, see <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_DeregisterCompute.html">DeregisterCompute</a>.</p>

    Args:
        location_name: <p>The location name of the custom location to be deleted.</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.unsupported_region_exception.UnsupportedRegionException: <p>The requested operation is not supported in the Region specified.</p>
        capo_gamelift.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_gamelift.types.delete_location_input.DeleteLocationInput]",
    ) -> OperationResponse[
        "capo_gamelift.types.delete_location_output.DeleteLocationOutput"
    ]:
        import capo_gamelift._operations.game_lift.delete_location

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteLocation")
    )
    input_: capo_gamelift.types.delete_location_input.DeleteLocationInput = {}
    if location_name is not None:
        input_["location_name"] = location_name

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