google-cloud-logging 1.10.2 → 1.10.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -216,6 +216,22 @@ module Google
216
216
  &Google::Logging::V2::MetricsServiceV2::Stub.method(:new)
217
217
  )
218
218
 
219
+ @update_log_metric = Google::Gax.create_api_call(
220
+ @metrics_service_v2_stub.method(:update_log_metric),
221
+ defaults["update_log_metric"],
222
+ exception_transformer: exception_transformer,
223
+ params_extractor: proc do |request|
224
+ {'metric_name' => request.metric_name}
225
+ end
226
+ )
227
+ @delete_log_metric = Google::Gax.create_api_call(
228
+ @metrics_service_v2_stub.method(:delete_log_metric),
229
+ defaults["delete_log_metric"],
230
+ exception_transformer: exception_transformer,
231
+ params_extractor: proc do |request|
232
+ {'metric_name' => request.metric_name}
233
+ end
234
+ )
219
235
  @list_log_metrics = Google::Gax.create_api_call(
220
236
  @metrics_service_v2_stub.method(:list_log_metrics),
221
237
  defaults["list_log_metrics"],
@@ -240,26 +256,87 @@ module Google
240
256
  {'parent' => request.parent}
241
257
  end
242
258
  )
243
- @update_log_metric = Google::Gax.create_api_call(
244
- @metrics_service_v2_stub.method(:update_log_metric),
245
- defaults["update_log_metric"],
246
- exception_transformer: exception_transformer,
247
- params_extractor: proc do |request|
248
- {'metric_name' => request.metric_name}
249
- end
250
- )
251
- @delete_log_metric = Google::Gax.create_api_call(
252
- @metrics_service_v2_stub.method(:delete_log_metric),
253
- defaults["delete_log_metric"],
254
- exception_transformer: exception_transformer,
255
- params_extractor: proc do |request|
256
- {'metric_name' => request.metric_name}
257
- end
258
- )
259
259
  end
260
260
 
261
261
  # Service calls
262
262
 
263
+ # Creates or updates a logs-based metric.
264
+ #
265
+ # @param metric_name [String]
266
+ # Required. The resource name of the metric to update:
267
+ #
268
+ # "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
269
+ #
270
+ # The updated metric must be provided in the request and it's
271
+ # `name` field must be the same as `[METRIC_ID]` If the metric
272
+ # does not exist in `[PROJECT_ID]`, then a new metric is created.
273
+ # @param metric [Google::Logging::V2::LogMetric | Hash]
274
+ # Required. The updated metric.
275
+ # A hash of the same form as `Google::Logging::V2::LogMetric`
276
+ # can also be provided.
277
+ # @param options [Google::Gax::CallOptions]
278
+ # Overrides the default settings for this call, e.g, timeout,
279
+ # retries, etc.
280
+ # @yield [result, operation] Access the result along with the RPC operation
281
+ # @yieldparam result [Google::Logging::V2::LogMetric]
282
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
283
+ # @return [Google::Logging::V2::LogMetric]
284
+ # @raise [Google::Gax::GaxError] if the RPC is aborted.
285
+ # @example
286
+ # require "google/cloud/logging/v2"
287
+ #
288
+ # metrics_client = Google::Cloud::Logging::V2::MetricsServiceV2Client.new
289
+ # formatted_metric_name = Google::Cloud::Logging::V2::MetricsServiceV2Client.log_metric_path("[PROJECT]", "[METRIC]")
290
+ #
291
+ # # TODO: Initialize `metric`:
292
+ # metric = {}
293
+ # response = metrics_client.update_log_metric(formatted_metric_name, metric)
294
+
295
+ def update_log_metric \
296
+ metric_name,
297
+ metric,
298
+ options: nil,
299
+ &block
300
+ req = {
301
+ metric_name: metric_name,
302
+ metric: metric
303
+ }.delete_if { |_, v| v.nil? }
304
+ req = Google::Gax::to_proto(req, Google::Logging::V2::UpdateLogMetricRequest)
305
+ @update_log_metric.call(req, options, &block)
306
+ end
307
+
308
+ # Deletes a logs-based metric.
309
+ #
310
+ # @param metric_name [String]
311
+ # Required. The resource name of the metric to delete:
312
+ #
313
+ # "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
314
+ # @param options [Google::Gax::CallOptions]
315
+ # Overrides the default settings for this call, e.g, timeout,
316
+ # retries, etc.
317
+ # @yield [result, operation] Access the result along with the RPC operation
318
+ # @yieldparam result []
319
+ # @yieldparam operation [GRPC::ActiveCall::Operation]
320
+ # @raise [Google::Gax::GaxError] if the RPC is aborted.
321
+ # @example
322
+ # require "google/cloud/logging/v2"
323
+ #
324
+ # metrics_client = Google::Cloud::Logging::V2::MetricsServiceV2Client.new
325
+ # formatted_metric_name = Google::Cloud::Logging::V2::MetricsServiceV2Client.log_metric_path("[PROJECT]", "[METRIC]")
326
+ # metrics_client.delete_log_metric(formatted_metric_name)
327
+
328
+ def delete_log_metric \
329
+ metric_name,
330
+ options: nil,
331
+ &block
332
+ req = {
333
+ metric_name: metric_name
334
+ }.delete_if { |_, v| v.nil? }
335
+ req = Google::Gax::to_proto(req, Google::Logging::V2::DeleteLogMetricRequest)
336
+ @delete_log_metric.call(req, options, &block)
337
+ nil
338
+ end
339
+
263
340
  # Lists logs-based metrics.
