describeCompute method

Future<DescribeComputeOutput> describeCompute({
  1. required String computeName,
  2. required String fleetId,
})

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.

May throw InternalServiceException. May throw InvalidRequestException. May throw NotFoundException. May throw UnauthorizedException. May throw UnsupportedRegionException.

Parameter computeName : 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.

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

Implementation

Future<DescribeComputeOutput> describeCompute({
  required String computeName,
  required String fleetId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'GameLift.DescribeCompute'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ComputeName': computeName,
      'FleetId': fleetId,
    },
  );

  return DescribeComputeOutput.fromJson(jsonResponse.body);
}