listLocations method
This API works with the following fleet types: EC2, Anywhere, Container
Lists all custom and Amazon Web Services locations where Amazon GameLift Servers can host game servers. This operation also returns UDP ping beacon information for locations, which you can use to measure network latency between player devices and potential hosting locations.
Learn more
May throw InternalServiceException.
May throw InvalidRequestException.
May throw UnauthorizedException.
Parameter filters :
Filters the list for AWS or CUSTOM locations.
Use this parameter to narrow down results to only Amazon Web
Services-managed locations (Amazon EC2 or container) or only your custom
locations (such as an Amazon GameLift Servers Anywhere fleet).
Parameter limit :
The maximum number of results to return. Use this parameter with
NextToken to get results as a set of sequential pages.
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<ListLocationsOutput> listLocations({
List<LocationFilter>? filters,
int? limit,
String? nextToken,
}) async {
_s.validateNumRange(
'limit',
limit,
1,
200,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'GameLift.ListLocations'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
if (filters != null) 'Filters': filters.map((e) => e.value).toList(),
if (limit != null) 'Limit': limit,
if (nextToken != null) 'NextToken': nextToken,
},
);
return ListLocationsOutput.fromJson(jsonResponse.body);
}