264
341
  #
265
342
  # @param parent [String]
@@ -391,83 +468,6 @@ module Google
391
468
  req = Google::Gax::to_proto(req, Google::Logging::V2::CreateLogMetricRequest)
392
469
  @create_log_metric.call(req, options, &block)
393
470
  end
394
-
395
- # Creates or updates a logs-based metric.
396
- #
397
- # @param metric_name [String]
398
- # Required. The resource name of the metric to update:
399
- #
400
- # "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
401
- #
402
- # The updated metric must be provided in the request and it's
403
- # `name` field must be the same as `[METRIC_ID]` If the metric
404
- # does not exist in `[PROJECT_ID]`, then a new metric is created.
405
- # @param metric [Google::Logging::V2::LogMetric | Hash]
406
- # Required. The updated metric.
407
- # A hash of the same form as `Google::Logging::V2::LogMetric`
408
- # can also be provided.
409
- # @param options [Google::Gax::CallOptions]
410
- # Overrides the default settings for this call, e.g, timeout,
411
- # retries, etc.
412
- # @yield [result, operation] Access the result along with the RPC operation
413
- # @yieldparam result [Google::Logging::V2::LogMetric]
414
- # @yieldparam operation [GRPC::ActiveCall::Operation]
415
- # @return [Google::Logging::V2::LogMetric]
416
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
417
- # @example
418
- # require "google/cloud/logging/v2"
419
- #
420
- # metrics_client = Google::Cloud::Logging::V2::MetricsServiceV2Client.new
421
- # formatted_metric_name = Google::Cloud::Logging::V2::MetricsServiceV2Client.log_metric_path("[PROJECT]", "[METRIC]")
422
- #
423
- # # TODO: Initialize `metric`:
424
- # metric = {}
425
- # response = metrics_client.update_log_metric(formatted_metric_name, metric)
426
-
427
- def update_log_metric \
428
- metric_name,
429
- metric,
430
- options: nil,
431
- &block
432
- req = {
433
- metric_name: metric_name,
434
- metric: metric
435
- }.delete_if { |_, v| v.nil? }
436
- req = Google::Gax::to_proto(req, Google::Logging::V2::UpdateLogMetricRequest)
437
- @update_log_metric.call(req, options, &block)
438
- end
439
-
440
- # Deletes a logs-based metric.
441
- #
442
- # @param metric_name [String]
443
- # Required. The resource name of the metric to delete:
444
- #
445
- # "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
446
- # @param options [Google::Gax::CallOptions]
447
- # Overrides the default settings for this call, e.g, timeout,
448
- # retries, etc.
449
- # @yield [result, operation] Access the result along with the RPC operation
450
- # @yieldparam result []
451
- # @yieldparam operation [GRPC::ActiveCall::Operation]
452
- # @raise [Google::Gax::GaxError] if the RPC is aborted.
453
- # @example
454
- # require "google/cloud/logging/v2"
455
- #
456
- # metrics_client = Google::Cloud::Logging::V2::MetricsServiceV2Client.new
457
- # formatted_metric_name = Google::Cloud::Logging::V2::MetricsServiceV2Client.log_metric_path("[PROJECT]", "[METRIC]")
458
- # metrics_client.delete_log_metric(formatted_metric_name)
459
-
460
- def delete_log_metric \
461
- metric_name,
462
- options: nil,
463
- &block
464
- req = {
465
- metric_name: metric_name
466
- }.delete_if { |_, v| v.nil? }
467
- req = Google::Gax::to_proto(req, Google::Logging::V2::DeleteLogMetricRequest)
468
- @delete_log_metric.call(req, options, &block)
469
- nil
470
- end
471
471
  end
