Skip to content

describe_fleet_location_capacity async

describe_fleet_location_capacity(
    *,
    config_overrides: Optional[AsyncGameLiftClientConfig] = None,
    fleet_id: Optional[FleetIdOrArn] = None,
    location: Optional[LocationStringModel] = None,
) -> DescribeFleetLocationCapacityOutput

This API works with the following fleet types: EC2, Anywhere, Container

Retrieves the resource capacity settings for a fleet location. The data returned includes the current capacity (number of EC2 instances) and some scaling settings for the requested fleet location. For a managed container fleet, this operation also returns counts for game server container groups.

Use this operation to retrieve capacity information for a fleet's remote location or home Region (you can also retrieve home Region capacity by calling DescribeFleetCapacity).

To retrieve capacity data, identify a fleet and location.

If successful, a FleetCapacity object is returned for the requested fleet location.

Learn more

Setting up Amazon GameLift Servers fleets

Amazon GameLift Servers service locations for managed hosting

GameLift metrics for fleets

Parameters:

  • fleet_id (Optional[FleetIdOrArn], default: None ) –

    A unique identifier for the fleet to request location capacity for. You can use either the fleet ID or ARN value.

  • location (Optional[LocationStringModel], default: None ) –

    The fleet location to retrieve capacity information for. Specify a location in the form of an Amazon Web Services Region code, such as us-west-2.

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/async_game_lift.py
async def describe_fleet_location_capacity(
    self,
    *,
    config_overrides: Optional[AsyncGameLiftClientConfig] = None,
    fleet_id: Optional["capo_gamelift.types.fleet_id_or_arn.FleetIdOrArn"] = None,
    location: Optional[
        "capo_gamelift.types.location_string_model.LocationStringModel"
    ] = None,
) -> "capo_gamelift.types.describe_fleet_location_capacity_output.DescribeFleetLocationCapacityOutput":
    """<p> <b>This API works with the following fleet types:</b> EC2, Anywhere, Container</p> <p>Retrieves the resource capacity settings for a fleet location. The data returned includes the current capacity (number of EC2 instances) and some scaling settings for the requested fleet location. For a managed container fleet, this operation also returns counts for game server container groups.</p> <p>Use this operation to retrieve capacity information for a fleet's remote location or home Region (you can also retrieve home Region capacity by calling <code>DescribeFleetCapacity</code>).</p> <p>To retrieve capacity data, identify a fleet and location. </p> <p>If successful, a <code>FleetCapacity</code> object is returned for the requested fleet location. </p> <p> <b>Learn more</b> </p> <p> <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-intro.html">Setting up Amazon GameLift Servers fleets</a> </p> <p> <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-regions.html"> Amazon GameLift Servers service locations</a> for managed hosting</p> <p> <a href="https://docs.aws.amazon.com/gamelift/latest/developerguide/monitoring-cloudwatch.html#gamelift-metrics-fleet">GameLift metrics for fleets</a> </p>

    Args:
        fleet_id: <p>A unique identifier for the fleet to request location capacity for. You can use either the fleet ID or ARN value.</p>
        location: <p>The fleet location to retrieve capacity information for. Specify a location in the form of an Amazon Web Services Region code, such as <code>us-west-2</code>.</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.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_gamelift.types.describe_fleet_location_capacity_input.DescribeFleetLocationCapacityInput]",
    ) -> AsyncOperationResponse[
        "capo_gamelift.types.describe_fleet_location_capacity_output.DescribeFleetLocationCapacityOutput"
    ]:
        import capo_gamelift._operations.game_lift.describe_fleet_location_capacity

        (
            output,
            http_response,
        ) = await capo_gamelift._operations.game_lift.describe_fleet_location_capacity.async_describe_fleet_location_capacity(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeFleetLocationCapacity")
    )
    input_: capo_gamelift.types.describe_fleet_location_capacity_input.DescribeFleetLocationCapacityInput = {}
    if fleet_id is not None:
        input_["fleet_id"] = fleet_id
    if location is not None:
        input_["location"] = location

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output