google-cloud-error_reporting 0.34.2 → 0.41.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +2 -1
  3. data/CHANGELOG.md +47 -0
  4. data/TROUBLESHOOTING.md +2 -8
  5. data/lib/google-cloud-error_reporting.rb +8 -14
  6. data/lib/google/cloud/error_reporting.rb +16 -13
  7. data/lib/google/cloud/error_reporting/credentials.rb +2 -2
  8. data/lib/google/cloud/error_reporting/error_event.rb +14 -18
  9. data/lib/google/cloud/error_reporting/service.rb +12 -36
  10. data/lib/google/cloud/error_reporting/version.rb +1 -1
  11. metadata +10 -71
  12. data/lib/google/cloud/error_reporting/v1beta1.rb +0 -19
  13. data/lib/google/cloud/error_reporting/v1beta1/credentials.rb +0 -41
  14. data/lib/google/cloud/error_reporting/v1beta1/doc/google/devtools/clouderrorreporting/v1beta1/common.rb +0 -158
  15. data/lib/google/cloud/error_reporting/v1beta1/doc/google/devtools/clouderrorreporting/v1beta1/error_group_service.rb +0 -41
  16. data/lib/google/cloud/error_reporting/v1beta1/doc/google/devtools/clouderrorreporting/v1beta1/error_stats_service.rb +0 -314
  17. data/lib/google/cloud/error_reporting/v1beta1/doc/google/devtools/clouderrorreporting/v1beta1/report_errors_service.rb +0 -79
  18. data/lib/google/cloud/error_reporting/v1beta1/doc/google/protobuf/duration.rb +0 -91
  19. data/lib/google/cloud/error_reporting/v1beta1/doc/google/protobuf/timestamp.rb +0 -113
  20. data/lib/google/cloud/error_reporting/v1beta1/error_group_service_client.rb +0 -282
  21. data/lib/google/cloud/error_reporting/v1beta1/error_group_service_client_config.json +0 -36
  22. data/lib/google/cloud/error_reporting/v1beta1/error_stats_service_client.rb +0 -454
  23. data/lib/google/cloud/error_reporting/v1beta1/error_stats_service_client_config.json +0 -41
  24. data/lib/google/cloud/error_reporting/v1beta1/report_errors_service_client.rb +0 -251
  25. data/lib/google/cloud/error_reporting/v1beta1/report_errors_service_client_config.json +0 -31
  26. data/lib/google/devtools/clouderrorreporting/v1beta1/common_pb.rb +0 -64
  27. data/lib/google/devtools/clouderrorreporting/v1beta1/error_group_service_pb.rb +0 -30
  28. data/lib/google/devtools/clouderrorreporting/v1beta1/error_group_service_services_pb.rb +0 -50
  29. data/lib/google/devtools/clouderrorreporting/v1beta1/error_stats_service_pb.rb +0 -116
  30. data/lib/google/devtools/clouderrorreporting/v1beta1/error_stats_service_services_pb.rb +0 -52
  31. data/lib/google/devtools/clouderrorreporting/v1beta1/report_errors_service_pb.rb +0 -38
  32. 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,454 +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