472
472
  end
473
473
  end
@@ -4,9 +4,14 @@
4
4
  "retry_codes": {
5
5
  "idempotent": [
6
6
  "DEADLINE_EXCEEDED",
7
+ "INTERNAL",
7
8
  "UNAVAILABLE"
8
9
  ],
9
- "non_idempotent": []
10
+ "non_idempotent": [],
11
+ "idempotent2": [
12
+ "DEADLINE_EXCEEDED",
13
+ "UNAVAILABLE"
14
+ ]
10
15
  },
11
16
  "retry_params": {
12
17
  "default": {
@@ -20,27 +25,27 @@
20
25
  }
21
26
  },
22
27
  "methods": {
23
- "ListLogMetrics": {
28
+ "UpdateLogMetric": {
24
29
  "timeout_millis": 60000,
25
30
  "retry_codes_name": "idempotent",
26
31
  "retry_params_name": "default"
27
32
  },
28
- "GetLogMetric": {
33
+ "DeleteLogMetric": {
29
34
  "timeout_millis": 60000,
30
35
  "retry_codes_name": "idempotent",
31
36
  "retry_params_name": "default"
32
37
  },
33
- "CreateLogMetric": {
38
+ "ListLogMetrics": {
34
39
  "timeout_millis": 60000,
35
- "retry_codes_name": "non_idempotent",
40
+ "retry_codes_name": "idempotent2",
36
41
  "retry_params_name": "default"
37
42
  },
38
- "UpdateLogMetric": {
43
+ "GetLogMetric": {
39
44
  "timeout_millis": 60000,
40
- "retry_codes_name": "non_idempotent",
45
+ "retry_codes_name": "idempotent2",
41
46
  "retry_params_name": "default"
42
47
  },
43
- "DeleteLogMetric": {
48
+ "CreateLogMetric": {
44
49
  "timeout_millis": 60000,
45
50
  "retry_codes_name": "non_idempotent",
46
51
  "retry_params_name": "default"
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Logging
19
- VERSION = "1.10.2".freeze
19
+ VERSION = "1.10.7".freeze
20
20
  end
21
21
  end
22
22
  end
@@ -86,7 +86,7 @@ module Google
86
86
  # the GCP organization.
87
87
  #
88
88
  # See [Enabling CMEK for Logs
89
- # Router](/logging/docs/routing/managed-encryption) for more information.
89
+ # Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.
90
90
  rpc :GetCmekSettings, GetCmekSettingsRequest, CmekSettings
91
91
  # Updates the Logs Router CMEK settings for the given resource.
92
92
  #
@@ -101,7 +101,7 @@ module Google
101
101
  # 3) access to the key is disabled.
102
102
  #
103
103
  # See [Enabling CMEK for Logs
104
- # Router](/logging/docs/routing/managed-encryption) for more information.
104
+ # Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.
105
105
  rpc :UpdateCmekSettings, UpdateCmekSettingsRequest, CmekSettings
106
106
  end
107
107
 
@@ -48,7 +48,7 @@ module Google
48
48
  rpc :WriteLogEntries, WriteLogEntriesRequest, WriteLogEntriesResponse
49
49
  # Lists log entries. Use this method to retrieve log entries that originated
50
50
  # from a project/folder/organization/billing account. For ways to export log
51
- # entries, see [Exporting Logs](/logging/docs/export).
51
+ # entries, see [Exporting Logs](https://cloud.google.com/logging/docs/export).
52
52
  rpc :ListLogEntries, ListLogEntriesRequest, ListLogEntriesResponse
53
53
  # Lists the descriptors for monitored resource types used by Logging.
54
54
  rpc :ListMonitoredResourceDescriptors, ListMonitoredResourceDescriptorsRequest, ListMonitoredResourceDescriptorsResponse
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-logging
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.2
4
+ version: 1.10.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Moore
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-04-01 00:00:00.000000000 Z
12
+ date: 2020-05-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: google-cloud-core
@@ -127,14 +127,14 @@ dependencies:
127
127
  requirements:
128
128
  - - "~>"
129
129
  - !ruby/object:Gem::Version
130
- version: '5.10'
130
+ version: '5.14'
131
131
  type: :development
132
132
  prerelease: false
133
133
  version_requirements: !ruby/object:Gem::Requirement
134
134
  requirements:
135
135
  - - "~>"
136
136
  - !ruby/object:Gem::Version
137
- version: '5.10'
137
+ version: '5.14'
138
138
  - !ruby/object:Gem::Dependency
139
139
  name: minitest-autotest
140
140
  requirement: !ruby/object:Gem::Requirement