describeFleetEvents method

Future<DescribeFleetEventsOutput> describeFleetEvents({
  1. required String fleetId,
  2. DateTime? endTime,
  3. int? limit,
  4. String? nextToken,
  5. DateTime? startTime,
})

Retrieves entries from the specified fleet's event log. 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 GameLift Fleets

Related operations

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

Parameter fleetId : A unique identifier for a fleet to get event logs for. You can use either the fleet ID or ARN value.

Parameter endTime : 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 : 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 : 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 {
  ArgumentError.checkNotNull(fleetId, 'fleetId');
  _s.validateNumRange(
    'limit',
    limit,
    1,
    1152921504606846976,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    1,
    1024,
  );
  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);
}