describeFleetEvents method
This API works with the following fleet types: EC2, Anywhere, Container
Retrieves entries from a fleet's event log. Fleet events are initiated by changes in status, such as during fleet creation and termination, changes in capacity, etc. If a fleet has multiple locations, events are also initiated by changes to status and capacity in remote locations.
You can specify a time range to limit the result set. Use the pagination parameters to retrieve results as a set of sequential pages.
If successful, a collection of event log entries matching the request are returned.
Learn more
Setting up Amazon GameLift Servers fleets
May throw InternalServiceException.
May throw InvalidRequestException.
May throw NotFoundException.
May throw UnauthorizedException.
May throw UnsupportedRegionException.
Parameter fleetId :
A unique identifier for the fleet to get event logs for. You can use
either the fleet ID or ARN value.
Parameter endTime :
The most recent date to retrieve event logs for. If no end time is
specified, this call returns entries from the specified start time up to
the present. Format is a number expressed in Unix time as milliseconds
(ex: "1469498468.057").
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.
Parameter startTime :
The earliest date to retrieve event logs for. If no start time is
specified, this call returns entries starting from when the fleet was
created to the specified end time. Format is a number expressed in Unix
time as milliseconds (ex: "1469498468.057").
Implementation
Future<DescribeFleetEventsOutput> describeFleetEvents({
required String fleetId,
DateTime? endTime,
int? limit,
String? nextToken,
DateTime? startTime,
}) async {
_s.validateNumRange(
'limit',
limit,
1,
1152921504606846976,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'GameLift.DescribeFleetEvents'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'FleetId': fleetId,
if (endTime != null) 'EndTime': unixTimestampToJson(endTime),
if (limit != null) 'Limit': limit,
if (nextToken != null) 'NextToken': nextToken,
if (startTime != null) 'StartTime': unixTimestampToJson(startTime),
},
);
return DescribeFleetEventsOutput.fromJson(jsonResponse.body);
}