list method

Future<ListGroupStatsResponse> list(
  1. String projectName, {
  2. String? alignment,
  3. String? alignmentTime,
  4. List<String>? groupId,
  5. String? order,
  6. int? pageSize,
  7. String? pageToken,
  8. String? serviceFilter_resourceType,
  9. String? serviceFilter_service,
  10. String? serviceFilter_version,
  11. String? timeRange_period,
  12. String? timedCountDuration,
  13. String? $fields,
})

Lists the specified groups.

Request parameters:

projectName - Required. The resource name of the Google Cloud Platform project. Written as projects/{projectID} or projects/{projectNumber}, where {projectID} and {projectNumber} can be found in the Google Cloud Console. Examples: projects/my-project-123, projects/5551234. Value must have pattern ^projects/\[^/\]+$.

alignment - Optional. The alignment of the timed counts to be returned. Default is ALIGNMENT_EQUAL_AT_END. Possible string values are:

  • "ERROR_COUNT_ALIGNMENT_UNSPECIFIED" : No alignment specified.
  • "ALIGNMENT_EQUAL_ROUNDED" : The time periods shall be consecutive, have width equal to the requested duration, and be aligned at the alignment_time provided in the request. The alignment_time does not have to be inside the query period but even if it is outside, only time periods are returned which overlap with the query period. A rounded alignment will typically result in a different size of the first or the last time period.
  • "ALIGNMENT_EQUAL_AT_END" : The time periods shall be consecutive, have width equal to the requested duration, and be aligned at the end of the requested time period. This can result in a different size of the first time period.

alignmentTime - Optional. Time where the timed counts shall be aligned if rounded alignment is chosen. Default is 00:00 UTC.

groupId - Optional. List all ErrorGroupStats with these IDs.

order - Optional. The sort order in which the results are returned. Default is COUNT_DESC. Possible string values are:

  • "GROUP_ORDER_UNSPECIFIED" : No group order specified.
  • "COUNT_DESC" : Total count of errors in the given time window in descending order.
  • "LAST_SEEN_DESC" : Timestamp when the group was last seen in the given time window in descending order.
  • "CREATED_DESC" : Timestamp when the group was created in descending order.
  • "AFFECTED_USERS_DESC" : Number of affected users in the given time window in descending order.

pageSize - Optional. The maximum number of results to return per response. Default is 20.

pageToken - Optional. A next_page_token provided by a previous response. To view additional results, pass this token along with the identical query parameters as the first request.

serviceFilter_resourceType - Optional. The exact value to match against [ServiceContext.resource_type](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.resource_type).

serviceFilter_service - Optional. The exact value to match against [ServiceContext.service](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.service).

serviceFilter_version - Optional. The exact value to match against [ServiceContext.version](/error-reporting/reference/rest/v1beta1/ServiceContext#FIELDS.version).

timeRange_period - Restricts the query to the specified time range. Possible string values are:

  • "PERIOD_UNSPECIFIED" : Do not use.
  • "PERIOD_1_HOUR" : Retrieve data for the last hour. Recommended minimum timed count duration: 1 min.
  • "PERIOD_6_HOURS" : Retrieve data for the last 6 hours. Recommended minimum timed count duration: 10 min.
  • "PERIOD_1_DAY" : Retrieve data for the last day. Recommended minimum timed count duration: 1 hour.
  • "PERIOD_1_WEEK" : Retrieve data for the last week. Recommended minimum timed count duration: 6 hours.
  • "PERIOD_30_DAYS" : Retrieve data for the last 30 days. Recommended minimum timed count duration: 1 day.

timedCountDuration - Optional. The preferred duration for a single returned TimedCount. If not set, no timed counts are returned.

$fields - Selector specifying which fields to include in a partial response.

Completes with a ListGroupStatsResponse.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<ListGroupStatsResponse> list(
  core.String projectName, {
  core.String? alignment,
  core.String? alignmentTime,
  core.List<core.String>? groupId,
  core.String? order,
  core.int? pageSize,
  core.String? pageToken,
  core.String? serviceFilter_resourceType,
  core.String? serviceFilter_service,
  core.String? serviceFilter_version,
  core.String? timeRange_period,
  core.String? timedCountDuration,
  core.String? $fields,
}) async {
  final _queryParams = <core.String, core.List<core.String>>{
    if (alignment != null) 'alignment': [alignment],
    if (alignmentTime != null) 'alignmentTime': [alignmentTime],
    if (groupId != null) 'groupId': groupId,
    if (order != null) 'order': [order],
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if (serviceFilter_resourceType != null)
      'serviceFilter.resourceType': [serviceFilter_resourceType],
    if (serviceFilter_service != null)
      'serviceFilter.service': [serviceFilter_service],
    if (serviceFilter_version != null)
      'serviceFilter.version': [serviceFilter_version],
    if (timeRange_period != null) 'timeRange.period': [timeRange_period],
    if (timedCountDuration != null)
      'timedCountDuration': [timedCountDuration],
    if ($fields != null) 'fields': [$fields],
  };

  final _url =
      'v1beta1/' + core.Uri.encodeFull('$projectName') + '/groupStats';

  final _response = await _requester.request(
    _url,
    'GET',
    queryParams: _queryParams,
  );
  return ListGroupStatsResponse.fromJson(
      _response as core.Map<core.String, core.dynamic>);
}