list method

Future<ListEventsResponse> list(
  1. String projectName, {
  2. String? groupId,
  3. int? pageSize,
  4. String? pageToken,
  5. String? serviceFilter_resourceType,
  6. String? serviceFilter_service,
  7. String? serviceFilter_version,
  8. String? timeRange_period,
  9. String? $fields,
})

Lists the specified events.

Request parameters:

projectName - Required. The resource name of the Google Cloud Platform project. Written as projects/{projectID}, where {projectID} is the Google Cloud Platform project ID. Example: projects/my-project-123. Value must have pattern ^projects/\[^/\]+$.

groupId - Required. The group for which events shall be returned.

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

pageToken - Optional. A next_page_token provided by a previous response.

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.

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

Completes with a ListEventsResponse.

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<ListEventsResponse> list(
  core.String projectName, {
  core.String? groupId,
  core.int? pageSize,
  core.String? pageToken,
  core.String? serviceFilter_resourceType,
  core.String? serviceFilter_service,
  core.String? serviceFilter_version,
  core.String? timeRange_period,
  core.String? $fields,
}) async {
  final _queryParams = <core.String, core.List<core.String>>{
    if (groupId != null) 'groupId': [groupId],
    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 ($fields != null) 'fields': [$fields],
  };

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

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