startSessionsStatisticsAggregation method

Future<StartSessionsStatisticsAggregationResponse> startSessionsStatisticsAggregation({
  1. required DateTime endTime,
  2. required String farmId,
  3. required List<UsageGroupByField> groupBy,
  4. required SessionsStatisticsResources resourceIds,
  5. required DateTime startTime,
  6. required List<UsageStatistic> statistics,
  7. Period? period,
  8. String? timezone,
})

Starts an asynchronous request for getting aggregated statistics about queues and farms. Get the statistics using the GetSessionsStatisticsAggregation operation. You can only have one running aggregation for your Deadline Cloud farm. Call the GetSessionsStatisticsAggregation operation and check the status field to see if an aggregation is running. Statistics are available for 1 hour after you call the StartSessionsStatisticsAggregation operation.

May throw AccessDeniedException. May throw InternalServerErrorException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter endTime : The Linux timestamp of the date and time that the statistics end.

Parameter farmId : The identifier of the farm that contains queues or fleets to return statistics for.

Parameter groupBy : The field to use to group the statistics.

Parameter resourceIds : A list of fleet IDs or queue IDs to gather statistics for.

Parameter startTime : The Linux timestamp of the date and time that the statistics start.

Parameter statistics : One to four statistics to return.

Parameter period : The period to aggregate the statistics.

Parameter timezone : The timezone to use for the statistics. Use UTC notation such as "UTC+8."

Implementation

Future<StartSessionsStatisticsAggregationResponse>
    startSessionsStatisticsAggregation({
  required DateTime endTime,
  required String farmId,
  required List<UsageGroupByField> groupBy,
  required SessionsStatisticsResources resourceIds,
  required DateTime startTime,
  required List<UsageStatistic> statistics,
  Period? period,
  String? timezone,
}) async {
  final $payload = <String, dynamic>{
    'endTime': iso8601ToJson(endTime),
    'groupBy': groupBy.map((e) => e.value).toList(),
    'resourceIds': resourceIds,
    'startTime': iso8601ToJson(startTime),
    'statistics': statistics.map((e) => e.value).toList(),
    if (period != null) 'period': period.value,
    if (timezone != null) 'timezone': timezone,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/2023-10-12/farms/${Uri.encodeComponent(farmId)}/sessions-statistics-aggregation',
    exceptionFnMap: _exceptionFns,
  );
  return StartSessionsStatisticsAggregationResponse.fromJson(response);
}