google-cloud-logging 1.5.1 → 1.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +2 -1
- data/README.md +8 -8
- data/lib/google/cloud/logging/credentials.rb +2 -15
- data/lib/google/cloud/logging/v2/config_service_v2_client.rb +126 -65
- data/lib/google/cloud/logging/v2/config_service_v2_client_config.json +13 -13
- data/lib/google/cloud/logging/v2/credentials.rb +38 -0
- data/lib/google/cloud/logging/v2/doc/google/api/distribution.rb +1 -1
- data/lib/google/cloud/logging/v2/doc/google/api/label.rb +1 -1
- data/lib/google/cloud/logging/v2/doc/google/api/metric.rb +8 -12
- data/lib/google/cloud/logging/v2/doc/google/api/monitored_resource.rb +28 -4
- data/lib/google/cloud/logging/v2/doc/google/logging/type/http_request.rb +1 -1
- data/lib/google/cloud/logging/v2/doc/google/logging/v2/log_entry.rb +18 -10
- data/lib/google/cloud/logging/v2/doc/google/logging/v2/logging.rb +11 -19
- data/lib/google/cloud/logging/v2/doc/google/logging/v2/logging_config.rb +3 -18
- data/lib/google/cloud/logging/v2/doc/google/logging/v2/logging_metrics.rb +1 -16
- data/lib/google/cloud/logging/v2/doc/google/protobuf/any.rb +1 -1
- data/lib/google/cloud/logging/v2/doc/google/protobuf/duration.rb +1 -1
- data/lib/google/cloud/logging/v2/doc/google/protobuf/empty.rb +28 -0
- data/lib/google/cloud/logging/v2/doc/google/protobuf/field_mask.rb +1 -1
- data/lib/google/cloud/logging/v2/doc/google/protobuf/struct.rb +73 -0
- data/lib/google/cloud/logging/v2/doc/google/protobuf/timestamp.rb +1 -1
- data/lib/google/cloud/logging/v2/logging_service_v2_client.rb +106 -67
- data/lib/google/cloud/logging/v2/logging_service_v2_client_config.json +12 -12
- data/lib/google/cloud/logging/v2/metrics_service_v2_client.rb +75 -45
- data/lib/google/cloud/logging/v2/metrics_service_v2_client_config.json +6 -6
- data/lib/google/cloud/logging/version.rb +1 -1
- data/lib/google/logging/v2/log_entry_pb.rb +1 -0
- data/lib/google/logging/v2/logging_config_services_pb.rb +2 -2
- data/lib/google/logging/v2/logging_metrics_services_pb.rb +2 -2
- data/lib/google/logging/v2/logging_pb.rb +1 -0
- data/lib/google/logging/v2/logging_services_pb.rb +5 -4
- metadata +35 -5
- data/lib/google/cloud/logging/v2/doc/overview.rb +0 -66
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 165648d3671f94bbce1dd44a66d3970f76aef3227a867efc8700844c8baf8535
|
4
|
+
data.tar.gz: 2864cce34c49c550cff3e842f824db2155daa15cd83c9c4789f8aa3e778fc3b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '08d0ec06b1240642fe5e1090480787df1da41550b20f15de77a920cc894fbb8e68bebcfe7d9bca190d5ad6a5c03be9d9de56a6802fe04ee44d4e3f1588bfd206'
|
7
|
+
data.tar.gz: 51ec296ada17157804749f371d364a88f5ea7e61091dd00d4d58c2bbc34551160c9638d20125d8b164a737873239f659714c19386badfe291254d78027ed9c81
|
data/.yardopts
CHANGED
data/README.md
CHANGED
@@ -180,14 +180,14 @@ end
|
|
180
180
|
|
181
181
|
## Supported Ruby Versions
|
182
182
|
|
183
|
-
This library is supported on Ruby 2.
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
183
|
+
This library is supported on Ruby 2.3+.
|
184
|
+
|
185
|
+
Google provides official support for Ruby versions that are actively supported
|
186
|
+
by Ruby Core—that is, Ruby versions that are either in normal maintenance or
|
187
|
+
in security maintenance, and not end of life. Currently, this means Ruby 2.3
|
188
|
+
and later. Older versions of Ruby _may_ still work, but are unsupported and not
|
189
|
+
recommended. See https://www.ruby-lang.org/en/downloads/branches/ for details
|
190
|
+
about the Ruby support schedule.
|
191
191
|
|
192
192
|
## Versioning
|
193
193
|
|
@@ -13,7 +13,7 @@
|
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
15
|
|
16
|
-
require "
|
16
|
+
require "google/cloud/logging/v2/credentials"
|
17
17
|
|
18
18
|
module Google
|
19
19
|
module Cloud
|
@@ -37,20 +37,7 @@ module Google
|
|
37
37
|
#
|
38
38
|
# logging.project_id #=> "my-project"
|
39
39
|
#
|
40
|
-
class Credentials < Google::
|
41
|
-
SCOPE = ["https://www.googleapis.com/auth/logging.admin"].freeze
|
42
|
-
PATH_ENV_VARS = %w[LOGGING_CREDENTIALS
|
43
|
-
LOGGING_KEYFILE
|
44
|
-
GOOGLE_CLOUD_CREDENTIALS
|
45
|
-
GOOGLE_CLOUD_KEYFILE
|
46
|
-
GCLOUD_KEYFILE].freeze
|
47
|
-
JSON_ENV_VARS = %w[LOGGING_CREDENTIALS_JSON
|
48
|
-
LOGGING_KEYFILE_JSON
|
49
|
-
GOOGLE_CLOUD_CREDENTIALS_JSON
|
50
|
-
GOOGLE_CLOUD_KEYFILE_JSON
|
51
|
-
GCLOUD_KEYFILE_JSON].freeze
|
52
|
-
DEFAULT_PATHS = \
|
53
|
-
["~/.config/gcloud/application_default_credentials.json"].freeze
|
40
|
+
class Credentials < Google::Cloud::Logging::V2::Credentials
|
54
41
|
end
|
55
42
|
end
|
56
43
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright
|
1
|
+
# Copyright 2018 Google LLC
|
2
2
|
#
|
3
3
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
4
|
# you may not use this file except in compliance with the License.
|
@@ -18,9 +18,6 @@
|
|
18
18
|
# and updates to that file get reflected here through a refresh process.
|
19
19
|
# For the short term, the refresh process will only be runnable by Google
|
20
20
|
# engineers.
|
21
|
-
#
|
22
|
-
# The only allowed edits are to method and file documentation. A 3-way
|
23
|
-
# merge preserves those additions if the generated source changes.
|
24
21
|
|
25
22
|
require "json"
|
26
23
|
require "pathname"
|
@@ -28,7 +25,7 @@ require "pathname"
|
|
28
25
|
require "google/gax"
|
29
26
|
|
30
27
|
require "google/logging/v2/logging_config_pb"
|
31
|
-
require "google/cloud/logging/credentials"
|
28
|
+
require "google/cloud/logging/v2/credentials"
|
32
29
|
|
33
30
|
module Google
|
34
31
|
module Cloud
|
@@ -48,6 +45,9 @@ module Google
|
|
48
45
|
# The default port of the service.
|
49
46
|
DEFAULT_SERVICE_PORT = 443
|
50
47
|
|
48
|
+
# The default set of gRPC interceptors.
|
49
|
+
GRPC_INTERCEPTORS = []
|
50
|
+
|
51
51
|
DEFAULT_TIMEOUT = 30
|
52
52
|
|
53
53
|
PAGE_DESCRIPTORS = {
|
@@ -73,6 +73,7 @@ module Google
|
|
73
73
|
"https://www.googleapis.com/auth/logging.write"
|
74
74
|
].freeze
|
75
75
|
|
76
|
+
|
76
77
|
PROJECT_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
77
78
|
"projects/{project}"
|
78
79
|
)
|
@@ -146,16 +147,18 @@ module Google
|
|
146
147
|
# or the specified config is missing data points.
|
147
148
|
# @param timeout [Numeric]
|
148
149
|
# The default timeout, in seconds, for calls made through this client.
|
150
|
+
# @param metadata [Hash]
|
151
|
+
# Default metadata to be sent with each request. This can be overridden on a per call basis.
|
152
|
+
# @param exception_transformer [Proc]
|
153
|
+
# An optional proc that intercepts any exceptions raised during an API call to inject
|
154
|
+
# custom error handling.
|
149
155
|
def initialize \
|
150
|
-
service_path: SERVICE_ADDRESS,
|
151
|
-
port: DEFAULT_SERVICE_PORT,
|
152
|
-
channel: nil,
|
153
|
-
chan_creds: nil,
|
154
|
-
updater_proc: nil,
|
155
156
|
credentials: nil,
|
156
157
|
scopes: ALL_SCOPES,
|
157
158
|
client_config: {},
|
158
159
|
timeout: DEFAULT_TIMEOUT,
|
160
|
+
metadata: nil,
|
161
|
+
exception_transformer: nil,
|
159
162
|
lib_name: nil,
|
160
163
|
lib_version: ""
|
161
164
|
# These require statements are intentionally placed here to initialize
|
@@ -164,21 +167,10 @@ module Google
|
|
164
167
|
require "google/gax/grpc"
|
165
168
|
require "google/logging/v2/logging_config_services_pb"
|
166
169
|
|
167
|
-
|
168
|
-
warn "The `channel`, `chan_creds`, and `updater_proc` parameters will be removed " \
|
169
|
-
"on 2017/09/08"
|
170
|
-
credentials ||= channel
|
171
|
-
credentials ||= chan_creds
|
172
|
-
credentials ||= updater_proc
|
173
|
-
end
|
174
|
-
if service_path != SERVICE_ADDRESS || port != DEFAULT_SERVICE_PORT
|
175
|
-
warn "`service_path` and `port` parameters are deprecated and will be removed"
|
176
|
-
end
|
177
|
-
|
178
|
-
credentials ||= Google::Cloud::Logging::Credentials.default
|
170
|
+
credentials ||= Google::Cloud::Logging::V2::Credentials.default
|
179
171
|
|
180
172
|
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
181
|
-
updater_proc = Google::Cloud::Logging::Credentials.new(credentials).updater_proc
|
173
|
+
updater_proc = Google::Cloud::Logging::V2::Credentials.new(credentials).updater_proc
|
182
174
|
end
|
183
175
|
if credentials.is_a?(GRPC::Core::Channel)
|
184
176
|
channel = credentials
|
@@ -193,13 +185,16 @@ module Google
|
|
193
185
|
updater_proc = credentials.updater_proc
|
194
186
|
end
|
195
187
|
|
188
|
+
package_version = Gem.loaded_specs['google-cloud-logging'].version.version
|
189
|
+
|
196
190
|
google_api_client = "gl-ruby/#{RUBY_VERSION}"
|
197
191
|
google_api_client << " #{lib_name}/#{lib_version}" if lib_name
|
198
|
-
google_api_client << " gapic
|
192
|
+
google_api_client << " gapic/#{package_version} gax/#{Google::Gax::VERSION}"
|
199
193
|
google_api_client << " grpc/#{GRPC::VERSION}"
|
200
194
|
google_api_client.freeze
|
201
195
|
|
202
196
|
headers = { :"x-goog-api-client" => google_api_client }
|
197
|
+
headers.merge!(metadata) unless metadata.nil?
|
203
198
|
client_config_file = Pathname.new(__dir__).join(
|
204
199
|
"config_service_v2_client_config.json"
|
205
200
|
)
|
@@ -212,9 +207,14 @@ module Google
|
|
212
207
|
timeout,
|
213
208
|
page_descriptors: PAGE_DESCRIPTORS,
|
214
209
|
errors: Google::Gax::Grpc::API_ERRORS,
|
215
|
-
|
210
|
+
metadata: headers
|
216
211
|
)
|
217
212
|
end
|
213
|
+
|
214
|
+
# Allow overriding the service path/port in subclasses.
|
215
|
+
service_path = self.class::SERVICE_ADDRESS
|
216
|
+
port = self.class::DEFAULT_SERVICE_PORT
|
217
|
+
interceptors = self.class::GRPC_INTERCEPTORS
|
218
218
|
@config_service_v2_stub = Google::Gax::Grpc.create_stub(
|
219
219
|
service_path,
|
220
220
|
port,
|
@@ -222,48 +222,59 @@ module Google
|
|
222
222
|
channel: channel,
|
223
223
|
updater_proc: updater_proc,
|
224
224
|
scopes: scopes,
|
225
|
+
interceptors: interceptors,
|
225
226
|
&Google::Logging::V2::ConfigServiceV2::Stub.method(:new)
|
226
227
|
)
|
227
228
|
|
228
229
|
@list_sinks = Google::Gax.create_api_call(
|
229
230
|
@config_service_v2_stub.method(:list_sinks),
|
230
|
-
defaults["list_sinks"]
|
231
|
+
defaults["list_sinks"],
|
232
|
+
exception_transformer: exception_transformer
|
231
233
|
)
|
232
234
|
@get_sink = Google::Gax.create_api_call(
|
233
235
|
@config_service_v2_stub.method(:get_sink),
|
234
|
-
defaults["get_sink"]
|
236
|
+
defaults["get_sink"],
|
237
|
+
exception_transformer: exception_transformer
|
235
238
|
)
|
236
239
|
@create_sink = Google::Gax.create_api_call(
|
237
240
|
@config_service_v2_stub.method(:create_sink),
|
238
|
-
defaults["create_sink"]
|
241
|
+
defaults["create_sink"],
|
242
|
+
exception_transformer: exception_transformer
|
239
243
|
)
|
240
244
|
@update_sink = Google::Gax.create_api_call(
|
241
245
|
@config_service_v2_stub.method(:update_sink),
|
242
|
-
defaults["update_sink"]
|
246
|
+
defaults["update_sink"],
|
247
|
+
exception_transformer: exception_transformer
|
243
248
|
)
|
244
249
|
@delete_sink = Google::Gax.create_api_call(
|
245
250
|
@config_service_v2_stub.method(:delete_sink),
|
246
|
-
defaults["delete_sink"]
|
251
|
+
defaults["delete_sink"],
|
252
|
+
exception_transformer: exception_transformer
|
247
253
|
)
|
248
254
|
@list_exclusions = Google::Gax.create_api_call(
|
249
255
|
@config_service_v2_stub.method(:list_exclusions),
|
250
|
-
defaults["list_exclusions"]
|
256
|
+
defaults["list_exclusions"],
|
257
|
+
exception_transformer: exception_transformer
|
251
258
|
)
|
252
259
|
@get_exclusion = Google::Gax.create_api_call(
|
253
260
|
@config_service_v2_stub.method(:get_exclusion),
|
254
|
-
defaults["get_exclusion"]
|
261
|
+
defaults["get_exclusion"],
|
262
|
+
exception_transformer: exception_transformer
|
255
263
|
)
|
256
264
|
@create_exclusion = Google::Gax.create_api_call(
|
257
265
|
@config_service_v2_stub.method(:create_exclusion),
|
258
|
-
defaults["create_exclusion"]
|
266
|
+
defaults["create_exclusion"],
|
267
|
+
exception_transformer: exception_transformer
|
259
268
|
)
|
260
269
|
@update_exclusion = Google::Gax.create_api_call(
|
261
270
|
@config_service_v2_stub.method(:update_exclusion),
|
262
|
-
defaults["update_exclusion"]
|
271
|
+
defaults["update_exclusion"],
|
272
|
+
exception_transformer: exception_transformer
|
263
273
|
)
|
264
274
|
@delete_exclusion = Google::Gax.create_api_call(
|
265
275
|
@config_service_v2_stub.method(:delete_exclusion),
|
266
|
-
defaults["delete_exclusion"]
|
276
|
+
defaults["delete_exclusion"],
|
277
|
+
exception_transformer: exception_transformer
|
267
278
|
)
|
268
279
|
end
|
269
280
|
|
@@ -287,6 +298,9 @@ module Google
|
|
287
298
|
# @param options [Google::Gax::CallOptions]
|
288
299
|
# Overrides the default settings for this call, e.g, timeout,
|
289
300
|
# retries, etc.
|
301
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
302
|
+
# @yieldparam result [Google::Gax::PagedEnumerable<Google::Logging::V2::LogSink>]
|
303
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
290
304
|
# @return [Google::Gax::PagedEnumerable<Google::Logging::V2::LogSink>]
|
291
305
|
# An enumerable of Google::Logging::V2::LogSink instances.
|
292
306
|
# See Google::Gax::PagedEnumerable documentation for other
|
@@ -296,7 +310,7 @@ module Google
|
|
296
310
|
# @example
|
297
311
|
# require "google/cloud/logging/v2"
|
298
312
|
#
|
299
|
-
# config_service_v2_client = Google::Cloud::Logging::V2::
|
313
|
+
# config_service_v2_client = Google::Cloud::Logging::V2::ConfigServiceV2Client.new
|
300
314
|
# formatted_parent = Google::Cloud::Logging::V2::ConfigServiceV2Client.project_path("[PROJECT]")
|
301
315
|
#
|
302
316
|
# # Iterate over all results.
|
@@ -315,13 +329,14 @@ module Google
|
|
315
329
|
def list_sinks \
|
316
330
|
parent,
|
317
331
|
page_size: nil,
|
318
|
-
options: nil
|
332
|
+
options: nil,
|
333
|
+
&block
|
319
334
|
req = {
|
320
335
|
parent: parent,
|
321
336
|
page_size: page_size
|
322
337
|
}.delete_if { |_, v| v.nil? }
|
323
338
|
req = Google::Gax::to_proto(req, Google::Logging::V2::ListSinksRequest)
|
324
|
-
@list_sinks.call(req, options)
|
339
|
+
@list_sinks.call(req, options, &block)
|
325
340
|
end
|
326
341
|
|
327
342
|
# Gets a sink.
|
@@ -338,23 +353,27 @@ module Google
|
|
338
353
|
# @param options [Google::Gax::CallOptions]
|
339
354
|
# Overrides the default settings for this call, e.g, timeout,
|
340
355
|
# retries, etc.
|
356
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
357
|
+
# @yieldparam result [Google::Logging::V2::LogSink]
|
358
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
341
359
|
# @return [Google::Logging::V2::LogSink]
|
342
360
|
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
343
361
|
# @example
|
344
362
|
# require "google/cloud/logging/v2"
|
345
363
|
#
|
346
|
-
# config_service_v2_client = Google::Cloud::Logging::V2::
|
364
|
+
# config_service_v2_client = Google::Cloud::Logging::V2::ConfigServiceV2Client.new
|
347
365
|
# formatted_sink_name = Google::Cloud::Logging::V2::ConfigServiceV2Client.sink_path("[PROJECT]", "[SINK]")
|
348
366
|
# response = config_service_v2_client.get_sink(formatted_sink_name)
|
349
367
|
|
350
368
|
def get_sink \
|
351
369
|
sink_name,
|
352
|
-
options: nil
|
370
|
+
options: nil,
|
371
|
+
&block
|
353
372
|
req = {
|
354
373
|
sink_name: sink_name
|
355
374
|
}.delete_if { |_, v| v.nil? }
|
356
375
|
req = Google::Gax::to_proto(req, Google::Logging::V2::GetSinkRequest)
|
357
|
-
@get_sink.call(req, options)
|
376
|
+
@get_sink.call(req, options, &block)
|
358
377
|
end
|
359
378
|
|
360
379
|
# Creates a sink that exports specified log entries to a destination. The
|
@@ -391,13 +410,18 @@ module Google
|
|
391
410
|
# @param options [Google::Gax::CallOptions]
|
392
411
|
# Overrides the default settings for this call, e.g, timeout,
|
393
412
|
# retries, etc.
|
413
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
414
|
+
# @yieldparam result [Google::Logging::V2::LogSink]
|
415
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
394
416
|
# @return [Google::Logging::V2::LogSink]
|
395
417
|
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
396
418
|
# @example
|
397
419
|
# require "google/cloud/logging/v2"
|
398
420
|
#
|
399
|
-
# config_service_v2_client = Google::Cloud::Logging::V2::
|
421
|
+
# config_service_v2_client = Google::Cloud::Logging::V2::ConfigServiceV2Client.new
|
400
422
|
# formatted_parent = Google::Cloud::Logging::V2::ConfigServiceV2Client.project_path("[PROJECT]")
|
423
|
+
#
|
424
|
+
# # TODO: Initialize +sink+:
|
401
425
|
# sink = {}
|
402
426
|
# response = config_service_v2_client.create_sink(formatted_parent, sink)
|
403
427
|
|
@@ -405,14 +429,15 @@ module Google
|
|
405
429
|
parent,
|
406
430
|
sink,
|
407
431
|
unique_writer_identity: nil,
|
408
|
-
options: nil
|
432
|
+
options: nil,
|
433
|
+
&block
|
409
434
|
req = {
|
410
435
|
parent: parent,
|
411
436
|
sink: sink,
|
412
437
|
unique_writer_identity: unique_writer_identity
|
413
438
|
}.delete_if { |_, v| v.nil? }
|
414
439
|
req = Google::Gax::to_proto(req, Google::Logging::V2::CreateSinkRequest)
|
415
|
-
@create_sink.call(req, options)
|
440
|
+
@create_sink.call(req, options, &block)
|
416
441
|
end
|
417
442
|
|
418
443
|
# Updates a sink. This method replaces the following fields in the existing
|
@@ -468,13 +493,18 @@ module Google
|
|
468
493
|
# @param options [Google::Gax::CallOptions]
|
469
494
|
# Overrides the default settings for this call, e.g, timeout,
|
470
495
|
# retries, etc.
|
496
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
497
|
+
# @yieldparam result [Google::Logging::V2::LogSink]
|
498
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
471
499
|
# @return [Google::Logging::V2::LogSink]
|
472
500
|
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
473
501
|
# @example
|
474
502
|
# require "google/cloud/logging/v2"
|
475
503
|
#
|
476
|
-
# config_service_v2_client = Google::Cloud::Logging::V2::
|
504
|
+
# config_service_v2_client = Google::Cloud::Logging::V2::ConfigServiceV2Client.new
|
477
505
|
# formatted_sink_name = Google::Cloud::Logging::V2::ConfigServiceV2Client.sink_path("[PROJECT]", "[SINK]")
|
506
|
+
#
|
507
|
+
# # TODO: Initialize +sink+:
|
478
508
|
# sink = {}
|
479
509
|
# response = config_service_v2_client.update_sink(formatted_sink_name, sink)
|
480
510
|
|
@@ -483,7 +513,8 @@ module Google
|
|
483
513
|
sink,
|
484
514
|
unique_writer_identity: nil,
|
485
515
|
update_mask: nil,
|
486
|
-
options: nil
|
516
|
+
options: nil,
|
517
|
+
&block
|
487
518
|
req = {
|
488
519
|
sink_name: sink_name,
|
489
520
|
sink: sink,
|
@@ -491,7 +522,7 @@ module Google
|
|
491
522
|
update_mask: update_mask
|
492
523
|
}.delete_if { |_, v| v.nil? }
|
493
524
|
req = Google::Gax::to_proto(req, Google::Logging::V2::UpdateSinkRequest)
|
494
|
-
@update_sink.call(req, options)
|
525
|
+
@update_sink.call(req, options, &block)
|
495
526
|
end
|
496
527
|
|
497
528
|
# Deletes a sink. If the sink has a unique +writer_identity+, then that
|
@@ -510,22 +541,26 @@ module Google
|
|
510
541
|
# @param options [Google::Gax::CallOptions]
|
511
542
|
# Overrides the default settings for this call, e.g, timeout,
|
512
543
|
# retries, etc.
|
544
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
545
|
+
# @yieldparam result []
|
546
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
513
547
|
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
514
548
|
# @example
|
515
549
|
# require "google/cloud/logging/v2"
|
516
550
|
#
|
517
|
-
# config_service_v2_client = Google::Cloud::Logging::V2::
|
551
|
+
# config_service_v2_client = Google::Cloud::Logging::V2::ConfigServiceV2Client.new
|
518
552
|
# formatted_sink_name = Google::Cloud::Logging::V2::ConfigServiceV2Client.sink_path("[PROJECT]", "[SINK]")
|
519
553
|
# config_service_v2_client.delete_sink(formatted_sink_name)
|
520
554
|
|
521
555
|
def delete_sink \
|
522
556
|
sink_name,
|
523
|
-
options: nil
|
557
|
+
options: nil,
|
558
|
+
&block
|
524
559
|
req = {
|
525
560
|
sink_name: sink_name
|
526
561
|
}.delete_if { |_, v| v.nil? }
|
527
562
|
req = Google::Gax::to_proto(req, Google::Logging::V2::DeleteSinkRequest)
|
528
|
-
@delete_sink.call(req, options)
|
563
|
+
@delete_sink.call(req, options, &block)
|
529
564
|
nil
|
530
565
|
end
|
531
566
|
|
@@ -547,6 +582,9 @@ module Google
|
|
547
582
|
# @param options [Google::Gax::CallOptions]
|
548
583
|
# Overrides the default settings for this call, e.g, timeout,
|
549
584
|
# retries, etc.
|
585
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
586
|
+
# @yieldparam result [Google::Gax::PagedEnumerable<Google::Logging::V2::LogExclusion>]
|
587
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
550
588
|
# @return [Google::Gax::PagedEnumerable<Google::Logging::V2::LogExclusion>]
|
551
589
|
# An enumerable of Google::Logging::V2::LogExclusion instances.
|
552
590
|
# See Google::Gax::PagedEnumerable documentation for other
|
@@ -556,7 +594,7 @@ module Google
|
|
556
594
|
# @example
|
557
595
|
# require "google/cloud/logging/v2"
|
558
596
|
#
|
559
|
-
# config_service_v2_client = Google::Cloud::Logging::V2::
|
597
|
+
# config_service_v2_client = Google::Cloud::Logging::V2::ConfigServiceV2Client.new
|
560
598
|
# formatted_parent = Google::Cloud::Logging::V2::ConfigServiceV2Client.project_path("[PROJECT]")
|
561
599
|
#
|
562
600
|
# # Iterate over all results.
|
@@ -575,13 +613,14 @@ module Google
|
|
575
613
|
def list_exclusions \
|
576
614
|
parent,
|
577
615
|
page_size: nil,
|
578
|
-
options: nil
|
616
|
+
options: nil,
|
617
|
+
&block
|
579
618
|
req = {
|
580
619
|
parent: parent,
|
581
620
|
page_size: page_size
|
582
621
|
}.delete_if { |_, v| v.nil? }
|
583
622
|
req = Google::Gax::to_proto(req, Google::Logging::V2::ListExclusionsRequest)
|
584
|
-
@list_exclusions.call(req, options)
|
623
|
+
@list_exclusions.call(req, options, &block)
|
585
624
|
end
|
586
625
|
|
587
626
|
# Gets the description of an exclusion.
|
@@ -598,23 +637,27 @@ module Google
|
|
598
637
|
# @param options [Google::Gax::CallOptions]
|
599
638
|
# Overrides the default settings for this call, e.g, timeout,
|
600
639
|
# retries, etc.
|
640
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
641
|
+
# @yieldparam result [Google::Logging::V2::LogExclusion]
|
642
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
601
643
|
# @return [Google::Logging::V2::LogExclusion]
|
602
644
|
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
603
645
|
# @example
|
604
646
|
# require "google/cloud/logging/v2"
|
605
647
|
#
|
606
|
-
# config_service_v2_client = Google::Cloud::Logging::V2::
|
648
|
+
# config_service_v2_client = Google::Cloud::Logging::V2::ConfigServiceV2Client.new
|
607
649
|
# formatted_name = Google::Cloud::Logging::V2::ConfigServiceV2Client.exclusion_path("[PROJECT]", "[EXCLUSION]")
|
608
650
|
# response = config_service_v2_client.get_exclusion(formatted_name)
|
609
651
|
|
610
652
|
def get_exclusion \
|
611
653
|
name,
|
612
|
-
options: nil
|
654
|
+
options: nil,
|
655
|
+
&block
|
613
656
|
req = {
|
614
657
|
name: name
|
615
658
|
}.delete_if { |_, v| v.nil? }
|
616
659
|
req = Google::Gax::to_proto(req, Google::Logging::V2::GetExclusionRequest)
|
617
|
-
@get_exclusion.call(req, options)
|
660
|
+
@get_exclusion.call(req, options, &block)
|
618
661
|
end
|
619
662
|
|
620
663
|
# Creates a new exclusion in a specified parent resource.
|
@@ -638,26 +681,32 @@ module Google
|
|
638
681
|
# @param options [Google::Gax::CallOptions]
|
639
682
|
# Overrides the default settings for this call, e.g, timeout,
|
640
683
|
# retries, etc.
|
684
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
685
|
+
# @yieldparam result [Google::Logging::V2::LogExclusion]
|
686
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
641
687
|
# @return [Google::Logging::V2::LogExclusion]
|
642
688
|
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
643
689
|
# @example
|
644
690
|
# require "google/cloud/logging/v2"
|
645
691
|
#
|
646
|
-
# config_service_v2_client = Google::Cloud::Logging::V2::
|
692
|
+
# config_service_v2_client = Google::Cloud::Logging::V2::ConfigServiceV2Client.new
|
647
693
|
# formatted_parent = Google::Cloud::Logging::V2::ConfigServiceV2Client.project_path("[PROJECT]")
|
694
|
+
#
|
695
|
+
# # TODO: Initialize +exclusion+:
|
648
696
|
# exclusion = {}
|
649
697
|
# response = config_service_v2_client.create_exclusion(formatted_parent, exclusion)
|
650
698
|
|
651
699
|
def create_exclusion \
|
652
700
|
parent,
|
653
701
|
exclusion,
|
654
|
-
options: nil
|
702
|
+
options: nil,
|
703
|
+
&block
|
655
704
|
req = {
|
656
705
|
parent: parent,
|
657
706
|
exclusion: exclusion
|
658
707
|
}.delete_if { |_, v| v.nil? }
|
659
708
|
req = Google::Gax::to_proto(req, Google::Logging::V2::CreateExclusionRequest)
|
660
|
-
@create_exclusion.call(req, options)
|
709
|
+
@create_exclusion.call(req, options, &block)
|
661
710
|
end
|
662
711
|
|
663
712
|
# Changes one or more properties of an existing exclusion.
|
@@ -689,14 +738,21 @@ module Google
|
|
689
738
|
# @param options [Google::Gax::CallOptions]
|
690
739
|
# Overrides the default settings for this call, e.g, timeout,
|
691
740
|
# retries, etc.
|
741
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
742
|
+
# @yieldparam result [Google::Logging::V2::LogExclusion]
|
743
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
692
744
|
# @return [Google::Logging::V2::LogExclusion]
|
693
745
|
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
694
746
|
# @example
|
695
747
|
# require "google/cloud/logging/v2"
|
696
748
|
#
|
697
|
-
# config_service_v2_client = Google::Cloud::Logging::V2::
|
749
|
+
# config_service_v2_client = Google::Cloud::Logging::V2::ConfigServiceV2Client.new
|
698
750
|
# formatted_name = Google::Cloud::Logging::V2::ConfigServiceV2Client.exclusion_path("[PROJECT]", "[EXCLUSION]")
|
751
|
+
#
|
752
|
+
# # TODO: Initialize +exclusion+:
|
699
753
|
# exclusion = {}
|
754
|
+
#
|
755
|
+
# # TODO: Initialize +update_mask+:
|
700
756
|
# update_mask = {}
|
701
757
|
# response = config_service_v2_client.update_exclusion(formatted_name, exclusion, update_mask)
|
702
758
|
|
@@ -704,14 +760,15 @@ module Google
|
|
704
760
|
name,
|
705
761
|
exclusion,
|
706
762
|
update_mask,
|
707
|
-
options: nil
|
763
|
+
options: nil,
|
764
|
+
&block
|
708
765
|
req = {
|
709
766
|
name: name,
|
710
767
|
exclusion: exclusion,
|
711
768
|
update_mask: update_mask
|
712
769
|
}.delete_if { |_, v| v.nil? }
|
713
770
|
req = Google::Gax::to_proto(req, Google::Logging::V2::UpdateExclusionRequest)
|
714
|
-
@update_exclusion.call(req, options)
|
771
|
+
@update_exclusion.call(req, options, &block)
|
715
772
|
end
|
716
773
|
|
717
774
|
# Deletes an exclusion.
|
@@ -728,22 +785,26 @@ module Google
|
|
728
785
|
# @param options [Google::Gax::CallOptions]
|
729
786
|
# Overrides the default settings for this call, e.g, timeout,
|
730
787
|
# retries, etc.
|
788
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
789
|
+
# @yieldparam result []
|
790
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
731
791
|
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
732
792
|
# @example
|
733
793
|
# require "google/cloud/logging/v2"
|
734
794
|
#
|
735
|
-
# config_service_v2_client = Google::Cloud::Logging::V2::
|
795
|
+
# config_service_v2_client = Google::Cloud::Logging::V2::ConfigServiceV2Client.new
|
736
796
|
# formatted_name = Google::Cloud::Logging::V2::ConfigServiceV2Client.exclusion_path("[PROJECT]", "[EXCLUSION]")
|
737
797
|
# config_service_v2_client.delete_exclusion(formatted_name)
|
738
798
|
|
739
799
|
def delete_exclusion \
|
740
800
|
name,
|
741
|
-
options: nil
|
801
|
+
options: nil,
|
802
|
+
&block
|
742
803
|
req = {
|
743
804
|
name: name
|
744
805
|
}.delete_if { |_, v| v.nil? }
|
745
806
|
req = Google::Gax::to_proto(req, Google::Logging::V2::DeleteExclusionRequest)
|
746
|
-
@delete_exclusion.call(req, options)
|
807
|
+
@delete_exclusion.call(req, options, &block)
|
747
808
|
nil
|
748
809
|
end
|
749
810
|
end
|