list method
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. The
group_id is a unique identifier for a particular error group. The
identifier is derived from key parts of the error-log content and is
treated as Service Data. For information about how Service Data is
handled, see
Google Cloud Privacy Notice.
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>);
}