describeFleetLocationAttributes method

Future<DescribeFleetLocationAttributesOutput> describeFleetLocationAttributes({
  1. required String fleetId,
  2. int? limit,
  3. List<String>? locations,
  4. String? nextToken,
})

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

Retrieves information on a fleet's remote locations, including life-cycle status and any suspended fleet activity.

This operation can be used in the following ways:

  • To get data for specific locations, provide a fleet identifier and a list of locations. Location data is returned in the order that it is requested.
  • To get data for all locations, provide a fleet identifier only. Location data is returned in no particular order.
When requesting attributes for multiple locations, use the pagination parameters to retrieve results as a set of sequential pages.

If successful, a LocationAttributes object is returned for each requested location. If the fleet does not have a requested location, no information is returned. This operation does not return the home Region. To get information on a fleet's home Region, call DescribeFleetAttributes.

Learn more

Setting up Amazon GameLift Servers fleets

Amazon GameLift Servers service locations for managed hosting

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

Parameter fleetId : A unique identifier for the fleet to retrieve remote locations for. You can use either the fleet ID or ARN value.

Parameter limit : The maximum number of results to return. Use this parameter with NextToken to get results as a set of sequential pages. This limit is not currently enforced.

Parameter locations : A list of fleet locations to retrieve information for. Specify locations in the form of an Amazon Web Services Region code, such as us-west-2.

Parameter nextToken : A token that indicates the start of the next sequential page of results. Use the token that is returned with a previous call to this operation. To start at the beginning of the result set, do not specify a value.

Implementation

Future<DescribeFleetLocationAttributesOutput>
    describeFleetLocationAttributes({
  required String fleetId,
  int? limit,
  List<String>? locations,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'limit',
    limit,
    1,
    1152921504606846976,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'GameLift.DescribeFleetLocationAttributes'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'FleetId': fleetId,
      if (limit != null) 'Limit': limit,
      if (locations != null) 'Locations': locations,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return DescribeFleetLocationAttributesOutput.fromJson(jsonResponse.body);
}