Skip to content

describe_compute async

describe_compute(
    *,
    config_overrides: Optional[AsyncGameLiftClientConfig] = None,
    fleet_id: Optional[FleetIdOrArn] = None,
    compute_name: Optional[ComputeNameOrArn] = None,
) -> DescribeComputeOutput

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

Retrieves properties for a specific compute resource in an Amazon GameLift Servers fleet. You can list all computes in a fleet by calling ListCompute.

Request options

Provide the fleet ID and compute name. The compute name varies depending on the type of fleet.

  • For a compute in a managed EC2 fleet, provide an instance ID. Each instance in the fleet is a compute.

  • For a compute in a managed container fleet, provide a compute name. In a container fleet, each game server container group on a fleet instance is assigned a compute name.

  • For a compute in an Anywhere fleet, provide a registered compute name. Anywhere fleet computes are created when you register a hosting resource with the fleet.

Results

If successful, this operation returns details for the requested compute resource. Depending on the fleet's compute type, the result includes the following information:

  • For a managed EC2 fleet, this operation returns information about the EC2 instance.

  • For an Anywhere fleet, this operation returns information about the registered compute.

Parameters:

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

    A unique identifier for the fleet that the compute belongs to. You can use either the fleet ID or ARN value.

  • compute_name (Optional[ComputeNameOrArn], default: None ) –

    The unique identifier of the compute resource to retrieve properties for. For a managed container fleet or Anywhere fleet, use a compute name. For an EC2 fleet, use an instance ID. To retrieve a fleet's compute identifiers, call ListCompute.

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_compute(
    self,
    *,
    config_overrides: Optional[AsyncGameLiftClientConfig] = None,
    fleet_id: Optional["capo_gamelift.types.fleet_id_or_arn.FleetIdOrArn"] = None,
    compute_name: Optional[
        "capo_gamelift.types.compute_name_or_arn.ComputeNameOrArn"
    ] = None,
) -> "capo_gamelift.types.describe_compute_output.DescribeComputeOutput":
    """<p> <b>This API works with the following fleet types:</b> EC2, Anywhere, Container</p> <p>Retrieves properties for a specific compute resource in an Amazon GameLift Servers fleet. You can list all computes in a fleet by calling <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_ListCompute.html">ListCompute</a>. </p> <p> <b>Request options</b> </p> <p>Provide the fleet ID and compute name. The compute name varies depending on the type of fleet.</p> <ul> <li> <p>For a compute in a managed EC2 fleet, provide an instance ID. Each instance in the fleet is a compute.</p> </li> <li> <p>For a compute in a managed container fleet, provide a compute name. In a container fleet, each game server container group on a fleet instance is assigned a compute name.</p> </li> <li> <p>For a compute in an Anywhere fleet, provide a registered compute name. Anywhere fleet computes are created when you register a hosting resource with the fleet.</p> </li> </ul> <p> <b>Results</b> </p> <p>If successful, this operation returns details for the requested compute resource. Depending on the fleet's compute type, the result includes the following information: </p> <ul> <li> <p>For a managed EC2 fleet, this operation returns information about the EC2 instance.</p> </li> <li> <p>For an Anywhere fleet, this operation returns information about the registered compute.</p> </li> </ul>

    Args:
        fleet_id: <p>A unique identifier for the fleet that the compute belongs to. You can use either the fleet ID or ARN value.</p>
        compute_name: <p>The unique identifier of the compute resource to retrieve properties for. For a managed container fleet or Anywhere fleet, use a compute name. For an EC2 fleet, use an instance ID. To retrieve a fleet's compute identifiers, call <a href="https://docs.aws.amazon.com/gamelift/latest/apireference/API_ListCompute.html">ListCompute</a>.</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_compute_input.DescribeComputeInput]",
    ) -> AsyncOperationResponse[
        "capo_gamelift.types.describe_compute_output.DescribeComputeOutput"
    ]:
        import capo_gamelift._operations.game_lift.describe_compute

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

    def _redact_output(
        output: "capo_gamelift.types.describe_compute_output.DescribeComputeOutput",
    ) -> dict[str, Any]:
        import capo_gamelift.types.describe_compute_output

        return capo_gamelift.types.describe_compute_output.redact_sensitive(output)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("DescribeCompute", redact_output=_redact_output),
    )
    input_: capo_gamelift.types.describe_compute_input.DescribeComputeInput = {}
    if fleet_id is not None:
        input_["fleet_id"] = fleet_id
    if compute_name is not None:
        input_["compute_name"] = compute_name

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