- headers.merge!(metadata) unless metadata.nil?
169
- client_config_file = Pathname.new(__dir__).join(
170
- "error_stats_service_client_config.json"
171
- )
172
- defaults = client_config_file.open do |f|
173
- Google::Gax.construct_settings(
174
- "google.devtools.clouderrorreporting.v1beta1.ErrorStatsService",
175
- JSON.parse(f.read),
176
- client_config,
177
- Google::Gax::Grpc::STATUS_CODE_NAMES,
178
- timeout,
179
- page_descriptors: PAGE_DESCRIPTORS,
180
- errors: Google::Gax::Grpc::API_ERRORS,
181
- metadata: headers
182
- )
183
- end
184
-
185
- # Allow overriding the service path/port in subclasses.
186
- service_path = service_address || self.class::SERVICE_ADDRESS
187
- port = service_port || self.class::DEFAULT_SERVICE_PORT
188
- interceptors = self.class::GRPC_INTERCEPTORS
189
- @error_stats_service_stub = Google::Gax::Grpc.create_stub(
190
- service_path,
191
- port,
192
- chan_creds: chan_creds,
193
- channel: channel,
194
- updater_proc: updater_proc,
195
- scopes: scopes,
196
- interceptors: interceptors,
197
- &Google::Devtools::Clouderrorreporting::V1beta1::ErrorStatsService::Stub.method(:new)
198
- )
199
-
200
- @list_group_stats = Google::Gax.create_api_call(
201
- @error_stats_service_stub.method(:list_group_stats),
202
- defaults["list_group_stats"],
203
- exception_transformer: exception_transformer,
204
- params_extractor: proc do |request|
205
- {'project_name' => request.project_name}
206
- end
207
- )
208
- @list_events = Google::Gax.create_api_call(
209
- @error_stats_service_stub.method(:list_events),
210
- defaults["list_events"],
211
- exception_transformer: exception_transformer,
212
- params_extractor: proc do |request|
213
- {'project_name' => request.project_name}
214
- end
215
- )
216
- @delete_events = Google::Gax.create_api_call(
217
- @error_stats_service_stub.method(:delete_events),
218
- defaults["delete_events"],
219
- exception_transformer: exception_transformer,
220
- params_extractor: proc do |request|
221
- {'project_name' => request.project_name}
222
- end
223
- )
224
- end
225
-
226
- # Service calls
227
-
228
- # Lists the specified groups.
229
- #
230
- # @param project_name [String]
231
- # Required. The resource name of the Google Cloud Platform project. Written
232
- # as <code>projects/</code> plus the
233
- # <a href="https://support.google.com/cloud/answer/6158840">Google Cloud
234
- # Platform project ID</a>.
235
- #
236
- # Example: <code>projects/my-project-123</code>.
237
- # @param group_id [Array<String>]
238
- # Optional. List all <code>ErrorGroupStats</code> with these IDs.
239
- # @param service_filter [Google::Devtools::Clouderrorreporting::V1beta1::ServiceContextFilter | Hash]
240
- # Optional. List only <code>ErrorGroupStats</code> which belong to a service
241
- # context that matches the filter.
242
- # Data for all service contexts is returned if this field is not specified.
243
- # A hash of the same form as `Google::Devtools::Clouderrorreporting::V1beta1::ServiceContextFilter`
244
- # can also be provided.
245
- # @param time_range [Google::Devtools::Clouderrorreporting::V1beta1::QueryTimeRange | Hash]
246
- # Optional. List data for the given time range.
247
- # If not set, a default time range is used. The field
248
- # <code>time_range_begin</code> in the response will specify the beginning
249
- # of this time range.
250
- # Only <code>ErrorGroupStats</code> with a non-zero count in the given time
251
- # range are returned, unless the request contains an explicit
252
- # <code>group_id</code> list. If a <code>group_id</code> list is given, also
253
- # <code>ErrorGroupStats</code> with zero occurrences are returned.
254
- # A hash of the same form as `Google::Devtools::Clouderrorreporting::V1beta1::QueryTimeRange`
255
- # can also be provided.
256
- # @param timed_count_duration [Google::Protobuf::Duration | Hash]
257
- # Optional. The preferred duration for a single returned `TimedCount`.
258
- # If not set, no timed counts are returned.
259
- # A hash of the same form as `Google::Protobuf::Duration`
260
- # can also be provided.
261
- # @param alignment [Google::Devtools::Clouderrorreporting::V1beta1::TimedCountAlignment]
262
- # Optional. The alignment of the timed counts to be returned.
263
- # Default is `ALIGNMENT_EQUAL_AT_END`.
264
- # @param alignment_time [Google::Protobuf::Timestamp | Hash]
265
- # Optional. Time where the timed counts shall be aligned if rounded
266
- # alignment is chosen. Default is 00:00 UTC.
267
- # A hash of the same form as `Google::Protobuf::Timestamp`
268
- # can also be provided.
269
- # @param order [Google::Devtools::Clouderrorreporting::V1beta1::ErrorGroupOrder]
270
- # Optional. The sort order in which the results are returned.
271
- # Default is `COUNT_DESC`.
272
- # @param page_size [Integer]
273
- # The maximum number of resources contained in the underlying API
274
- # response. If page streaming is performed per-resource, this
275
- # parameter does not affect the return value. If page streaming is
276
- # performed per-page, this determines the maximum number of
277
- # resources in a page.
278
- # @param options [Google::Gax::CallOptions]
279
- # Overrides the default settings for this call, e.g, timeout,
280
- # retries, etc.
281
- # @yield [result, operation] Access the result along with the RPC operation
282
- # @yieldparam result [Google::Gax::PagedEnumerable<Google::Devtools::Clouderrorreporting::V1beta1::ErrorGroupStats>]
283
- # @yieldparam operation [GRPC::ActiveCall::Operation]
284
- # @return [Google::Gax::PagedEnumerable<Google::Devtools::Clouderrorreporting::V1beta1::ErrorGroupStats>]
285
- # An enumerable of Google::Devtools::Clouderrorreporting::V1beta1::ErrorGroupStats instances.
286
- # See Google::Gax::PagedEnumerable documentation for other
287
- # operations such as per-page iteration or access to the response
288
- # object.
289
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
290
- # @example
291
- # require "google/cloud/error_reporting"
292
- #
293
- # error_stats_client = Google::Cloud::ErrorReporting::ErrorStats.new(version: :v1beta1)
294
- # formatted_project_name = Google::Cloud::ErrorReporting::V1beta1::ErrorStatsServiceClient.project_path("[PROJECT]")
295
- #
296
- # # Iterate over all results.
297
- # error_stats_client.list_group_stats(formatted_project_name).each do |element|
298
- # # Process element.
299
- # end
300
- #
301
- # # Or iterate over results one page at a time.
302
- # error_stats_client.list_group_stats(formatted_project_name).each_page do |page|
303
- # # Process each page at a time.
304
- # page.each do |element|
305
- # # Process element.
306
- # end
307
- # end
308
-
309
- def list_group_stats \
310
- project_name,
311
- group_id: nil,
312
- service_filter: nil,
313
- time_range: nil,
314
- timed_count_duration: nil,
315
- alignment: nil,
316
- alignment_time: nil,
317
- order: nil,
318
- page_size: nil,
319
- options: nil,
320
- &block
321
- req = {
322
- project_name: project_name,
323
- group_id: group_id,
324
- service_filter: service_filter,
325
- time_range: time_range,
326
- timed_count_duration: timed_count_duration,
327
- alignment: alignment,
328
- alignment_time: alignment_time,
329
- order: order,
330
- page_size: page_size
331
- }.delete_if { |_, v| v.nil? }
332
- req = Google::Gax::to_proto(req, Google::Devtools::Clouderrorreporting::V1beta1::ListGroupStatsRequest)
333
- @list_group_stats.call(req, options, &block)
334
- end
335
-
336
- # Lists the specified events.
337
- #
338
- # @param project_name [String]
339
- # Required. The resource name of the Google Cloud Platform project. Written
340
- # as `projects/` plus the
341
- # [Google Cloud Platform project
342
- # ID](https://support.google.com/cloud/answer/6158840).
343
- # Example: `projects/my-project-123`.
344
- # @param group_id [String]
345
- # Required. The group for which events shall be returned.
346
- # @param service_filter [Google::Devtools::Clouderrorreporting::V1beta1::ServiceContextFilter | Hash]
347
- # Optional. List only ErrorGroups which belong to a service context that
348
- # matches the filter.
349
- # Data for all service contexts is returned if this field is not specified.
350
- # A hash of the same form as `Google::Devtools::Clouderrorreporting::V1beta1::ServiceContextFilter`
351
- # can also be provided.
352
- # @param time_range [Google::Devtools::Clouderrorreporting::V1beta1::QueryTimeRange | Hash]
353
- # Optional. List only data for the given time range.
354
- # If not set a default time range is used. The field time_range_begin
355
- # in the response will specify the beginning of this time range.
356
- # A hash of the same form as `Google::Devtools::Clouderrorreporting::V1beta1::QueryTimeRange`
357
- # can also be provided.
358
- # @param page_size [Integer]
359
- # The maximum number of resources contained in the underlying API
360
- # response. If page streaming is performed per-resource, this
361
- # parameter does not affect the return value. If page streaming is
362
- # performed per-page, this determines the maximum number of
363
- # resources in a page.
364
- # @param options [Google::Gax::CallOptions]
365
- # Overrides the default settings for this call, e.g, timeout,
366
- # retries, etc.
367
- # @yield [result, operation] Access the result along with the RPC operation
368
- # @yieldparam result [Google::Gax::PagedEnumerable<Google::Devtools::Clouderrorreporting::V1beta1::ErrorEvent>]
369
- # @yieldparam operation [GRPC::ActiveCall::Operation]
370
- # @return [Google::Gax::PagedEnumerable<Google::Devtools::Clouderrorreporting::V1beta1::ErrorEvent>]
371
- # An enumerable of Google::Devtools::Clouderrorreporting::V1beta1::ErrorEvent instances.
372
- # See Google::Gax::PagedEnumerable documentation for other
373
- # operations such as per-page iteration or access to the response
374
- # object.
375
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
376
- # @example
377
- # require "google/cloud/error_reporting"
378
- #
379
- # error_stats_client = Google::Cloud::ErrorReporting::ErrorStats.new(version: :v1beta1)
380
- # formatted_project_name = Google::Cloud::ErrorReporting::V1beta1::ErrorStatsServiceClient.project_path("[PROJECT]")
381
- #
382
- # # TODO: Initialize `group_id`:
383
- # group_id = ''
384
- #
385
- # # Iterate over all results.
386
- # error_stats_client.list_events(formatted_project_name, group_id).each do |element|
387
- # # Process element.
388
- # end
389
- #
390
- # # Or iterate over results one page at a time.
391
- # error_stats_client.list_events(formatted_project_name, group_id).each_page do |page|
392
- # # Process each page at a time.
393
- # page.each do |element|
394
- # # Process element.
395
- # end
396
- # end
397
-
398
- def list_events \
399
- project_name,
400
- group_id,
401
- service_filter: nil,
402
- time_range: nil,
403
- page_size: nil,
404
- options: nil,
405
- &block
406
- req = {
407
- project_name: project_name,
408
- group_id: group_id,
409
- service_filter: service_filter,
410
- time_range: time_range,
411
- page_size: page_size
412
- }.delete_if { |_, v| v.nil? }
413
- req = Google::Gax::to_proto(req, Google::Devtools::Clouderrorreporting::V1beta1::ListEventsRequest)
414
- @list_events.call(req, options, &block)
415
- end
416
-
417
- # Deletes all error events of a given project.
418
- #
419
- # @param project_name [String]
420
- # Required. The resource name of the Google Cloud Platform project. Written
421
- # as `projects/` plus the
422
- # [Google Cloud Platform project
423
- # ID](https://support.google.com/cloud/answer/6158840).
424
- # Example: `projects/my-project-123`.
425
- # @param options [Google::Gax::CallOptions]
426
- # Overrides the default settings for this call, e.g, timeout,
427
- # retries, etc.
428
- # @yield [result, operation] Access the result along with the RPC operation
429
- # @yieldparam result [Google::Devtools::Clouderrorreporting::V1beta1::DeleteEventsResponse]
430
- # @yieldparam operation [GRPC::ActiveCall::Operation]
431
- # @return [Google::Devtools::Clouderrorreporting::V1beta1::DeleteEventsResponse]
432
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
433
- # @example
434
- # require "google/cloud/error_reporting"
435
- #
436
- # error_stats_client = Google::Cloud::ErrorReporting::ErrorStats.new(version: :v1beta1)
437
- # formatted_project_name = Google::Cloud::ErrorReporting::V1beta1::ErrorStatsServiceClient.project_path("[PROJECT]")
438
- # response = error_stats_client.delete_events(formatted_project_name)
439
-
440
- def delete_events \
441
- project_name,
442
- options: nil,
443
- &block
444
- req = {
445
- project_name: project_name
446
- }.delete_if { |_, v| v.nil? }
447
- req = Google::Gax::to_proto(req, Google::Devtools::Clouderrorreporting::V1beta1::DeleteEventsRequest)
448
- @delete_events.call(req, options, &block)
449
- end
450
- end
451
- end
452
- end
453
- end
454
- end