google-cloud-error_reporting 0.35.0 → 0.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +2 -1
- data/CHANGELOG.md +47 -0
- data/CONTRIBUTING.md +2 -2
- data/LOGGING.md +1 -1
- data/TROUBLESHOOTING.md +2 -8
- data/lib/google-cloud-error_reporting.rb +8 -14
- data/lib/google/cloud/error_reporting.rb +16 -13
- data/lib/google/cloud/error_reporting/async_error_reporter.rb +2 -2
- data/lib/google/cloud/error_reporting/credentials.rb +2 -2
- data/lib/google/cloud/error_reporting/error_event.rb +14 -18
- data/lib/google/cloud/error_reporting/middleware.rb +5 -5
- data/lib/google/cloud/error_reporting/rails.rb +2 -2
- data/lib/google/cloud/error_reporting/service.rb +15 -36
- data/lib/google/cloud/error_reporting/version.rb +1 -1
- metadata +13 -74
- data/lib/google/cloud/error_reporting/v1beta1.rb +0 -19
- data/lib/google/cloud/error_reporting/v1beta1/credentials.rb +0 -41
- data/lib/google/cloud/error_reporting/v1beta1/doc/google/devtools/clouderrorreporting/v1beta1/common.rb +0 -158
- data/lib/google/cloud/error_reporting/v1beta1/doc/google/devtools/clouderrorreporting/v1beta1/error_group_service.rb +0 -41
- data/lib/google/cloud/error_reporting/v1beta1/doc/google/devtools/clouderrorreporting/v1beta1/error_stats_service.rb +0 -314
- data/lib/google/cloud/error_reporting/v1beta1/doc/google/devtools/clouderrorreporting/v1beta1/report_errors_service.rb +0 -79
- data/lib/google/cloud/error_reporting/v1beta1/doc/google/protobuf/duration.rb +0 -91
- data/lib/google/cloud/error_reporting/v1beta1/doc/google/protobuf/timestamp.rb +0 -113
- data/lib/google/cloud/error_reporting/v1beta1/error_group_service_client.rb +0 -285
- data/lib/google/cloud/error_reporting/v1beta1/error_group_service_client_config.json +0 -36
- data/lib/google/cloud/error_reporting/v1beta1/error_stats_service_client.rb +0 -457
- data/lib/google/cloud/error_reporting/v1beta1/error_stats_service_client_config.json +0 -41
- data/lib/google/cloud/error_reporting/v1beta1/report_errors_service_client.rb +0 -254
- data/lib/google/cloud/error_reporting/v1beta1/report_errors_service_client_config.json +0 -31
- data/lib/google/devtools/clouderrorreporting/v1beta1/common_pb.rb +0 -64
- data/lib/google/devtools/clouderrorreporting/v1beta1/error_group_service_pb.rb +0 -30
- data/lib/google/devtools/clouderrorreporting/v1beta1/error_group_service_services_pb.rb +0 -50
- data/lib/google/devtools/clouderrorreporting/v1beta1/error_stats_service_pb.rb +0 -116
- data/lib/google/devtools/clouderrorreporting/v1beta1/error_stats_service_services_pb.rb +0 -52
- data/lib/google/devtools/clouderrorreporting/v1beta1/report_errors_service_pb.rb +0 -38
- data/lib/google/devtools/clouderrorreporting/v1beta1/report_errors_service_services_pb.rb +0 -55
@@ -1,36 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"interfaces": {
|
3
|
-
"google.devtools.clouderrorreporting.v1beta1.ErrorGroupService": {
|
4
|
-
"retry_codes": {
|
5
|
-
"idempotent": [
|
6
|
-
"DEADLINE_EXCEEDED",
|
7
|
-
"UNAVAILABLE"
|
8
|
-
],
|
9
|
-
"non_idempotent": []
|
10
|
-
},
|
11
|
-
"retry_params": {
|
12
|
-
"default": {
|
13
|
-
"initial_retry_delay_millis": 100,
|
14
|
-
"retry_delay_multiplier": 1.3,
|
15
|
-
"max_retry_delay_millis": 60000,
|
16
|
-
"initial_rpc_timeout_millis": 20000,
|
17
|
-
"rpc_timeout_multiplier": 1.0,
|
18
|
-
"max_rpc_timeout_millis": 20000,
|
19
|
-
"total_timeout_millis": 600000
|
20
|
-
}
|
21
|
-
},
|
22
|
-
"methods": {
|
23
|
-
"GetGroup": {
|
24
|
-
"timeout_millis": 60000,
|
25
|
-
"retry_codes_name": "idempotent",
|
26
|
-
"retry_params_name": "default"
|
27
|
-
},
|
28
|
-
"UpdateGroup": {
|
29
|
-
"timeout_millis": 60000,
|
30
|
-
"retry_codes_name": "non_idempotent",
|
31
|
-
"retry_params_name": "default"
|
32
|
-
}
|
33
|
-
}
|
34
|
-
}
|
35
|
-
}
|
36
|
-
}
|
@@ -1,457 +0,0 @@
|
|
1
|
-
# Copyright 2020 Google LLC
|
2
|
-
#
|
3
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
-
# you may not use this file except in compliance with the License.
|
5
|
-
# You may obtain a copy of the License at
|
6
|
-
#
|
7
|
-
# https://www.apache.org/licenses/LICENSE-2.0
|
8
|
-
#
|
9
|
-
# Unless required by applicable law or agreed to in writing, software
|
10
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
-
# See the License for the specific language governing permissions and
|
13
|
-
# limitations under the License.
|
14
|
-
#
|
15
|
-
# EDITING INSTRUCTIONS
|
16
|
-
# This file was generated from the file
|
17
|
-
# https://github.com/googleapis/googleapis/blob/master/google/devtools/clouderrorreporting/v1beta1/error_stats_service.proto,
|
18
|
-
# and updates to that file get reflected here through a refresh process.
|
19
|
-
# For the short term, the refresh process will only be runnable by Google
|
20
|
-
# engineers.
|
21
|
-
|
22
|
-
|
23
|
-
require "json"
|
24
|
-
require "pathname"
|
25
|
-
|
26
|
-
require "google/gax"
|
27
|
-
|
28
|
-
require "google/devtools/clouderrorreporting/v1beta1/error_stats_service_pb"
|
29
|
-
require "google/cloud/error_reporting/v1beta1/credentials"
|
30
|
-
require "google/cloud/error_reporting/version"
|
31
|
-
|
32
|
-
module Google
|
33
|
-
module Cloud
|
34
|
-
module ErrorReporting
|
35
|
-
module V1beta1
|
36
|
-
# An API for retrieving and managing error statistics as well as data for
|
37
|
-
# individual events.
|
38
|
-
#
|
39
|
-
# @!attribute [r] error_stats_service_stub
|
40
|
-
# @return [Google::Devtools::Clouderrorreporting::V1beta1::ErrorStatsService::Stub]
|
41
|
-
class ErrorStatsServiceClient
|
42
|
-
# @private
|
43
|
-
attr_reader :error_stats_service_stub
|
44
|
-
|
45
|
-
# The default address of the service.
|
46
|
-
SERVICE_ADDRESS = "clouderrorreporting.googleapis.com".freeze
|
47
|
-
|
48
|
-
# The default port of the service.
|
49
|
-
DEFAULT_SERVICE_PORT = 443
|
50
|
-
|
51
|
-
# The default set of gRPC interceptors.
|
52
|
-
GRPC_INTERCEPTORS = []
|
53
|
-
|
54
|
-
DEFAULT_TIMEOUT = 30
|
55
|
-
|
56
|
-
PAGE_DESCRIPTORS = {
|
57
|
-
"list_group_stats" => Google::Gax::PageDescriptor.new(
|
58
|
-
"page_token",
|
59
|
-
"next_page_token",
|
60
|
-
"error_group_stats"),
|
61
|
-
"list_events" => Google::Gax::PageDescriptor.new(
|
62
|
-
"page_token",
|
63
|
-
"next_page_token",
|
64
|
-
"error_events")
|
65
|
-
}.freeze
|
66
|
-
|
67
|
-
private_constant :PAGE_DESCRIPTORS
|
68
|
-
|
69
|
-
# The scopes needed to make gRPC calls to all of the methods defined in
|
70
|
-
# this service.
|
71
|
-
ALL_SCOPES = [
|
72
|
-
"https://www.googleapis.com/auth/cloud-platform"
|
73
|
-
].freeze
|
74
|
-
|
75
|
-
|
76
|
-
PROJECT_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
77
|
-
"projects/{project}"
|
78
|
-
)
|
79
|
-
|
80
|
-
private_constant :PROJECT_PATH_TEMPLATE
|
81
|
-
|
82
|
-
# Returns a fully-qualified project resource name string.
|
83
|
-
# @param project [String]
|
84
|
-
# @return [String]
|
85
|
-
def self.project_path project
|
86
|
-
PROJECT_PATH_TEMPLATE.render(
|
87
|
-
:"project" => project
|
88
|
-
)
|
89
|
-
end
|
90
|
-
|
91
|
-
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
|
92
|
-
# Provides the means for authenticating requests made by the client. This parameter can
|
93
|
-
# be many types.
|
94
|
-
# A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
|
95
|
-
# authenticating requests made by this client.
|
96
|
-
# A `String` will be treated as the path to the keyfile to be used for the construction of
|
97
|
-
# credentials for this client.
|
98
|
-
# A `Hash` will be treated as the contents of a keyfile to be used for the construction of
|
99
|
-
# credentials for this client.
|
100
|
-
# A `GRPC::Core::Channel` will be used to make calls through.
|
101
|
-
# A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
|
102
|
-
# should already be composed with a `GRPC::Core::CallCredentials` object.
|
103
|
-
# A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
|
104
|
-
# metadata for requests, generally, to give OAuth credentials.
|
105
|
-
# @param scopes [Array<String>]
|
106
|
-
# The OAuth scopes for this service. This parameter is ignored if
|
107
|
-
# an updater_proc is supplied.
|
108
|
-
# @param client_config [Hash]
|
109
|
-
# A Hash for call options for each method. See
|
110
|
-
# Google::Gax#construct_settings for the structure of
|
111
|
-
# this data. Falls back to the default config if not specified
|
112
|
-
# or the specified config is missing data points.
|
113
|
-
# @param timeout [Numeric]
|
114
|
-
# The default timeout, in seconds, for calls made through this client.
|
115
|
-
# @param metadata [Hash]
|
116
|
-
# Default metadata to be sent with each request. This can be overridden on a per call basis.
|
117
|
-
# @param service_address [String]
|
118
|
-
# Override for the service hostname, or `nil` to leave as the default.
|
119
|
-
# @param service_port [Integer]
|
120
|
-
# Override for the service port, or `nil` to leave as the default.
|
121
|
-
# @param exception_transformer [Proc]
|
122
|
-
# An optional proc that intercepts any exceptions raised during an API call to inject
|
123
|
-
# custom error handling.
|
124
|
-
def initialize \
|
125
|
-
credentials: nil,
|
126
|
-
scopes: ALL_SCOPES,
|
127
|
-
client_config: {},
|
128
|
-
timeout: DEFAULT_TIMEOUT,
|
129
|
-
metadata: nil,
|
130
|
-
service_address: nil,
|
131
|
-
service_port: nil,
|
132
|
-
exception_transformer: nil,
|
133
|
-
lib_name: nil,
|
134
|
-
lib_version: ""
|
135
|
-
# These require statements are intentionally placed here to initialize
|
136
|
-
# the gRPC module only when it's required.
|
137
|
-
# See https://github.com/googleapis/toolkit/issues/446
|
138
|
-
require "google/gax/grpc"
|
139
|
-
require "google/devtools/clouderrorreporting/v1beta1/error_stats_service_services_pb"
|
140
|
-
|
141
|
-
credentials ||= Google::Cloud::ErrorReporting::V1beta1::Credentials.default
|
142
|
-
|
143
|
-
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
144
|
-
updater_proc = Google::Cloud::ErrorReporting::V1beta1::Credentials.new(credentials).updater_proc
|
145
|
-
end
|
146
|
-
if credentials.is_a?(GRPC::Core::Channel)
|
147
|
-
channel = credentials
|
148
|
-
end
|
149
|
-
if credentials.is_a?(GRPC::Core::ChannelCredentials)
|
150
|
-
chan_creds = credentials
|
151
|
-
end
|
152
|
-
if credentials.is_a?(Proc)
|
153
|
-
updater_proc = credentials
|
154
|
-
end
|
155
|
-
if credentials.is_a?(Google::Auth::Credentials)
|
156
|
-
updater_proc = credentials.updater_proc
|
157
|
-
end
|
158
|
-
|
159
|
-
package_version = Google::Cloud::ErrorReporting::VERSION
|
160
|
-
|
161
|
-
google_api_client = "gl-ruby/#{RUBY_VERSION}"
|
162
|
-
google_api_client << " #{lib_name}/#{lib_version}" if lib_name
|
163
|
-
google_api_client << " gapic/#{package_version} gax/#{Google::Gax::VERSION}"
|
164
|
-
google_api_client << " grpc/#{GRPC::VERSION}"
|
165
|
-
google_api_client.freeze
|
166
|
-
|
167
|
-
headers = { :"x-goog-api-client" => google_api_client }
|
168
|
-
if credentials.respond_to?(:quota_project_id) && credentials.quota_project_id
|
169
|
-
headers[:"x-goog-user-project"] = credentials.quota_project_id
|
170
|
-
end
|
171
|
-
headers.merge!(metadata) unless metadata.nil?
|
172
|
-
client_config_file = Pathname.new(__dir__).join(
|
173
|
-
"error_stats_service_client_config.json"
|
174
|
-
)
|
175
|
-
defaults = client_config_file.open do |f|
|
176
|
-
Google::Gax.construct_settings(
|
177
|
-
"google.devtools.clouderrorreporting.v1beta1.ErrorStatsService",
|
178
|
-
JSON.parse(f.read),
|
179
|
-
client_config,
|
180
|
-
Google::Gax::Grpc::STATUS_CODE_NAMES,
|
181
|
-
timeout,
|
182
|
-
page_descriptors: PAGE_DESCRIPTORS,
|
183
|
-
errors: Google::Gax::Grpc::API_ERRORS,
|
184
|
-
metadata: headers
|
185
|
-
)
|
186
|
-
end
|
187
|
-
|
188
|
-
# Allow overriding the service path/port in subclasses.
|
189
|
-
service_path = service_address || self.class::SERVICE_ADDRESS
|
190
|
-
port = service_port || self.class::DEFAULT_SERVICE_PORT
|
191
|
-
interceptors = self.class::GRPC_INTERCEPTORS
|
192
|
-
@error_stats_service_stub = Google::Gax::Grpc.create_stub(
|
193
|
-
service_path,
|
194
|
-
port,
|
195
|
-
chan_creds: chan_creds,
|
196
|
-
channel: channel,
|
197
|
-
updater_proc: updater_proc,
|
198
|
-
scopes: scopes,
|
199
|
-
interceptors: interceptors,
|
200
|
-
&Google::Devtools::Clouderrorreporting::V1beta1::ErrorStatsService::Stub.method(:new)
|
201
|
-
)
|
202
|
-
|
203
|
-
@list_group_stats = Google::Gax.create_api_call(
|
204
|
-
@error_stats_service_stub.method(:list_group_stats),
|
205
|
-
defaults["list_group_stats"],
|
206
|
-
exception_transformer: exception_transformer,
|
207
|
-
params_extractor: proc do |request|
|
208
|
-
{'project_name' => request.project_name}
|
209
|
-
end
|
210
|
-
)
|
211
|
-
@list_events = Google::Gax.create_api_call(
|
212
|
-
@error_stats_service_stub.method(:list_events),
|
213
|
-
defaults["list_events"],
|
214
|
-
exception_transformer: exception_transformer,
|
215
|
-
params_extractor: proc do |request|
|
216
|
-
{'project_name' => request.project_name}
|
217
|
-
end
|
218
|
-
)
|
219
|
-
@delete_events = Google::Gax.create_api_call(
|
220
|
-
@error_stats_service_stub.method(:delete_events),
|
221
|
-
defaults["delete_events"],
|
222
|
-
exception_transformer: exception_transformer,
|
223
|
-
params_extractor: proc do |request|
|
224
|
-
{'project_name' => request.project_name}
|
225
|
-
end
|
226
|
-
)
|
227
|
-
end
|
228
|
-
|
229
|
-
# Service calls
|
230
|
-
|
231
|
-
# Lists the specified groups.
|
232
|
-
#
|
233
|
-
# @param project_name [String]
|
234
|
-
# Required. The resource name of the Google Cloud Platform project. Written
|
235
|
-
# as <code>projects/</code> plus the
|
236
|
-
# <a href="https://support.google.com/cloud/answer/6158840">Google Cloud
|
237
|
-
# Platform project ID</a>.
|
238
|
-
#
|
239
|
-
# Example: <code>projects/my-project-123</code>.
|
240
|
-
# @param group_id [Array<String>]
|
241
|
-
# Optional. List all <code>ErrorGroupStats</code> with these IDs.
|
242
|
-
# @param service_filter [Google::Devtools::Clouderrorreporting::V1beta1::ServiceContextFilter | Hash]
|
243
|
-
# Optional. List only <code>ErrorGroupStats</code> which belong to a service
|
244
|
-
# context that matches the filter.
|
245
|
-
# Data for all service contexts is returned if this field is not specified.
|
246
|
-
# A hash of the same form as `Google::Devtools::Clouderrorreporting::V1beta1::ServiceContextFilter`
|
247
|
-
# can also be provided.
|
248
|
-
# @param time_range [Google::Devtools::Clouderrorreporting::V1beta1::QueryTimeRange | Hash]
|
249
|
-
# Optional. List data for the given time range.
|
250
|
-
# If not set, a default time range is used. The field
|
251
|
-
# <code>time_range_begin</code> in the response will specify the beginning
|
252
|
-
# of this time range.
|
253
|
-
# Only <code>ErrorGroupStats</code> with a non-zero count in the given time
|
254
|
-
# range are returned, unless the request contains an explicit
|
255
|
-
# <code>group_id</code> list. If a <code>group_id</code> list is given, also
|
256
|
-
# <code>ErrorGroupStats</code> with zero occurrences are returned.
|
257
|
-
# A hash of the same form as `Google::Devtools::Clouderrorreporting::V1beta1::QueryTimeRange`
|
258
|
-
# can also be provided.
|
259
|
-
# @param timed_count_duration [Google::Protobuf::Duration | Hash]
|
260
|
-
# Optional. The preferred duration for a single returned `TimedCount`.
|
261
|
-
# If not set, no timed counts are returned.
|
262
|
-
# A hash of the same form as `Google::Protobuf::Duration`
|
263
|
-
# can also be provided.
|
264
|
-
# @param alignment [Google::Devtools::Clouderrorreporting::V1beta1::TimedCountAlignment]
|
265
|
-
# Optional. The alignment of the timed counts to be returned.
|
266
|
-
# Default is `ALIGNMENT_EQUAL_AT_END`.
|
267
|
-
# @param alignment_time [Google::Protobuf::Timestamp | Hash]
|
268
|
-
# Optional. Time where the timed counts shall be aligned if rounded
|
269
|
-
# alignment is chosen. Default is 00:00 UTC.
|
270
|
-
# A hash of the same form as `Google::Protobuf::Timestamp`
|
271
|
-
# can also be provided.
|
272
|
-
# @param order [Google::Devtools::Clouderrorreporting::V1beta1::ErrorGroupOrder]
|
273
|
-
# Optional. The sort order in which the results are returned.
|
274
|
-
# Default is `COUNT_DESC`.
|
275
|
-
# @param page_size [Integer]
|
276
|
-
# The maximum number of resources contained in the underlying API
|
277
|
-
# response. If page streaming is performed per-resource, this
|
278
|
-
# parameter does not affect the return value. If page streaming is
|
279
|
-
# performed per-page, this determines the maximum number of
|
280
|
-
# resources in a page.
|
281
|
-
# @param options [Google::Gax::CallOptions]
|
282
|
-
# Overrides the default settings for this call, e.g, timeout,
|
283
|
-
# retries, etc.
|
284
|
-
# @yield [result, operation] Access the result along with the RPC operation
|
285
|
-
# @yieldparam result [Google::Gax::PagedEnumerable<Google::Devtools::Clouderrorreporting::V1beta1::ErrorGroupStats>]
|
286
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
287
|
-
# @return [Google::Gax::PagedEnumerable<Google::Devtools::Clouderrorreporting::V1beta1::ErrorGroupStats>]
|
288
|
-
# An enumerable of Google::Devtools::Clouderrorreporting::V1beta1::ErrorGroupStats instances.
|
289
|
-
# See Google::Gax::PagedEnumerable documentation for other
|
290
|
-
# operations such as per-page iteration or access to the response
|
291
|
-
# object.
|
292
|
-
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
293
|
-
# @example
|
294
|
-
# require "google/cloud/error_reporting"
|
295
|
-
#
|
296
|
-
# error_stats_client = Google::Cloud::ErrorReporting::ErrorStats.new(version: :v1beta1)
|
297
|
-
# formatted_project_name = Google::Cloud::ErrorReporting::V1beta1::ErrorStatsServiceClient.project_path("[PROJECT]")
|
298
|
-
#
|
299
|
-
# # Iterate over all results.
|
300
|
-
# error_stats_client.list_group_stats(formatted_project_name).each do |element|
|
301
|
-
# # Process element.
|
302
|
-
# end
|
303
|
-
#
|
304
|
-
# # Or iterate over results one page at a time.
|
305
|
-
# error_stats_client.list_group_stats(formatted_project_name).each_page do |page|
|
306
|
-
# # Process each page at a time.
|
307
|
-
# page.each do |element|
|
308
|
-
# # Process element.
|
309
|
-
# end
|
310
|
-
# end
|
311
|
-
|
312
|
-
def list_group_stats \
|
313
|
-
project_name,
|
314
|
-
group_id: nil,
|
315
|
-
service_filter: nil,
|
316
|
-
time_range: nil,
|
317
|
-
timed_count_duration: nil,
|
318
|
-
alignment: nil,
|
319
|
-
alignment_time: nil,
|
320
|
-
order: nil,
|
321
|
-
page_size: nil,
|
322
|
-
options: nil,
|
323
|
-
&block
|
324
|
-
req = {
|
325
|
-
project_name: project_name,
|
326
|
-
group_id: group_id,
|
327
|
-
service_filter: service_filter,
|
328
|
-
time_range: time_range,
|
329
|
-
timed_count_duration: timed_count_duration,
|
330
|
-
alignment: alignment,
|
331
|
-
alignment_time: alignment_time,
|
332
|
-
order: order,
|
333
|
-
page_size: page_size
|
334
|
-
}.delete_if { |_, v| v.nil? }
|
335
|
-
req = Google::Gax::to_proto(req, Google::Devtools::Clouderrorreporting::V1beta1::ListGroupStatsRequest)
|
336
|
-
@list_group_stats.call(req, options, &block)
|
337
|
-
end
|
338
|
-
|
339
|
-
# Lists the specified events.
|
340
|
-
#
|
341
|
-
# @param project_name [String]
|
342
|
-
# Required. The resource name of the Google Cloud Platform project. Written
|
343
|
-
# as `projects/` plus the
|
344
|
-
# [Google Cloud Platform project
|
345
|
-
# ID](https://support.google.com/cloud/answer/6158840).
|
346
|
-
# Example: `projects/my-project-123`.
|
347
|
-
# @param group_id [String]
|
348
|
-
# Required. The group for which events shall be returned.
|
349
|
-
# @param service_filter [Google::Devtools::Clouderrorreporting::V1beta1::ServiceContextFilter | Hash]
|
350
|
-
# Optional. List only ErrorGroups which belong to a service context that
|
351
|
-
# matches the filter.
|
352
|
-
# Data for all service contexts is returned if this field is not specified.
|
353
|
-
# A hash of the same form as `Google::Devtools::Clouderrorreporting::V1beta1::ServiceContextFilter`
|
354
|
-
# can also be provided.
|
355
|
-
# @param time_range [Google::Devtools::Clouderrorreporting::V1beta1::QueryTimeRange | Hash]
|
356
|
-
# Optional. List only data for the given time range.
|
357
|
-
# If not set a default time range is used. The field time_range_begin
|
358
|
-
# in the response will specify the beginning of this time range.
|
359
|
-
# A hash of the same form as `Google::Devtools::Clouderrorreporting::V1beta1::QueryTimeRange`
|
360
|
-
# can also be provided.
|
361
|
-
# @param page_size [Integer]
|
362
|
-
# The maximum number of resources contained in the underlying API
|
363
|
-
# response. If page streaming is performed per-resource, this
|
364
|
-
# parameter does not affect the return value. If page streaming is
|
365
|
-
# performed per-page, this determines the maximum number of
|
366
|
-
# resources in a page.
|
367
|
-
# @param options [Google::Gax::CallOptions]
|
368
|
-
# Overrides the default settings for this call, e.g, timeout,
|
369
|
-
# retries, etc.
|
370
|
-
# @yield [result, operation] Access the result along with the RPC operation
|
371
|
-
# @yieldparam result [Google::Gax::PagedEnumerable<Google::Devtools::Clouderrorreporting::V1beta1::ErrorEvent>]
|
372
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
373
|
-
# @return [Google::Gax::PagedEnumerable<Google::Devtools::Clouderrorreporting::V1beta1::ErrorEvent>]
|
374
|
-
# An enumerable of Google::Devtools::Clouderrorreporting::V1beta1::ErrorEvent instances.
|
375
|
-
# See Google::Gax::PagedEnumerable documentation for other
|
376
|
-
# operations such as per-page iteration or access to the response
|
377
|
-
# object.
|
378
|
-
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
379
|
-
# @example
|
380
|
-
# require "google/cloud/error_reporting"
|
381
|
-
#
|
382
|
-
# error_stats_client = Google::Cloud::ErrorReporting::ErrorStats.new(version: :v1beta1)
|
383
|
-
# formatted_project_name = Google::Cloud::ErrorReporting::V1beta1::ErrorStatsServiceClient.project_path("[PROJECT]")
|
384
|
-
#
|
385
|
-
# # TODO: Initialize `group_id`:
|
386
|
-
# group_id = ''
|
387
|
-
#
|
388
|
-
# # Iterate over all results.
|
389
|
-
# error_stats_client.list_events(formatted_project_name, group_id).each do |element|
|
390
|
-
# # Process element.
|
391
|
-
# end
|
392
|
-
#
|
393
|
-
# # Or iterate over results one page at a time.
|
394
|
-
# error_stats_client.list_events(formatted_project_name, group_id).each_page do |page|
|
395
|
-
# # Process each page at a time.
|
396
|
-
# page.each do |element|
|
397
|
-
# # Process element.
|
398
|
-
# end
|
399
|
-
# end
|
400
|
-
|
401
|
-
def list_events \
|
402
|
-
project_name,
|
403
|
-
group_id,
|
404
|
-
service_filter: nil,
|
405
|
-
time_range: nil,
|
406
|
-
page_size: nil,
|
407
|
-
options: nil,
|
408
|
-
&block
|
409
|
-
req = {
|
410
|
-
project_name: project_name,
|
411
|
-
group_id: group_id,
|
412
|
-
service_filter: service_filter,
|
413
|
-
time_range: time_range,
|
414
|
-
page_size: page_size
|
415
|
-
}.delete_if { |_, v| v.nil? }
|
416
|
-
req = Google::Gax::to_proto(req, Google::Devtools::Clouderrorreporting::V1beta1::ListEventsRequest)
|
417
|
-
@list_events.call(req, options, &block)
|
418
|
-
end
|
419
|
-
|
420
|
-
# Deletes all error events of a given project.
|
421
|
-
#
|
422
|
-
# @param project_name [String]
|
423
|
-
# Required. The resource name of the Google Cloud Platform project. Written
|
424
|
-
# as `projects/` plus the
|
425
|
-
# [Google Cloud Platform project
|
426
|
-
# ID](https://support.google.com/cloud/answer/6158840).
|
427
|
-
# Example: `projects/my-project-123`.
|
428
|
-
# @param options [Google::Gax::CallOptions]
|
429
|
-
# Overrides the default settings for this call, e.g, timeout,
|
430
|
-
# retries, etc.
|
431
|
-
# @yield [result, operation] Access the result along with the RPC operation
|
432
|
-
# @yieldparam result [Google::Devtools::Clouderrorreporting::V1beta1::DeleteEventsResponse]
|
433
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
434
|
-
# @return [Google::Devtools::Clouderrorreporting::V1beta1::DeleteEventsResponse]
|
435
|
-
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
436
|
-
# @example
|
437
|
-
# require "google/cloud/error_reporting"
|
438
|
-
#
|
439
|
-
# error_stats_client = Google::Cloud::ErrorReporting::ErrorStats.new(version: :v1beta1)
|
440
|
-
# formatted_project_name = Google::Cloud::ErrorReporting::V1beta1::ErrorStatsServiceClient.project_path("[PROJECT]")
|
441
|
-
# response = error_stats_client.delete_events(formatted_project_name)
|
442
|
-
|
443
|
-
def delete_events \
|
444
|
-
project_name,
|
445
|
-
options: nil,
|
446
|
-
&block
|
447
|
-
req = {
|
448
|
-
project_name: project_name
|
449
|
-
}.delete_if { |_, v| v.nil? }
|
450
|
-
req = Google::Gax::to_proto(req, Google::Devtools::Clouderrorreporting::V1beta1::DeleteEventsRequest)
|
451
|
-
@delete_events.call(req, options, &block)
|
452
|
-
end
|
453
|
-
end
|
454
|
-
end
|
455
|
-
end
|
456
|
-
end
|
457
|
-
end
|