google-cloud-logging-v2 0.5.3 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +1 -1
- data/AUTHENTICATION.md +7 -25
- data/README.md +1 -1
- data/lib/google/cloud/logging/v2/config_service/client.rb +1087 -230
- data/lib/google/cloud/logging/v2/config_service/operations.rb +767 -0
- data/lib/google/cloud/logging/v2/config_service/paths.rb +53 -0
- data/lib/google/cloud/logging/v2/config_service.rb +1 -0
- data/lib/google/cloud/logging/v2/logging_service/client.rb +213 -89
- data/lib/google/cloud/logging/v2/metrics_service/client.rb +150 -56
- data/lib/google/cloud/logging/v2/version.rb +1 -1
- data/lib/google/logging/v2/log_entry_pb.rb +10 -4
- data/lib/google/logging/v2/logging_config_pb.rb +52 -3
- data/lib/google/logging/v2/logging_config_services_pb.rb +79 -40
- data/lib/google/logging/v2/logging_metrics_pb.rb +4 -3
- data/lib/google/logging/v2/logging_metrics_services_pb.rb +1 -1
- data/lib/google/logging/v2/logging_pb.rb +3 -3
- data/lib/google/logging/v2/logging_services_pb.rb +5 -5
- data/proto_docs/google/api/resource.rb +10 -71
- data/proto_docs/google/logging/v2/log_entry.rb +42 -4
- data/proto_docs/google/logging/v2/logging.rb +50 -45
- data/proto_docs/google/logging/v2/logging_config.rb +416 -155
- data/proto_docs/google/logging/v2/logging_metrics.rb +9 -5
- data/proto_docs/google/longrunning/operations.rb +164 -0
- metadata +7 -5
@@ -41,13 +41,12 @@ module Google
|
|
41
41
|
# See {::Google::Cloud::Logging::V2::ConfigService::Client::Configuration}
|
42
42
|
# for a description of the configuration fields.
|
43
43
|
#
|
44
|
-
#
|
44
|
+
# @example
|
45
45
|
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
50
|
-
# end
|
46
|
+
# # Modify the configuration for all ConfigService clients
|
47
|
+
# ::Google::Cloud::Logging::V2::ConfigService::Client.configure do |config|
|
48
|
+
# config.timeout = 10.0
|
49
|
+
# end
|
51
50
|
#
|
52
51
|
# @yield [config] Configure the Client client.
|
53
52
|
# @yieldparam config [Client::Configuration]
|
@@ -135,19 +134,15 @@ module Google
|
|
135
134
|
##
|
136
135
|
# Create a new ConfigService client object.
|
137
136
|
#
|
138
|
-
#
|
139
|
-
#
|
140
|
-
# To create a new ConfigService client with the default
|
141
|
-
# configuration:
|
137
|
+
# @example
|
142
138
|
#
|
143
|
-
#
|
139
|
+
# # Create a client using the default configuration
|
140
|
+
# client = ::Google::Cloud::Logging::V2::ConfigService::Client.new
|
144
141
|
#
|
145
|
-
#
|
146
|
-
#
|
147
|
-
#
|
148
|
-
#
|
149
|
-
# config.timeout = 10.0
|
150
|
-
# end
|
142
|
+
# # Create a client using a custom configuration
|
143
|
+
# client = ::Google::Cloud::Logging::V2::ConfigService::Client.new do |config|
|
144
|
+
# config.timeout = 10.0
|
145
|
+
# end
|
151
146
|
#
|
152
147
|
# @yield [config] Configure the ConfigService client.
|
153
148
|
# @yieldparam config [Client::Configuration]
|
@@ -167,10 +162,9 @@ module Google
|
|
167
162
|
|
168
163
|
# Create credentials
|
169
164
|
credentials = @config.credentials
|
170
|
-
# Use self-signed JWT if the
|
165
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
171
166
|
# but only if the default endpoint does not have a region prefix.
|
172
|
-
enable_self_signed_jwt = @config.
|
173
|
-
@config.endpoint == Client.configure.endpoint &&
|
167
|
+
enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
|
174
168
|
!@config.endpoint.split(".").first.include?("-")
|
175
169
|
credentials ||= Credentials.default scope: @config.scope,
|
176
170
|
enable_self_signed_jwt: enable_self_signed_jwt
|
@@ -180,6 +174,12 @@ module Google
|
|
180
174
|
@quota_project_id = @config.quota_project
|
181
175
|
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
182
176
|
|
177
|
+
@operations_client = Operations.new do |config|
|
178
|
+
config.credentials = credentials
|
179
|
+
config.quota_project = @quota_project_id
|
180
|
+
config.endpoint = @config.endpoint
|
181
|
+
end
|
182
|
+
|
183
183
|
@config_service_stub = ::Gapic::ServiceStub.new(
|
184
184
|
::Google::Cloud::Logging::V2::ConfigServiceV2::Stub,
|
185
185
|
credentials: credentials,
|
@@ -189,10 +189,17 @@ module Google
|
|
189
189
|
)
|
190
190
|
end
|
191
191
|
|
192
|
+
##
|
193
|
+
# Get the associated client for long-running operations.
|
194
|
+
#
|
195
|
+
# @return [::Google::Cloud::Logging::V2::ConfigService::Operations]
|
196
|
+
#
|
197
|
+
attr_reader :operations_client
|
198
|
+
|
192
199
|
# Service calls
|
193
200
|
|
194
201
|
##
|
195
|
-
# Lists buckets.
|
202
|
+
# Lists log buckets.
|
196
203
|
#
|
197
204
|
# @overload list_buckets(request, options = nil)
|
198
205
|
# Pass arguments to `list_buckets` via a request object, either of type
|
@@ -221,14 +228,14 @@ module Google
|
|
221
228
|
# supplying the character `-` in place of [LOCATION_ID] will return all
|
222
229
|
# buckets.
|
223
230
|
# @param page_token [::String]
|
224
|
-
# Optional. If present, then retrieve the next batch of results from the
|
225
|
-
#
|
226
|
-
#
|
227
|
-
#
|
231
|
+
# Optional. If present, then retrieve the next batch of results from the preceding call
|
232
|
+
# to this method. `pageToken` must be the value of `nextPageToken` from the
|
233
|
+
# previous response. The values of other method parameters should be
|
234
|
+
# identical to those in the previous call.
|
228
235
|
# @param page_size [::Integer]
|
229
|
-
# Optional. The maximum number of results to return from this request.
|
230
|
-
#
|
231
|
-
#
|
236
|
+
# Optional. The maximum number of results to return from this request. Non-positive
|
237
|
+
# values are ignored. The presence of `nextPageToken` in the response
|
238
|
+
# indicates that more results might be available.
|
232
239
|
#
|
233
240
|
# @yield [response, operation] Access the result along with the RPC operation
|
234
241
|
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogBucket>]
|
@@ -238,6 +245,27 @@ module Google
|
|
238
245
|
#
|
239
246
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
240
247
|
#
|
248
|
+
# @example Basic example
|
249
|
+
# require "google/cloud/logging/v2"
|
250
|
+
#
|
251
|
+
# # Create a client object. The client can be reused for multiple calls.
|
252
|
+
# client = Google::Cloud::Logging::V2::ConfigService::Client.new
|
253
|
+
#
|
254
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
255
|
+
# request = Google::Cloud::Logging::V2::ListBucketsRequest.new
|
256
|
+
#
|
257
|
+
# # Call the list_buckets method.
|
258
|
+
# result = client.list_buckets request
|
259
|
+
#
|
260
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
261
|
+
# # iterate over all elements by calling #each, and the enumerable
|
262
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
263
|
+
# # methods are also available for managing paging directly.
|
264
|
+
# result.each do |response|
|
265
|
+
# # Each element is of type ::Google::Cloud::Logging::V2::LogBucket.
|
266
|
+
# p response
|
267
|
+
# end
|
268
|
+
#
|
241
269
|
def list_buckets request, options = nil
|
242
270
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
243
271
|
|
@@ -255,16 +283,20 @@ module Google
|
|
255
283
|
gapic_version: ::Google::Cloud::Logging::V2::VERSION
|
256
284
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
257
285
|
|
258
|
-
header_params = {
|
259
|
-
|
260
|
-
|
286
|
+
header_params = {}
|
287
|
+
if request.parent
|
288
|
+
header_params["parent"] = request.parent
|
289
|
+
end
|
290
|
+
|
261
291
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
262
292
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
263
293
|
|
264
294
|
options.apply_defaults timeout: @config.rpcs.list_buckets.timeout,
|
265
295
|
metadata: metadata,
|
266
296
|
retry_policy: @config.rpcs.list_buckets.retry_policy
|
267
|
-
|
297
|
+
|
298
|
+
options.apply_defaults timeout: @config.timeout,
|
299
|
+
metadata: @config.metadata,
|
268
300
|
retry_policy: @config.retry_policy
|
269
301
|
|
270
302
|
@config_service_stub.call_rpc :list_buckets, request, options: options do |response, operation|
|
@@ -277,7 +309,7 @@ module Google
|
|
277
309
|
end
|
278
310
|
|
279
311
|
##
|
280
|
-
# Gets a bucket.
|
312
|
+
# Gets a log bucket.
|
281
313
|
#
|
282
314
|
# @overload get_bucket(request, options = nil)
|
283
315
|
# Pass arguments to `get_bucket` via a request object, either of type
|
@@ -302,8 +334,9 @@ module Google
|
|
302
334
|
# "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
|
303
335
|
# "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
|
304
336
|
#
|
305
|
-
#
|
306
|
-
#
|
337
|
+
# For example:
|
338
|
+
#
|
339
|
+
# `"projects/my-project/locations/global/buckets/my-bucket"`
|
307
340
|
#
|
308
341
|
# @yield [response, operation] Access the result along with the RPC operation
|
309
342
|
# @yieldparam response [::Google::Cloud::Logging::V2::LogBucket]
|
@@ -313,6 +346,21 @@ module Google
|
|
313
346
|
#
|
314
347
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
315
348
|
#
|
349
|
+
# @example Basic example
|
350
|
+
# require "google/cloud/logging/v2"
|
351
|
+
#
|
352
|
+
# # Create a client object. The client can be reused for multiple calls.
|
353
|
+
# client = Google::Cloud::Logging::V2::ConfigService::Client.new
|
354
|
+
#
|
355
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
356
|
+
# request = Google::Cloud::Logging::V2::GetBucketRequest.new
|
357
|
+
#
|
358
|
+
# # Call the get_bucket method.
|
359
|
+
# result = client.get_bucket request
|
360
|
+
#
|
361
|
+
# # The returned object is of type Google::Cloud::Logging::V2::LogBucket.
|
362
|
+
# p result
|
363
|
+
#
|
316
364
|
def get_bucket request, options = nil
|
317
365
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
318
366
|
|
@@ -330,16 +378,20 @@ module Google
|
|
330
378
|
gapic_version: ::Google::Cloud::Logging::V2::VERSION
|
331
379
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
332
380
|
|
333
|
-
header_params = {
|
334
|
-
|
335
|
-
|
381
|
+
header_params = {}
|
382
|
+
if request.name
|
383
|
+
header_params["name"] = request.name
|
384
|
+
end
|
385
|
+
|
336
386
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
337
387
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
338
388
|
|
339
389
|
options.apply_defaults timeout: @config.rpcs.get_bucket.timeout,
|
340
390
|
metadata: metadata,
|
341
391
|
retry_policy: @config.rpcs.get_bucket.retry_policy
|
342
|
-
|
392
|
+
|
393
|
+
options.apply_defaults timeout: @config.timeout,
|
394
|
+
metadata: @config.metadata,
|
343
395
|
retry_policy: @config.retry_policy
|
344
396
|
|
345
397
|
@config_service_stub.call_rpc :get_bucket, request, options: options do |response, operation|
|
@@ -351,8 +403,8 @@ module Google
|
|
351
403
|
end
|
352
404
|
|
353
405
|
##
|
354
|
-
# Creates a bucket that can be used to store log entries.
|
355
|
-
# been created, the
|
406
|
+
# Creates a log bucket that can be used to store log entries. After a bucket
|
407
|
+
# has been created, the bucket's location cannot be changed.
|
356
408
|
#
|
357
409
|
# @overload create_bucket(request, options = nil)
|
358
410
|
# Pass arguments to `create_bucket` via a request object, either of type
|
@@ -370,15 +422,17 @@ module Google
|
|
370
422
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
371
423
|
#
|
372
424
|
# @param parent [::String]
|
373
|
-
# Required. The resource in which to create the bucket:
|
425
|
+
# Required. The resource in which to create the log bucket:
|
374
426
|
#
|
375
427
|
# "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
|
376
428
|
#
|
377
|
-
#
|
429
|
+
# For example:
|
430
|
+
#
|
431
|
+
# `"projects/my-project/locations/global"`
|
378
432
|
# @param bucket_id [::String]
|
379
|
-
# Required. A client-assigned identifier such as `"my-bucket"`. Identifiers are
|
380
|
-
#
|
381
|
-
#
|
433
|
+
# Required. A client-assigned identifier such as `"my-bucket"`. Identifiers are limited
|
434
|
+
# to 100 characters and can include only letters, digits, underscores,
|
435
|
+
# hyphens, and periods.
|
382
436
|
# @param bucket [::Google::Cloud::Logging::V2::LogBucket, ::Hash]
|
383
437
|
# Required. The new bucket. The region specified in the new bucket must be compliant
|
384
438
|
# with any Location Restriction Org Policy. The name field in the bucket is
|
@@ -392,6 +446,21 @@ module Google
|
|
392
446
|
#
|
393
447
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
394
448
|
#
|
449
|
+
# @example Basic example
|
450
|
+
# require "google/cloud/logging/v2"
|
451
|
+
#
|
452
|
+
# # Create a client object. The client can be reused for multiple calls.
|
453
|
+
# client = Google::Cloud::Logging::V2::ConfigService::Client.new
|
454
|
+
#
|
455
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
456
|
+
# request = Google::Cloud::Logging::V2::CreateBucketRequest.new
|
457
|
+
#
|
458
|
+
# # Call the create_bucket method.
|
459
|
+
# result = client.create_bucket request
|
460
|
+
#
|
461
|
+
# # The returned object is of type Google::Cloud::Logging::V2::LogBucket.
|
462
|
+
# p result
|
463
|
+
#
|
395
464
|
def create_bucket request, options = nil
|
396
465
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
397
466
|
|
@@ -409,16 +478,20 @@ module Google
|
|
409
478
|
gapic_version: ::Google::Cloud::Logging::V2::VERSION
|
410
479
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
411
480
|
|
412
|
-
header_params = {
|
413
|
-
|
414
|
-
|
481
|
+
header_params = {}
|
482
|
+
if request.parent
|
483
|
+
header_params["parent"] = request.parent
|
484
|
+
end
|
485
|
+
|
415
486
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
416
487
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
417
488
|
|
418
489
|
options.apply_defaults timeout: @config.rpcs.create_bucket.timeout,
|
419
490
|
metadata: metadata,
|
420
491
|
retry_policy: @config.rpcs.create_bucket.retry_policy
|
421
|
-
|
492
|
+
|
493
|
+
options.apply_defaults timeout: @config.timeout,
|
494
|
+
metadata: @config.metadata,
|
422
495
|
retry_policy: @config.retry_policy
|
423
496
|
|
424
497
|
@config_service_stub.call_rpc :create_bucket, request, options: options do |response, operation|
|
@@ -430,16 +503,16 @@ module Google
|
|
430
503
|
end
|
431
504
|
|
432
505
|
##
|
433
|
-
# Updates a bucket. This method replaces the following fields in the
|
506
|
+
# Updates a log bucket. This method replaces the following fields in the
|
434
507
|
# existing bucket with values from the new bucket: `retention_period`
|
435
508
|
#
|
436
509
|
# If the retention period is decreased and the bucket is locked,
|
437
|
-
# FAILED_PRECONDITION will be returned.
|
510
|
+
# `FAILED_PRECONDITION` will be returned.
|
438
511
|
#
|
439
|
-
# If the bucket has a
|
440
|
-
# will be returned.
|
512
|
+
# If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then
|
513
|
+
# `FAILED_PRECONDITION` will be returned.
|
441
514
|
#
|
442
|
-
#
|
515
|
+
# After a bucket has been created, the bucket's location cannot be changed.
|
443
516
|
#
|
444
517
|
# @overload update_bucket(request, options = nil)
|
445
518
|
# Pass arguments to `update_bucket` via a request object, either of type
|
@@ -464,21 +537,20 @@ module Google
|
|
464
537
|
# "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
|
465
538
|
# "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
|
466
539
|
#
|
467
|
-
#
|
468
|
-
#
|
469
|
-
#
|
470
|
-
# locked property
|
540
|
+
# For example:
|
541
|
+
#
|
542
|
+
# `"projects/my-project/locations/global/buckets/my-bucket"`
|
471
543
|
# @param bucket [::Google::Cloud::Logging::V2::LogBucket, ::Hash]
|
472
544
|
# Required. The updated bucket.
|
473
545
|
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
474
546
|
# Required. Field mask that specifies the fields in `bucket` that need an update. A
|
475
|
-
# bucket field will be overwritten if, and only if, it is in the update
|
476
|
-
#
|
547
|
+
# bucket field will be overwritten if, and only if, it is in the update mask.
|
548
|
+
# `name` and output only fields cannot be updated.
|
477
549
|
#
|
478
|
-
# For a detailed `FieldMask` definition, see
|
550
|
+
# For a detailed `FieldMask` definition, see:
|
479
551
|
# https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
|
480
552
|
#
|
481
|
-
#
|
553
|
+
# For example: `updateMask=retention_days`
|
482
554
|
#
|
483
555
|
# @yield [response, operation] Access the result along with the RPC operation
|
484
556
|
# @yieldparam response [::Google::Cloud::Logging::V2::LogBucket]
|
@@ -488,6 +560,21 @@ module Google
|
|
488
560
|
#
|
489
561
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
490
562
|
#
|
563
|
+
# @example Basic example
|
564
|
+
# require "google/cloud/logging/v2"
|
565
|
+
#
|
566
|
+
# # Create a client object. The client can be reused for multiple calls.
|
567
|
+
# client = Google::Cloud::Logging::V2::ConfigService::Client.new
|
568
|
+
#
|
569
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
570
|
+
# request = Google::Cloud::Logging::V2::UpdateBucketRequest.new
|
571
|
+
#
|
572
|
+
# # Call the update_bucket method.
|
573
|
+
# result = client.update_bucket request
|
574
|
+
#
|
575
|
+
# # The returned object is of type Google::Cloud::Logging::V2::LogBucket.
|
576
|
+
# p result
|
577
|
+
#
|
491
578
|
def update_bucket request, options = nil
|
492
579
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
493
580
|
|
@@ -505,16 +592,20 @@ module Google
|
|
505
592
|
gapic_version: ::Google::Cloud::Logging::V2::VERSION
|
506
593
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
507
594
|
|
508
|
-
header_params = {
|
509
|
-
|
510
|
-
|
595
|
+
header_params = {}
|
596
|
+
if request.name
|
597
|
+
header_params["name"] = request.name
|
598
|
+
end
|
599
|
+
|
511
600
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
512
601
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
513
602
|
|
514
603
|
options.apply_defaults timeout: @config.rpcs.update_bucket.timeout,
|
515
604
|
metadata: metadata,
|
516
605
|
retry_policy: @config.rpcs.update_bucket.retry_policy
|
517
|
-
|
606
|
+
|
607
|
+
options.apply_defaults timeout: @config.timeout,
|
608
|
+
metadata: @config.metadata,
|
518
609
|
retry_policy: @config.retry_policy
|
519
610
|
|
520
611
|
@config_service_stub.call_rpc :update_bucket, request, options: options do |response, operation|
|
@@ -526,10 +617,11 @@ module Google
|
|
526
617
|
end
|
527
618
|
|
528
619
|
##
|
529
|
-
# Deletes a bucket.
|
530
|
-
#
|
531
|
-
#
|
532
|
-
#
|
620
|
+
# Deletes a log bucket.
|
621
|
+
#
|
622
|
+
# Changes the bucket's `lifecycle_state` to the `DELETE_REQUESTED` state.
|
623
|
+
# After 7 days, the bucket will be purged and all log entries in the bucket
|
624
|
+
# will be permanently deleted.
|
533
625
|
#
|
534
626
|
# @overload delete_bucket(request, options = nil)
|
535
627
|
# Pass arguments to `delete_bucket` via a request object, either of type
|
@@ -554,8 +646,9 @@ module Google
|
|
554
646
|
# "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
|
555
647
|
# "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
|
556
648
|
#
|
557
|
-
#
|
558
|
-
#
|
649
|
+
# For example:
|
650
|
+
#
|
651
|
+
# `"projects/my-project/locations/global/buckets/my-bucket"`
|
559
652
|
#
|
560
653
|
# @yield [response, operation] Access the result along with the RPC operation
|
561
654
|
# @yieldparam response [::Google::Protobuf::Empty]
|
@@ -565,6 +658,21 @@ module Google
|
|
565
658
|
#
|
566
659
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
567
660
|
#
|
661
|
+
# @example Basic example
|
662
|
+
# require "google/cloud/logging/v2"
|
663
|
+
#
|
664
|
+
# # Create a client object. The client can be reused for multiple calls.
|
665
|
+
# client = Google::Cloud::Logging::V2::ConfigService::Client.new
|
666
|
+
#
|
667
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
668
|
+
# request = Google::Cloud::Logging::V2::DeleteBucketRequest.new
|
669
|
+
#
|
670
|
+
# # Call the delete_bucket method.
|
671
|
+
# result = client.delete_bucket request
|
672
|
+
#
|
673
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
674
|
+
# p result
|
675
|
+
#
|
568
676
|
def delete_bucket request, options = nil
|
569
677
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
570
678
|
|
@@ -582,16 +690,20 @@ module Google
|
|
582
690
|
gapic_version: ::Google::Cloud::Logging::V2::VERSION
|
583
691
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
584
692
|
|
585
|
-
header_params = {
|
586
|
-
|
587
|
-
|
693
|
+
header_params = {}
|
694
|
+
if request.name
|
695
|
+
header_params["name"] = request.name
|
696
|
+
end
|
697
|
+
|
588
698
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
589
699
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
590
700
|
|
591
701
|
options.apply_defaults timeout: @config.rpcs.delete_bucket.timeout,
|
592
702
|
metadata: metadata,
|
593
703
|
retry_policy: @config.rpcs.delete_bucket.retry_policy
|
594
|
-
|
704
|
+
|
705
|
+
options.apply_defaults timeout: @config.timeout,
|
706
|
+
metadata: @config.metadata,
|
595
707
|
retry_policy: @config.retry_policy
|
596
708
|
|
597
709
|
@config_service_stub.call_rpc :delete_bucket, request, options: options do |response, operation|
|
@@ -603,8 +715,8 @@ module Google
|
|
603
715
|
end
|
604
716
|
|
605
717
|
##
|
606
|
-
# Undeletes a bucket. A bucket that has been deleted
|
607
|
-
# the grace period of 7 days.
|
718
|
+
# Undeletes a log bucket. A bucket that has been deleted can be undeleted
|
719
|
+
# within the grace period of 7 days.
|
608
720
|
#
|
609
721
|
# @overload undelete_bucket(request, options = nil)
|
610
722
|
# Pass arguments to `undelete_bucket` via a request object, either of type
|
@@ -629,8 +741,9 @@ module Google
|
|
629
741
|
# "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
|
630
742
|
# "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
|
631
743
|
#
|
632
|
-
#
|
633
|
-
#
|
744
|
+
# For example:
|
745
|
+
#
|
746
|
+
# `"projects/my-project/locations/global/buckets/my-bucket"`
|
634
747
|
#
|
635
748
|
# @yield [response, operation] Access the result along with the RPC operation
|
636
749
|
# @yieldparam response [::Google::Protobuf::Empty]
|
@@ -640,6 +753,21 @@ module Google
|
|
640
753
|
#
|
641
754
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
642
755
|
#
|
756
|
+
# @example Basic example
|
757
|
+
# require "google/cloud/logging/v2"
|
758
|
+
#
|
759
|
+
# # Create a client object. The client can be reused for multiple calls.
|
760
|
+
# client = Google::Cloud::Logging::V2::ConfigService::Client.new
|
761
|
+
#
|
762
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
763
|
+
# request = Google::Cloud::Logging::V2::UndeleteBucketRequest.new
|
764
|
+
#
|
765
|
+
# # Call the undelete_bucket method.
|
766
|
+
# result = client.undelete_bucket request
|
767
|
+
#
|
768
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
769
|
+
# p result
|
770
|
+
#
|
643
771
|
def undelete_bucket request, options = nil
|
644
772
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
645
773
|
|
@@ -657,16 +785,20 @@ module Google
|
|
657
785
|
gapic_version: ::Google::Cloud::Logging::V2::VERSION
|
658
786
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
659
787
|
|
660
|
-
header_params = {
|
661
|
-
|
662
|
-
|
788
|
+
header_params = {}
|
789
|
+
if request.name
|
790
|
+
header_params["name"] = request.name
|
791
|
+
end
|
792
|
+
|
663
793
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
664
794
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
665
795
|
|
666
796
|
options.apply_defaults timeout: @config.rpcs.undelete_bucket.timeout,
|
667
797
|
metadata: metadata,
|
668
798
|
retry_policy: @config.rpcs.undelete_bucket.retry_policy
|
669
|
-
|
799
|
+
|
800
|
+
options.apply_defaults timeout: @config.timeout,
|
801
|
+
metadata: @config.metadata,
|
670
802
|
retry_policy: @config.retry_policy
|
671
803
|
|
672
804
|
@config_service_stub.call_rpc :undelete_bucket, request, options: options do |response, operation|
|
@@ -678,7 +810,7 @@ module Google
|
|
678
810
|
end
|
679
811
|
|
680
812
|
##
|
681
|
-
# Lists views on a bucket.
|
813
|
+
# Lists views on a log bucket.
|
682
814
|
#
|
683
815
|
# @overload list_views(request, options = nil)
|
684
816
|
# Pass arguments to `list_views` via a request object, either of type
|
@@ -700,12 +832,13 @@ module Google
|
|
700
832
|
#
|
701
833
|
# "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
|
702
834
|
# @param page_token [::String]
|
703
|
-
# Optional. If present, then retrieve the next batch of results from the
|
704
|
-
#
|
705
|
-
#
|
706
|
-
#
|
835
|
+
# Optional. If present, then retrieve the next batch of results from the preceding call
|
836
|
+
# to this method. `pageToken` must be the value of `nextPageToken` from the
|
837
|
+
# previous response. The values of other method parameters should be
|
838
|
+
# identical to those in the previous call.
|
707
839
|
# @param page_size [::Integer]
|
708
840
|
# Optional. The maximum number of results to return from this request.
|
841
|
+
#
|
709
842
|
# Non-positive values are ignored. The presence of `nextPageToken` in the
|
710
843
|
# response indicates that more results might be available.
|
711
844
|
#
|
@@ -717,6 +850,27 @@ module Google
|
|
717
850
|
#
|
718
851
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
719
852
|
#
|
853
|
+
# @example Basic example
|
854
|
+
# require "google/cloud/logging/v2"
|
855
|
+
#
|
856
|
+
# # Create a client object. The client can be reused for multiple calls.
|
857
|
+
# client = Google::Cloud::Logging::V2::ConfigService::Client.new
|
858
|
+
#
|
859
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
860
|
+
# request = Google::Cloud::Logging::V2::ListViewsRequest.new
|
861
|
+
#
|
862
|
+
# # Call the list_views method.
|
863
|
+
# result = client.list_views request
|
864
|
+
#
|
865
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
866
|
+
# # iterate over all elements by calling #each, and the enumerable
|
867
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
868
|
+
# # methods are also available for managing paging directly.
|
869
|
+
# result.each do |response|
|
870
|
+
# # Each element is of type ::Google::Cloud::Logging::V2::LogView.
|
871
|
+
# p response
|
872
|
+
# end
|
873
|
+
#
|
720
874
|
def list_views request, options = nil
|
721
875
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
722
876
|
|
@@ -734,16 +888,20 @@ module Google
|
|
734
888
|
gapic_version: ::Google::Cloud::Logging::V2::VERSION
|
735
889
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
736
890
|
|
737
|
-
header_params = {
|
738
|
-
|
739
|
-
|
891
|
+
header_params = {}
|
892
|
+
if request.parent
|
893
|
+
header_params["parent"] = request.parent
|
894
|
+
end
|
895
|
+
|
740
896
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
741
897
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
742
898
|
|
743
899
|
options.apply_defaults timeout: @config.rpcs.list_views.timeout,
|
744
900
|
metadata: metadata,
|
745
901
|
retry_policy: @config.rpcs.list_views.retry_policy
|
746
|
-
|
902
|
+
|
903
|
+
options.apply_defaults timeout: @config.timeout,
|
904
|
+
metadata: @config.metadata,
|
747
905
|
retry_policy: @config.retry_policy
|
748
906
|
|
749
907
|
@config_service_stub.call_rpc :list_views, request, options: options do |response, operation|
|
@@ -756,7 +914,7 @@ module Google
|
|
756
914
|
end
|
757
915
|
|
758
916
|
##
|
759
|
-
# Gets a view
|
917
|
+
# Gets a view on a log bucket..
|
760
918
|
#
|
761
919
|
# @overload get_view(request, options = nil)
|
762
920
|
# Pass arguments to `get_view` via a request object, either of type
|
@@ -778,8 +936,9 @@ module Google
|
|
778
936
|
#
|
779
937
|
# "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
|
780
938
|
#
|
781
|
-
#
|
782
|
-
#
|
939
|
+
# For example:
|
940
|
+
#
|
941
|
+
# `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"`
|
783
942
|
#
|
784
943
|
# @yield [response, operation] Access the result along with the RPC operation
|
785
944
|
# @yieldparam response [::Google::Cloud::Logging::V2::LogView]
|
@@ -789,6 +948,21 @@ module Google
|
|
789
948
|
#
|
790
949
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
791
950
|
#
|
951
|
+
# @example Basic example
|
952
|
+
# require "google/cloud/logging/v2"
|
953
|
+
#
|
954
|
+
# # Create a client object. The client can be reused for multiple calls.
|
955
|
+
# client = Google::Cloud::Logging::V2::ConfigService::Client.new
|
956
|
+
#
|
957
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
958
|
+
# request = Google::Cloud::Logging::V2::GetViewRequest.new
|
959
|
+
#
|
960
|
+
# # Call the get_view method.
|
961
|
+
# result = client.get_view request
|
962
|
+
#
|
963
|
+
# # The returned object is of type Google::Cloud::Logging::V2::LogView.
|
964
|
+
# p result
|
965
|
+
#
|
792
966
|
def get_view request, options = nil
|
793
967
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
794
968
|
|
@@ -806,16 +980,20 @@ module Google
|
|
806
980
|
gapic_version: ::Google::Cloud::Logging::V2::VERSION
|
807
981
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
808
982
|
|
809
|
-
header_params = {
|
810
|
-
|
811
|
-
|
983
|
+
header_params = {}
|
984
|
+
if request.name
|
985
|
+
header_params["name"] = request.name
|
986
|
+
end
|
987
|
+
|
812
988
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
813
989
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
814
990
|
|
815
991
|
options.apply_defaults timeout: @config.rpcs.get_view.timeout,
|
816
992
|
metadata: metadata,
|
817
993
|
retry_policy: @config.rpcs.get_view.retry_policy
|
818
|
-
|
994
|
+
|
995
|
+
options.apply_defaults timeout: @config.timeout,
|
996
|
+
metadata: @config.metadata,
|
819
997
|
retry_policy: @config.retry_policy
|
820
998
|
|
821
999
|
@config_service_stub.call_rpc :get_view, request, options: options do |response, operation|
|
@@ -827,8 +1005,8 @@ module Google
|
|
827
1005
|
end
|
828
1006
|
|
829
1007
|
##
|
830
|
-
# Creates a view over
|
831
|
-
#
|
1008
|
+
# Creates a view over log entries in a log bucket. A bucket may contain a
|
1009
|
+
# maximum of 30 views.
|
832
1010
|
#
|
833
1011
|
# @overload create_view(request, options = nil)
|
834
1012
|
# Pass arguments to `create_view` via a request object, either of type
|
@@ -848,10 +1026,11 @@ module Google
|
|
848
1026
|
# @param parent [::String]
|
849
1027
|
# Required. The bucket in which to create the view
|
850
1028
|
#
|
851
|
-
# "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
|
1029
|
+
# `"projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"`
|
852
1030
|
#
|
853
|
-
#
|
854
|
-
#
|
1031
|
+
# For example:
|
1032
|
+
#
|
1033
|
+
# `"projects/my-project/locations/global/buckets/my-bucket"`
|
855
1034
|
# @param view_id [::String]
|
856
1035
|
# Required. The id to use for this view.
|
857
1036
|
# @param view [::Google::Cloud::Logging::V2::LogView, ::Hash]
|
@@ -865,6 +1044,21 @@ module Google
|
|
865
1044
|
#
|
866
1045
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
867
1046
|
#
|
1047
|
+
# @example Basic example
|
1048
|
+
# require "google/cloud/logging/v2"
|
1049
|
+
#
|
1050
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1051
|
+
# client = Google::Cloud::Logging::V2::ConfigService::Client.new
|
1052
|
+
#
|
1053
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1054
|
+
# request = Google::Cloud::Logging::V2::CreateViewRequest.new
|
1055
|
+
#
|
1056
|
+
# # Call the create_view method.
|
1057
|
+
# result = client.create_view request
|
1058
|
+
#
|
1059
|
+
# # The returned object is of type Google::Cloud::Logging::V2::LogView.
|
1060
|
+
# p result
|
1061
|
+
#
|
868
1062
|
def create_view request, options = nil
|
869
1063
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
870
1064
|
|
@@ -882,16 +1076,20 @@ module Google
|
|
882
1076
|
gapic_version: ::Google::Cloud::Logging::V2::VERSION
|
883
1077
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
884
1078
|
|
885
|
-
header_params = {
|
886
|
-
|
887
|
-
|
1079
|
+
header_params = {}
|
1080
|
+
if request.parent
|
1081
|
+
header_params["parent"] = request.parent
|
1082
|
+
end
|
1083
|
+
|
888
1084
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
889
1085
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
890
1086
|
|
891
1087
|
options.apply_defaults timeout: @config.rpcs.create_view.timeout,
|
892
1088
|
metadata: metadata,
|
893
1089
|
retry_policy: @config.rpcs.create_view.retry_policy
|
894
|
-
|
1090
|
+
|
1091
|
+
options.apply_defaults timeout: @config.timeout,
|
1092
|
+
metadata: @config.metadata,
|
895
1093
|
retry_policy: @config.retry_policy
|
896
1094
|
|
897
1095
|
@config_service_stub.call_rpc :create_view, request, options: options do |response, operation|
|
@@ -903,8 +1101,11 @@ module Google
|
|
903
1101
|
end
|
904
1102
|
|
905
1103
|
##
|
906
|
-
# Updates a view. This method replaces the following fields
|
907
|
-
# view with values from the new view: `filter`.
|
1104
|
+
# Updates a view on a log bucket. This method replaces the following fields
|
1105
|
+
# in the existing view with values from the new view: `filter`.
|
1106
|
+
# If an `UNAVAILABLE` error is returned, this indicates that system is not in
|
1107
|
+
# a state where it can update the view. If this occurs, please try again in a
|
1108
|
+
# few minutes.
|
908
1109
|
#
|
909
1110
|
# @overload update_view(request, options = nil)
|
910
1111
|
# Pass arguments to `update_view` via a request object, either of type
|
@@ -926,8 +1127,9 @@ module Google
|
|
926
1127
|
#
|
927
1128
|
# "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
|
928
1129
|
#
|
929
|
-
#
|
930
|
-
#
|
1130
|
+
# For example:
|
1131
|
+
#
|
1132
|
+
# `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"`
|
931
1133
|
# @param view [::Google::Cloud::Logging::V2::LogView, ::Hash]
|
932
1134
|
# Required. The updated view.
|
933
1135
|
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
@@ -938,7 +1140,7 @@ module Google
|
|
938
1140
|
# For a detailed `FieldMask` definition, see
|
939
1141
|
# https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
|
940
1142
|
#
|
941
|
-
#
|
1143
|
+
# For example: `updateMask=filter`
|
942
1144
|
#
|
943
1145
|
# @yield [response, operation] Access the result along with the RPC operation
|
944
1146
|
# @yieldparam response [::Google::Cloud::Logging::V2::LogView]
|
@@ -948,6 +1150,21 @@ module Google
|
|
948
1150
|
#
|
949
1151
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
950
1152
|
#
|
1153
|
+
# @example Basic example
|
1154
|
+
# require "google/cloud/logging/v2"
|
1155
|
+
#
|
1156
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1157
|
+
# client = Google::Cloud::Logging::V2::ConfigService::Client.new
|
1158
|
+
#
|
1159
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1160
|
+
# request = Google::Cloud::Logging::V2::UpdateViewRequest.new
|
1161
|
+
#
|
1162
|
+
# # Call the update_view method.
|
1163
|
+
# result = client.update_view request
|
1164
|
+
#
|
1165
|
+
# # The returned object is of type Google::Cloud::Logging::V2::LogView.
|
1166
|
+
# p result
|
1167
|
+
#
|
951
1168
|
def update_view request, options = nil
|
952
1169
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
953
1170
|
|
@@ -965,16 +1182,20 @@ module Google
|
|
965
1182
|
gapic_version: ::Google::Cloud::Logging::V2::VERSION
|
966
1183
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
967
1184
|
|
968
|
-
header_params = {
|
969
|
-
|
970
|
-
|
1185
|
+
header_params = {}
|
1186
|
+
if request.name
|
1187
|
+
header_params["name"] = request.name
|
1188
|
+
end
|
1189
|
+
|
971
1190
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
972
1191
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
973
1192
|
|
974
1193
|
options.apply_defaults timeout: @config.rpcs.update_view.timeout,
|
975
1194
|
metadata: metadata,
|
976
1195
|
retry_policy: @config.rpcs.update_view.retry_policy
|
977
|
-
|
1196
|
+
|
1197
|
+
options.apply_defaults timeout: @config.timeout,
|
1198
|
+
metadata: @config.metadata,
|
978
1199
|
retry_policy: @config.retry_policy
|
979
1200
|
|
980
1201
|
@config_service_stub.call_rpc :update_view, request, options: options do |response, operation|
|
@@ -986,7 +1207,10 @@ module Google
|
|
986
1207
|
end
|
987
1208
|
|
988
1209
|
##
|
989
|
-
# Deletes a view
|
1210
|
+
# Deletes a view on a log bucket.
|
1211
|
+
# If an `UNAVAILABLE` error is returned, this indicates that system is not in
|
1212
|
+
# a state where it can delete the view. If this occurs, please try again in a
|
1213
|
+
# few minutes.
|
990
1214
|
#
|
991
1215
|
# @overload delete_view(request, options = nil)
|
992
1216
|
# Pass arguments to `delete_view` via a request object, either of type
|
@@ -1008,8 +1232,9 @@ module Google
|
|
1008
1232
|
#
|
1009
1233
|
# "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
|
1010
1234
|
#
|
1011
|
-
#
|
1012
|
-
#
|
1235
|
+
# For example:
|
1236
|
+
#
|
1237
|
+
# `"projects/my-project/locations/global/buckets/my-bucket/views/my-view"`
|
1013
1238
|
#
|
1014
1239
|
# @yield [response, operation] Access the result along with the RPC operation
|
1015
1240
|
# @yieldparam response [::Google::Protobuf::Empty]
|
@@ -1019,6 +1244,21 @@ module Google
|
|
1019
1244
|
#
|
1020
1245
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1021
1246
|
#
|
1247
|
+
# @example Basic example
|
1248
|
+
# require "google/cloud/logging/v2"
|
1249
|
+
#
|
1250
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1251
|
+
# client = Google::Cloud::Logging::V2::ConfigService::Client.new
|
1252
|
+
#
|
1253
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1254
|
+
# request = Google::Cloud::Logging::V2::DeleteViewRequest.new
|
1255
|
+
#
|
1256
|
+
# # Call the delete_view method.
|
1257
|
+
# result = client.delete_view request
|
1258
|
+
#
|
1259
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
1260
|
+
# p result
|
1261
|
+
#
|
1022
1262
|
def delete_view request, options = nil
|
1023
1263
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1024
1264
|
|
@@ -1036,16 +1276,20 @@ module Google
|
|
1036
1276
|
gapic_version: ::Google::Cloud::Logging::V2::VERSION
|
1037
1277
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1038
1278
|
|
1039
|
-
header_params = {
|
1040
|
-
|
1041
|
-
|
1279
|
+
header_params = {}
|
1280
|
+
if request.name
|
1281
|
+
header_params["name"] = request.name
|
1282
|
+
end
|
1283
|
+
|
1042
1284
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1043
1285
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
1044
1286
|
|
1045
1287
|
options.apply_defaults timeout: @config.rpcs.delete_view.timeout,
|
1046
1288
|
metadata: metadata,
|
1047
1289
|
retry_policy: @config.rpcs.delete_view.retry_policy
|
1048
|
-
|
1290
|
+
|
1291
|
+
options.apply_defaults timeout: @config.timeout,
|
1292
|
+
metadata: @config.metadata,
|
1049
1293
|
retry_policy: @config.retry_policy
|
1050
1294
|
|
1051
1295
|
@config_service_stub.call_rpc :delete_view, request, options: options do |response, operation|
|
@@ -1099,6 +1343,27 @@ module Google
|
|
1099
1343
|
#
|
1100
1344
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1101
1345
|
#
|
1346
|
+
# @example Basic example
|
1347
|
+
# require "google/cloud/logging/v2"
|
1348
|
+
#
|
1349
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1350
|
+
# client = Google::Cloud::Logging::V2::ConfigService::Client.new
|
1351
|
+
#
|
1352
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1353
|
+
# request = Google::Cloud::Logging::V2::ListSinksRequest.new
|
1354
|
+
#
|
1355
|
+
# # Call the list_sinks method.
|
1356
|
+
# result = client.list_sinks request
|
1357
|
+
#
|
1358
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
1359
|
+
# # iterate over all elements by calling #each, and the enumerable
|
1360
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
1361
|
+
# # methods are also available for managing paging directly.
|
1362
|
+
# result.each do |response|
|
1363
|
+
# # Each element is of type ::Google::Cloud::Logging::V2::LogSink.
|
1364
|
+
# p response
|
1365
|
+
# end
|
1366
|
+
#
|
1102
1367
|
def list_sinks request, options = nil
|
1103
1368
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1104
1369
|
|
@@ -1116,16 +1381,20 @@ module Google
|
|
1116
1381
|
gapic_version: ::Google::Cloud::Logging::V2::VERSION
|
1117
1382
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1118
1383
|
|
1119
|
-
header_params = {
|
1120
|
-
|
1121
|
-
|
1384
|
+
header_params = {}
|
1385
|
+
if request.parent
|
1386
|
+
header_params["parent"] = request.parent
|
1387
|
+
end
|
1388
|
+
|
1122
1389
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1123
1390
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
1124
1391
|
|
1125
1392
|
options.apply_defaults timeout: @config.rpcs.list_sinks.timeout,
|
1126
1393
|
metadata: metadata,
|
1127
1394
|
retry_policy: @config.rpcs.list_sinks.retry_policy
|
1128
|
-
|
1395
|
+
|
1396
|
+
options.apply_defaults timeout: @config.timeout,
|
1397
|
+
metadata: @config.metadata,
|
1129
1398
|
retry_policy: @config.retry_policy
|
1130
1399
|
|
1131
1400
|
@config_service_stub.call_rpc :list_sinks, request, options: options do |response, operation|
|
@@ -1163,7 +1432,9 @@ module Google
|
|
1163
1432
|
# "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
|
1164
1433
|
# "folders/[FOLDER_ID]/sinks/[SINK_ID]"
|
1165
1434
|
#
|
1166
|
-
#
|
1435
|
+
# For example:
|
1436
|
+
#
|
1437
|
+
# `"projects/my-project/sinks/my-sink"`
|
1167
1438
|
#
|
1168
1439
|
# @yield [response, operation] Access the result along with the RPC operation
|
1169
1440
|
# @yieldparam response [::Google::Cloud::Logging::V2::LogSink]
|
@@ -1173,6 +1444,21 @@ module Google
|
|
1173
1444
|
#
|
1174
1445
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1175
1446
|
#
|
1447
|
+
# @example Basic example
|
1448
|
+
# require "google/cloud/logging/v2"
|
1449
|
+
#
|
1450
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1451
|
+
# client = Google::Cloud::Logging::V2::ConfigService::Client.new
|
1452
|
+
#
|
1453
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1454
|
+
# request = Google::Cloud::Logging::V2::GetSinkRequest.new
|
1455
|
+
#
|
1456
|
+
# # Call the get_sink method.
|
1457
|
+
# result = client.get_sink request
|
1458
|
+
#
|
1459
|
+
# # The returned object is of type Google::Cloud::Logging::V2::LogSink.
|
1460
|
+
# p result
|
1461
|
+
#
|
1176
1462
|
def get_sink request, options = nil
|
1177
1463
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1178
1464
|
|
@@ -1190,16 +1476,20 @@ module Google
|
|
1190
1476
|
gapic_version: ::Google::Cloud::Logging::V2::VERSION
|
1191
1477
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1192
1478
|
|
1193
|
-
header_params = {
|
1194
|
-
|
1195
|
-
|
1479
|
+
header_params = {}
|
1480
|
+
if request.sink_name
|
1481
|
+
header_params["sink_name"] = request.sink_name
|
1482
|
+
end
|
1483
|
+
|
1196
1484
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1197
1485
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
1198
1486
|
|
1199
1487
|
options.apply_defaults timeout: @config.rpcs.get_sink.timeout,
|
1200
1488
|
metadata: metadata,
|
1201
1489
|
retry_policy: @config.rpcs.get_sink.retry_policy
|
1202
|
-
|
1490
|
+
|
1491
|
+
options.apply_defaults timeout: @config.timeout,
|
1492
|
+
metadata: @config.metadata,
|
1203
1493
|
retry_policy: @config.retry_policy
|
1204
1494
|
|
1205
1495
|
@config_service_stub.call_rpc :get_sink, request, options: options do |response, operation|
|
@@ -1239,7 +1529,10 @@ module Google
|
|
1239
1529
|
# "billingAccounts/[BILLING_ACCOUNT_ID]"
|
1240
1530
|
# "folders/[FOLDER_ID]"
|
1241
1531
|
#
|
1242
|
-
#
|
1532
|
+
# For examples:
|
1533
|
+
#
|
1534
|
+
# `"projects/my-project"`
|
1535
|
+
# `"organizations/123456789"`
|
1243
1536
|
# @param sink [::Google::Cloud::Logging::V2::LogSink, ::Hash]
|
1244
1537
|
# Required. The new sink, whose `name` parameter is a sink identifier that
|
1245
1538
|
# is not already in use.
|
@@ -1247,9 +1540,9 @@ module Google
|
|
1247
1540
|
# Optional. Determines the kind of IAM identity returned as `writer_identity`
|
1248
1541
|
# in the new sink. If this value is omitted or set to false, and if the
|
1249
1542
|
# sink's parent is a project, then the value returned as `writer_identity` is
|
1250
|
-
# the same group or service account used by Logging before the addition
|
1251
|
-
# writer identities to this API. The sink's destination must be in the
|
1252
|
-
# project as the sink itself.
|
1543
|
+
# the same group or service account used by Cloud Logging before the addition
|
1544
|
+
# of writer identities to this API. The sink's destination must be in the
|
1545
|
+
# same project as the sink itself.
|
1253
1546
|
#
|
1254
1547
|
# If this field is set to true, or if the sink is owned by a non-project
|
1255
1548
|
# resource such as an organization, then the value of `writer_identity` will
|
@@ -1264,6 +1557,21 @@ module Google
|
|
1264
1557
|
#
|
1265
1558
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1266
1559
|
#
|
1560
|
+
# @example Basic example
|
1561
|
+
# require "google/cloud/logging/v2"
|
1562
|
+
#
|
1563
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1564
|
+
# client = Google::Cloud::Logging::V2::ConfigService::Client.new
|
1565
|
+
#
|
1566
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1567
|
+
# request = Google::Cloud::Logging::V2::CreateSinkRequest.new
|
1568
|
+
#
|
1569
|
+
# # Call the create_sink method.
|
1570
|
+
# result = client.create_sink request
|
1571
|
+
#
|
1572
|
+
# # The returned object is of type Google::Cloud::Logging::V2::LogSink.
|
1573
|
+
# p result
|
1574
|
+
#
|
1267
1575
|
def create_sink request, options = nil
|
1268
1576
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1269
1577
|
|
@@ -1281,16 +1589,20 @@ module Google
|
|
1281
1589
|
gapic_version: ::Google::Cloud::Logging::V2::VERSION
|
1282
1590
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1283
1591
|
|
1284
|
-
header_params = {
|
1285
|
-
|
1286
|
-
|
1592
|
+
header_params = {}
|
1593
|
+
if request.parent
|
1594
|
+
header_params["parent"] = request.parent
|
1595
|
+
end
|
1596
|
+
|
1287
1597
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1288
1598
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
1289
1599
|
|
1290
1600
|
options.apply_defaults timeout: @config.rpcs.create_sink.timeout,
|
1291
1601
|
metadata: metadata,
|
1292
1602
|
retry_policy: @config.rpcs.create_sink.retry_policy
|
1293
|
-
|
1603
|
+
|
1604
|
+
options.apply_defaults timeout: @config.timeout,
|
1605
|
+
metadata: @config.metadata,
|
1294
1606
|
retry_policy: @config.retry_policy
|
1295
1607
|
|
1296
1608
|
@config_service_stub.call_rpc :create_sink, request, options: options do |response, operation|
|
@@ -1332,7 +1644,9 @@ module Google
|
|
1332
1644
|
# "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
|
1333
1645
|
# "folders/[FOLDER_ID]/sinks/[SINK_ID]"
|
1334
1646
|
#
|
1335
|
-
#
|
1647
|
+
# For example:
|
1648
|
+
#
|
1649
|
+
# `"projects/my-project/sinks/my-sink"`
|
1336
1650
|
# @param sink [::Google::Cloud::Logging::V2::LogSink, ::Hash]
|
1337
1651
|
# Required. The updated sink, whose name is the same identifier that appears as part
|
1338
1652
|
# of `sink_name`.
|
@@ -1353,16 +1667,18 @@ module Google
|
|
1353
1667
|
# an update. A sink field will be overwritten if, and only if, it is
|
1354
1668
|
# in the update mask. `name` and output only fields cannot be updated.
|
1355
1669
|
#
|
1356
|
-
# An empty updateMask is temporarily treated as using the following mask
|
1670
|
+
# An empty `updateMask` is temporarily treated as using the following mask
|
1357
1671
|
# for backwards compatibility purposes:
|
1358
|
-
#
|
1672
|
+
#
|
1673
|
+
# `destination,filter,includeChildren`
|
1674
|
+
#
|
1359
1675
|
# At some point in the future, behavior will be removed and specifying an
|
1360
|
-
# empty updateMask will be an error.
|
1676
|
+
# empty `updateMask` will be an error.
|
1361
1677
|
#
|
1362
1678
|
# For a detailed `FieldMask` definition, see
|
1363
1679
|
# https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
|
1364
1680
|
#
|
1365
|
-
#
|
1681
|
+
# For example: `updateMask=filter`
|
1366
1682
|
#
|
1367
1683
|
# @yield [response, operation] Access the result along with the RPC operation
|
1368
1684
|
# @yieldparam response [::Google::Cloud::Logging::V2::LogSink]
|
@@ -1372,6 +1688,21 @@ module Google
|
|
1372
1688
|
#
|
1373
1689
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1374
1690
|
#
|
1691
|
+
# @example Basic example
|
1692
|
+
# require "google/cloud/logging/v2"
|
1693
|
+
#
|
1694
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1695
|
+
# client = Google::Cloud::Logging::V2::ConfigService::Client.new
|
1696
|
+
#
|
1697
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1698
|
+
# request = Google::Cloud::Logging::V2::UpdateSinkRequest.new
|
1699
|
+
#
|
1700
|
+
# # Call the update_sink method.
|
1701
|
+
# result = client.update_sink request
|
1702
|
+
#
|
1703
|
+
# # The returned object is of type Google::Cloud::Logging::V2::LogSink.
|
1704
|
+
# p result
|
1705
|
+
#
|
1375
1706
|
def update_sink request, options = nil
|
1376
1707
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1377
1708
|
|
@@ -1389,16 +1720,20 @@ module Google
|
|
1389
1720
|
gapic_version: ::Google::Cloud::Logging::V2::VERSION
|
1390
1721
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1391
1722
|
|
1392
|
-
header_params = {
|
1393
|
-
|
1394
|
-
|
1723
|
+
header_params = {}
|
1724
|
+
if request.sink_name
|
1725
|
+
header_params["sink_name"] = request.sink_name
|
1726
|
+
end
|
1727
|
+
|
1395
1728
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1396
1729
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
1397
1730
|
|
1398
1731
|
options.apply_defaults timeout: @config.rpcs.update_sink.timeout,
|
1399
1732
|
metadata: metadata,
|
1400
1733
|
retry_policy: @config.rpcs.update_sink.retry_policy
|
1401
|
-
|
1734
|
+
|
1735
|
+
options.apply_defaults timeout: @config.timeout,
|
1736
|
+
metadata: @config.metadata,
|
1402
1737
|
retry_policy: @config.retry_policy
|
1403
1738
|
|
1404
1739
|
@config_service_stub.call_rpc :update_sink, request, options: options do |response, operation|
|
@@ -1437,7 +1772,9 @@ module Google
|
|
1437
1772
|
# "billingAccounts/[BILLING_ACCOUNT_ID]/sinks/[SINK_ID]"
|
1438
1773
|
# "folders/[FOLDER_ID]/sinks/[SINK_ID]"
|
1439
1774
|
#
|
1440
|
-
#
|
1775
|
+
# For example:
|
1776
|
+
#
|
1777
|
+
# `"projects/my-project/sinks/my-sink"`
|
1441
1778
|
#
|
1442
1779
|
# @yield [response, operation] Access the result along with the RPC operation
|
1443
1780
|
# @yieldparam response [::Google::Protobuf::Empty]
|
@@ -1447,6 +1784,21 @@ module Google
|
|
1447
1784
|
#
|
1448
1785
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1449
1786
|
#
|
1787
|
+
# @example Basic example
|
1788
|
+
# require "google/cloud/logging/v2"
|
1789
|
+
#
|
1790
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1791
|
+
# client = Google::Cloud::Logging::V2::ConfigService::Client.new
|
1792
|
+
#
|
1793
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1794
|
+
# request = Google::Cloud::Logging::V2::DeleteSinkRequest.new
|
1795
|
+
#
|
1796
|
+
# # Call the delete_sink method.
|
1797
|
+
# result = client.delete_sink request
|
1798
|
+
#
|
1799
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
1800
|
+
# p result
|
1801
|
+
#
|
1450
1802
|
def delete_sink request, options = nil
|
1451
1803
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1452
1804
|
|
@@ -1464,16 +1816,20 @@ module Google
|
|
1464
1816
|
gapic_version: ::Google::Cloud::Logging::V2::VERSION
|
1465
1817
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1466
1818
|
|
1467
|
-
header_params = {
|
1468
|
-
|
1469
|
-
|
1819
|
+
header_params = {}
|
1820
|
+
if request.sink_name
|
1821
|
+
header_params["sink_name"] = request.sink_name
|
1822
|
+
end
|
1823
|
+
|
1470
1824
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1471
1825
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
1472
1826
|
|
1473
1827
|
options.apply_defaults timeout: @config.rpcs.delete_sink.timeout,
|
1474
1828
|
metadata: metadata,
|
1475
1829
|
retry_policy: @config.rpcs.delete_sink.retry_policy
|
1476
|
-
|
1830
|
+
|
1831
|
+
options.apply_defaults timeout: @config.timeout,
|
1832
|
+
metadata: @config.metadata,
|
1477
1833
|
retry_policy: @config.retry_policy
|
1478
1834
|
|
1479
1835
|
@config_service_stub.call_rpc :delete_sink, request, options: options do |response, operation|
|
@@ -1485,7 +1841,7 @@ module Google
|
|
1485
1841
|
end
|
1486
1842
|
|
1487
1843
|
##
|
1488
|
-
# Lists all the exclusions in a parent resource.
|
1844
|
+
# Lists all the exclusions on the _Default sink in a parent resource.
|
1489
1845
|
#
|
1490
1846
|
# @overload list_exclusions(request, options = nil)
|
1491
1847
|
# Pass arguments to `list_exclusions` via a request object, either of type
|
@@ -1527,6 +1883,27 @@ module Google
|
|
1527
1883
|
#
|
1528
1884
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1529
1885
|
#
|
1886
|
+
# @example Basic example
|
1887
|
+
# require "google/cloud/logging/v2"
|
1888
|
+
#
|
1889
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1890
|
+
# client = Google::Cloud::Logging::V2::ConfigService::Client.new
|
1891
|
+
#
|
1892
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1893
|
+
# request = Google::Cloud::Logging::V2::ListExclusionsRequest.new
|
1894
|
+
#
|
1895
|
+
# # Call the list_exclusions method.
|
1896
|
+
# result = client.list_exclusions request
|
1897
|
+
#
|
1898
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can
|
1899
|
+
# # iterate over all elements by calling #each, and the enumerable
|
1900
|
+
# # will lazily make API calls to fetch subsequent pages. Other
|
1901
|
+
# # methods are also available for managing paging directly.
|
1902
|
+
# result.each do |response|
|
1903
|
+
# # Each element is of type ::Google::Cloud::Logging::V2::LogExclusion.
|
1904
|
+
# p response
|
1905
|
+
# end
|
1906
|
+
#
|
1530
1907
|
def list_exclusions request, options = nil
|
1531
1908
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1532
1909
|
|
@@ -1544,16 +1921,20 @@ module Google
|
|
1544
1921
|
gapic_version: ::Google::Cloud::Logging::V2::VERSION
|
1545
1922
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1546
1923
|
|
1547
|
-
header_params = {
|
1548
|
-
|
1549
|
-
|
1924
|
+
header_params = {}
|
1925
|
+
if request.parent
|
1926
|
+
header_params["parent"] = request.parent
|
1927
|
+
end
|
1928
|
+
|
1550
1929
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1551
1930
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
1552
1931
|
|
1553
1932
|
options.apply_defaults timeout: @config.rpcs.list_exclusions.timeout,
|
1554
1933
|
metadata: metadata,
|
1555
1934
|
retry_policy: @config.rpcs.list_exclusions.retry_policy
|
1556
|
-
|
1935
|
+
|
1936
|
+
options.apply_defaults timeout: @config.timeout,
|
1937
|
+
metadata: @config.metadata,
|
1557
1938
|
retry_policy: @config.retry_policy
|
1558
1939
|
|
1559
1940
|
@config_service_stub.call_rpc :list_exclusions, request, options: options do |response, operation|
|
@@ -1566,7 +1947,7 @@ module Google
|
|
1566
1947
|
end
|
1567
1948
|
|
1568
1949
|
##
|
1569
|
-
# Gets the description of an exclusion.
|
1950
|
+
# Gets the description of an exclusion in the _Default sink.
|
1570
1951
|
#
|
1571
1952
|
# @overload get_exclusion(request, options = nil)
|
1572
1953
|
# Pass arguments to `get_exclusion` via a request object, either of type
|
@@ -1591,7 +1972,9 @@ module Google
|
|
1591
1972
|
# "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
|
1592
1973
|
# "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
|
1593
1974
|
#
|
1594
|
-
#
|
1975
|
+
# For example:
|
1976
|
+
#
|
1977
|
+
# `"projects/my-project/exclusions/my-exclusion"`
|
1595
1978
|
#
|
1596
1979
|
# @yield [response, operation] Access the result along with the RPC operation
|
1597
1980
|
# @yieldparam response [::Google::Cloud::Logging::V2::LogExclusion]
|
@@ -1601,6 +1984,21 @@ module Google
|
|
1601
1984
|
#
|
1602
1985
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1603
1986
|
#
|
1987
|
+
# @example Basic example
|
1988
|
+
# require "google/cloud/logging/v2"
|
1989
|
+
#
|
1990
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1991
|
+
# client = Google::Cloud::Logging::V2::ConfigService::Client.new
|
1992
|
+
#
|
1993
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1994
|
+
# request = Google::Cloud::Logging::V2::GetExclusionRequest.new
|
1995
|
+
#
|
1996
|
+
# # Call the get_exclusion method.
|
1997
|
+
# result = client.get_exclusion request
|
1998
|
+
#
|
1999
|
+
# # The returned object is of type Google::Cloud::Logging::V2::LogExclusion.
|
2000
|
+
# p result
|
2001
|
+
#
|
1604
2002
|
def get_exclusion request, options = nil
|
1605
2003
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1606
2004
|
|
@@ -1618,16 +2016,20 @@ module Google
|
|
1618
2016
|
gapic_version: ::Google::Cloud::Logging::V2::VERSION
|
1619
2017
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1620
2018
|
|
1621
|
-
header_params = {
|
1622
|
-
|
1623
|
-
|
2019
|
+
header_params = {}
|
2020
|
+
if request.name
|
2021
|
+
header_params["name"] = request.name
|
2022
|
+
end
|
2023
|
+
|
1624
2024
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1625
2025
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
1626
2026
|
|
1627
2027
|
options.apply_defaults timeout: @config.rpcs.get_exclusion.timeout,
|
1628
2028
|
metadata: metadata,
|
1629
2029
|
retry_policy: @config.rpcs.get_exclusion.retry_policy
|
1630
|
-
|
2030
|
+
|
2031
|
+
options.apply_defaults timeout: @config.timeout,
|
2032
|
+
metadata: @config.metadata,
|
1631
2033
|
retry_policy: @config.retry_policy
|
1632
2034
|
|
1633
2035
|
@config_service_stub.call_rpc :get_exclusion, request, options: options do |response, operation|
|
@@ -1639,9 +2041,9 @@ module Google
|
|
1639
2041
|
end
|
1640
2042
|
|
1641
2043
|
##
|
1642
|
-
# Creates a new exclusion in a specified parent
|
1643
|
-
# Only log entries belonging to that resource can be excluded.
|
1644
|
-
#
|
2044
|
+
# Creates a new exclusion in the _Default sink in a specified parent
|
2045
|
+
# resource. Only log entries belonging to that resource can be excluded. You
|
2046
|
+
# can have up to 10 exclusions in a resource.
|
1645
2047
|
#
|
1646
2048
|
# @overload create_exclusion(request, options = nil)
|
1647
2049
|
# Pass arguments to `create_exclusion` via a request object, either of type
|
@@ -1666,7 +2068,10 @@ module Google
|
|
1666
2068
|
# "billingAccounts/[BILLING_ACCOUNT_ID]"
|
1667
2069
|
# "folders/[FOLDER_ID]"
|
1668
2070
|
#
|
1669
|
-
#
|
2071
|
+
# For examples:
|
2072
|
+
#
|
2073
|
+
# `"projects/my-logging-project"`
|
2074
|
+
# `"organizations/123456789"`
|
1670
2075
|
# @param exclusion [::Google::Cloud::Logging::V2::LogExclusion, ::Hash]
|
1671
2076
|
# Required. The new exclusion, whose `name` parameter is an exclusion name
|
1672
2077
|
# that is not already used in the parent resource.
|
@@ -1679,6 +2084,21 @@ module Google
|
|
1679
2084
|
#
|
1680
2085
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1681
2086
|
#
|
2087
|
+
# @example Basic example
|
2088
|
+
# require "google/cloud/logging/v2"
|
2089
|
+
#
|
2090
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2091
|
+
# client = Google::Cloud::Logging::V2::ConfigService::Client.new
|
2092
|
+
#
|
2093
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2094
|
+
# request = Google::Cloud::Logging::V2::CreateExclusionRequest.new
|
2095
|
+
#
|
2096
|
+
# # Call the create_exclusion method.
|
2097
|
+
# result = client.create_exclusion request
|
2098
|
+
#
|
2099
|
+
# # The returned object is of type Google::Cloud::Logging::V2::LogExclusion.
|
2100
|
+
# p result
|
2101
|
+
#
|
1682
2102
|
def create_exclusion request, options = nil
|
1683
2103
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1684
2104
|
|
@@ -1696,16 +2116,20 @@ module Google
|
|
1696
2116
|
gapic_version: ::Google::Cloud::Logging::V2::VERSION
|
1697
2117
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1698
2118
|
|
1699
|
-
header_params = {
|
1700
|
-
|
1701
|
-
|
2119
|
+
header_params = {}
|
2120
|
+
if request.parent
|
2121
|
+
header_params["parent"] = request.parent
|
2122
|
+
end
|
2123
|
+
|
1702
2124
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1703
2125
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
1704
2126
|
|
1705
2127
|
options.apply_defaults timeout: @config.rpcs.create_exclusion.timeout,
|
1706
2128
|
metadata: metadata,
|
1707
2129
|
retry_policy: @config.rpcs.create_exclusion.retry_policy
|
1708
|
-
|
2130
|
+
|
2131
|
+
options.apply_defaults timeout: @config.timeout,
|
2132
|
+
metadata: @config.metadata,
|
1709
2133
|
retry_policy: @config.retry_policy
|
1710
2134
|
|
1711
2135
|
@config_service_stub.call_rpc :create_exclusion, request, options: options do |response, operation|
|
@@ -1717,7 +2141,8 @@ module Google
|
|
1717
2141
|
end
|
1718
2142
|
|
1719
2143
|
##
|
1720
|
-
# Changes one or more properties of an existing exclusion
|
2144
|
+
# Changes one or more properties of an existing exclusion in the _Default
|
2145
|
+
# sink.
|
1721
2146
|
#
|
1722
2147
|
# @overload update_exclusion(request, options = nil)
|
1723
2148
|
# Pass arguments to `update_exclusion` via a request object, either of type
|
@@ -1742,7 +2167,9 @@ module Google
|
|
1742
2167
|
# "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
|
1743
2168
|
# "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
|
1744
2169
|
#
|
1745
|
-
#
|
2170
|
+
# For example:
|
2171
|
+
#
|
2172
|
+
# `"projects/my-project/exclusions/my-exclusion"`
|
1746
2173
|
# @param exclusion [::Google::Cloud::Logging::V2::LogExclusion, ::Hash]
|
1747
2174
|
# Required. New values for the existing exclusion. Only the fields specified in
|
1748
2175
|
# `update_mask` are relevant.
|
@@ -1763,6 +2190,21 @@ module Google
|
|
1763
2190
|
#
|
1764
2191
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1765
2192
|
#
|
2193
|
+
# @example Basic example
|
2194
|
+
# require "google/cloud/logging/v2"
|
2195
|
+
#
|
2196
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2197
|
+
# client = Google::Cloud::Logging::V2::ConfigService::Client.new
|
2198
|
+
#
|
2199
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2200
|
+
# request = Google::Cloud::Logging::V2::UpdateExclusionRequest.new
|
2201
|
+
#
|
2202
|
+
# # Call the update_exclusion method.
|
2203
|
+
# result = client.update_exclusion request
|
2204
|
+
#
|
2205
|
+
# # The returned object is of type Google::Cloud::Logging::V2::LogExclusion.
|
2206
|
+
# p result
|
2207
|
+
#
|
1766
2208
|
def update_exclusion request, options = nil
|
1767
2209
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1768
2210
|
|
@@ -1780,16 +2222,20 @@ module Google
|
|
1780
2222
|
gapic_version: ::Google::Cloud::Logging::V2::VERSION
|
1781
2223
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1782
2224
|
|
1783
|
-
header_params = {
|
1784
|
-
|
1785
|
-
|
2225
|
+
header_params = {}
|
2226
|
+
if request.name
|
2227
|
+
header_params["name"] = request.name
|
2228
|
+
end
|
2229
|
+
|
1786
2230
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1787
2231
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
1788
2232
|
|
1789
2233
|
options.apply_defaults timeout: @config.rpcs.update_exclusion.timeout,
|
1790
2234
|
metadata: metadata,
|
1791
2235
|
retry_policy: @config.rpcs.update_exclusion.retry_policy
|
1792
|
-
|
2236
|
+
|
2237
|
+
options.apply_defaults timeout: @config.timeout,
|
2238
|
+
metadata: @config.metadata,
|
1793
2239
|
retry_policy: @config.retry_policy
|
1794
2240
|
|
1795
2241
|
@config_service_stub.call_rpc :update_exclusion, request, options: options do |response, operation|
|
@@ -1801,7 +2247,7 @@ module Google
|
|
1801
2247
|
end
|
1802
2248
|
|
1803
2249
|
##
|
1804
|
-
# Deletes an exclusion.
|
2250
|
+
# Deletes an exclusion in the _Default sink.
|
1805
2251
|
#
|
1806
2252
|
# @overload delete_exclusion(request, options = nil)
|
1807
2253
|
# Pass arguments to `delete_exclusion` via a request object, either of type
|
@@ -1826,7 +2272,9 @@ module Google
|
|
1826
2272
|
# "billingAccounts/[BILLING_ACCOUNT_ID]/exclusions/[EXCLUSION_ID]"
|
1827
2273
|
# "folders/[FOLDER_ID]/exclusions/[EXCLUSION_ID]"
|
1828
2274
|
#
|
1829
|
-
#
|
2275
|
+
# For example:
|
2276
|
+
#
|
2277
|
+
# `"projects/my-project/exclusions/my-exclusion"`
|
1830
2278
|
#
|
1831
2279
|
# @yield [response, operation] Access the result along with the RPC operation
|
1832
2280
|
# @yieldparam response [::Google::Protobuf::Empty]
|
@@ -1836,6 +2284,21 @@ module Google
|
|
1836
2284
|
#
|
1837
2285
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1838
2286
|
#
|
2287
|
+
# @example Basic example
|
2288
|
+
# require "google/cloud/logging/v2"
|
2289
|
+
#
|
2290
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2291
|
+
# client = Google::Cloud::Logging::V2::ConfigService::Client.new
|
2292
|
+
#
|
2293
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2294
|
+
# request = Google::Cloud::Logging::V2::DeleteExclusionRequest.new
|
2295
|
+
#
|
2296
|
+
# # Call the delete_exclusion method.
|
2297
|
+
# result = client.delete_exclusion request
|
2298
|
+
#
|
2299
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
2300
|
+
# p result
|
2301
|
+
#
|
1839
2302
|
def delete_exclusion request, options = nil
|
1840
2303
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1841
2304
|
|
@@ -1853,16 +2316,20 @@ module Google
|
|
1853
2316
|
gapic_version: ::Google::Cloud::Logging::V2::VERSION
|
1854
2317
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1855
2318
|
|
1856
|
-
header_params = {
|
1857
|
-
|
1858
|
-
|
2319
|
+
header_params = {}
|
2320
|
+
if request.name
|
2321
|
+
header_params["name"] = request.name
|
2322
|
+
end
|
2323
|
+
|
1859
2324
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1860
2325
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
1861
2326
|
|
1862
2327
|
options.apply_defaults timeout: @config.rpcs.delete_exclusion.timeout,
|
1863
2328
|
metadata: metadata,
|
1864
2329
|
retry_policy: @config.rpcs.delete_exclusion.retry_policy
|
1865
|
-
|
2330
|
+
|
2331
|
+
options.apply_defaults timeout: @config.timeout,
|
2332
|
+
metadata: @config.metadata,
|
1866
2333
|
retry_policy: @config.retry_policy
|
1867
2334
|
|
1868
2335
|
@config_service_stub.call_rpc :delete_exclusion, request, options: options do |response, operation|
|
@@ -1874,13 +2341,14 @@ module Google
|
|
1874
2341
|
end
|
1875
2342
|
|
1876
2343
|
##
|
1877
|
-
# Gets the
|
2344
|
+
# Gets the Logging CMEK settings for the given resource.
|
1878
2345
|
#
|
1879
|
-
# Note: CMEK for the
|
1880
|
-
#
|
1881
|
-
# the
|
2346
|
+
# Note: CMEK for the Log Router can be configured for Google Cloud projects,
|
2347
|
+
# folders, organizations and billing accounts. Once configured for an
|
2348
|
+
# organization, it applies to all projects and folders in the Google Cloud
|
2349
|
+
# organization.
|
1882
2350
|
#
|
1883
|
-
# See [Enabling CMEK for
|
2351
|
+
# See [Enabling CMEK for Log
|
1884
2352
|
# Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
|
1885
2353
|
# for more information.
|
1886
2354
|
#
|
@@ -1907,11 +2375,14 @@ module Google
|
|
1907
2375
|
# "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"
|
1908
2376
|
# "folders/[FOLDER_ID]/cmekSettings"
|
1909
2377
|
#
|
1910
|
-
#
|
2378
|
+
# For example:
|
1911
2379
|
#
|
1912
|
-
#
|
1913
|
-
#
|
1914
|
-
# the
|
2380
|
+
# `"organizations/12345/cmekSettings"`
|
2381
|
+
#
|
2382
|
+
# Note: CMEK for the Log Router can be configured for Google Cloud projects,
|
2383
|
+
# folders, organizations and billing accounts. Once configured for an
|
2384
|
+
# organization, it applies to all projects and folders in the Google Cloud
|
2385
|
+
# organization.
|
1915
2386
|
#
|
1916
2387
|
# @yield [response, operation] Access the result along with the RPC operation
|
1917
2388
|
# @yieldparam response [::Google::Cloud::Logging::V2::CmekSettings]
|
@@ -1921,6 +2392,21 @@ module Google
|
|
1921
2392
|
#
|
1922
2393
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1923
2394
|
#
|
2395
|
+
# @example Basic example
|
2396
|
+
# require "google/cloud/logging/v2"
|
2397
|
+
#
|
2398
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2399
|
+
# client = Google::Cloud::Logging::V2::ConfigService::Client.new
|
2400
|
+
#
|
2401
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2402
|
+
# request = Google::Cloud::Logging::V2::GetCmekSettingsRequest.new
|
2403
|
+
#
|
2404
|
+
# # Call the get_cmek_settings method.
|
2405
|
+
# result = client.get_cmek_settings request
|
2406
|
+
#
|
2407
|
+
# # The returned object is of type Google::Cloud::Logging::V2::CmekSettings.
|
2408
|
+
# p result
|
2409
|
+
#
|
1924
2410
|
def get_cmek_settings request, options = nil
|
1925
2411
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
1926
2412
|
|
@@ -1938,16 +2424,20 @@ module Google
|
|
1938
2424
|
gapic_version: ::Google::Cloud::Logging::V2::VERSION
|
1939
2425
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1940
2426
|
|
1941
|
-
header_params = {
|
1942
|
-
|
1943
|
-
|
2427
|
+
header_params = {}
|
2428
|
+
if request.name
|
2429
|
+
header_params["name"] = request.name
|
2430
|
+
end
|
2431
|
+
|
1944
2432
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1945
2433
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
1946
2434
|
|
1947
2435
|
options.apply_defaults timeout: @config.rpcs.get_cmek_settings.timeout,
|
1948
2436
|
metadata: metadata,
|
1949
2437
|
retry_policy: @config.rpcs.get_cmek_settings.retry_policy
|
1950
|
-
|
2438
|
+
|
2439
|
+
options.apply_defaults timeout: @config.timeout,
|
2440
|
+
metadata: @config.metadata,
|
1951
2441
|
retry_policy: @config.retry_policy
|
1952
2442
|
|
1953
2443
|
@config_service_stub.call_rpc :get_cmek_settings, request, options: options do |response, operation|
|
@@ -1959,11 +2449,11 @@ module Google
|
|
1959
2449
|
end
|
1960
2450
|
|
1961
2451
|
##
|
1962
|
-
# Updates the
|
2452
|
+
# Updates the Log Router CMEK settings for the given resource.
|
1963
2453
|
#
|
1964
|
-
# Note: CMEK for the
|
1965
|
-
# organizations. Once configured, it applies to all projects and
|
1966
|
-
# the
|
2454
|
+
# Note: CMEK for the Log Router can currently only be configured for Google
|
2455
|
+
# Cloud organizations. Once configured, it applies to all projects and
|
2456
|
+
# folders in the Google Cloud organization.
|
1967
2457
|
#
|
1968
2458
|
# {::Google::Cloud::Logging::V2::ConfigServiceV2::Client#update_cmek_settings UpdateCmekSettings}
|
1969
2459
|
# will fail if 1) `kms_key_name` is invalid, or 2) the associated service
|
@@ -1971,7 +2461,7 @@ module Google
|
|
1971
2461
|
# `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or
|
1972
2462
|
# 3) access to the key is disabled.
|
1973
2463
|
#
|
1974
|
-
# See [Enabling CMEK for
|
2464
|
+
# See [Enabling CMEK for Log
|
1975
2465
|
# Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
|
1976
2466
|
# for more information.
|
1977
2467
|
#
|
@@ -1998,15 +2488,17 @@ module Google
|
|
1998
2488
|
# "billingAccounts/[BILLING_ACCOUNT_ID]/cmekSettings"
|
1999
2489
|
# "folders/[FOLDER_ID]/cmekSettings"
|
2000
2490
|
#
|
2001
|
-
#
|
2491
|
+
# For example:
|
2492
|
+
#
|
2493
|
+
# `"organizations/12345/cmekSettings"`
|
2002
2494
|
#
|
2003
|
-
# Note: CMEK for the
|
2004
|
-
# organizations. Once configured, it applies to all projects and
|
2005
|
-
# the
|
2495
|
+
# Note: CMEK for the Log Router can currently only be configured for Google
|
2496
|
+
# Cloud organizations. Once configured, it applies to all projects and
|
2497
|
+
# folders in the Google Cloud organization.
|
2006
2498
|
# @param cmek_settings [::Google::Cloud::Logging::V2::CmekSettings, ::Hash]
|
2007
2499
|
# Required. The CMEK settings to update.
|
2008
2500
|
#
|
2009
|
-
# See [Enabling CMEK for
|
2501
|
+
# See [Enabling CMEK for Log
|
2010
2502
|
# Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
|
2011
2503
|
# for more information.
|
2012
2504
|
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
@@ -2016,7 +2508,7 @@ module Google
|
|
2016
2508
|
#
|
2017
2509
|
# See {::Google::Protobuf::FieldMask FieldMask} for more information.
|
2018
2510
|
#
|
2019
|
-
#
|
2511
|
+
# For example: `"updateMask=kmsKeyName"`
|
2020
2512
|
#
|
2021
2513
|
# @yield [response, operation] Access the result along with the RPC operation
|
2022
2514
|
# @yieldparam response [::Google::Cloud::Logging::V2::CmekSettings]
|
@@ -2026,6 +2518,21 @@ module Google
|
|
2026
2518
|
#
|
2027
2519
|
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2028
2520
|
#
|
2521
|
+
# @example Basic example
|
2522
|
+
# require "google/cloud/logging/v2"
|
2523
|
+
#
|
2524
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2525
|
+
# client = Google::Cloud::Logging::V2::ConfigService::Client.new
|
2526
|
+
#
|
2527
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2528
|
+
# request = Google::Cloud::Logging::V2::UpdateCmekSettingsRequest.new
|
2529
|
+
#
|
2530
|
+
# # Call the update_cmek_settings method.
|
2531
|
+
# result = client.update_cmek_settings request
|
2532
|
+
#
|
2533
|
+
# # The returned object is of type Google::Cloud::Logging::V2::CmekSettings.
|
2534
|
+
# p result
|
2535
|
+
#
|
2029
2536
|
def update_cmek_settings request, options = nil
|
2030
2537
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
2031
2538
|
|
@@ -2043,16 +2550,20 @@ module Google
|
|
2043
2550
|
gapic_version: ::Google::Cloud::Logging::V2::VERSION
|
2044
2551
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2045
2552
|
|
2046
|
-
header_params = {
|
2047
|
-
|
2048
|
-
|
2553
|
+
header_params = {}
|
2554
|
+
if request.name
|
2555
|
+
header_params["name"] = request.name
|
2556
|
+
end
|
2557
|
+
|
2049
2558
|
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2050
2559
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
2051
2560
|
|
2052
2561
|
options.apply_defaults timeout: @config.rpcs.update_cmek_settings.timeout,
|
2053
2562
|
metadata: metadata,
|
2054
2563
|
retry_policy: @config.rpcs.update_cmek_settings.retry_policy
|
2055
|
-
|
2564
|
+
|
2565
|
+
options.apply_defaults timeout: @config.timeout,
|
2566
|
+
metadata: @config.metadata,
|
2056
2567
|
retry_policy: @config.retry_policy
|
2057
2568
|
|
2058
2569
|
@config_service_stub.call_rpc :update_cmek_settings, request, options: options do |response, operation|
|
@@ -2063,6 +2574,332 @@ module Google
|
|
2063
2574
|
raise ::Google::Cloud::Error.from_error(e)
|
2064
2575
|
end
|
2065
2576
|
|
2577
|
+
##
|
2578
|
+
# Gets the Log Router settings for the given resource.
|
2579
|
+
#
|
2580
|
+
# Note: Settings for the Log Router can be get for Google Cloud projects,
|
2581
|
+
# folders, organizations and billing accounts. Currently it can only be
|
2582
|
+
# configured for organizations. Once configured for an organization, it
|
2583
|
+
# applies to all projects and folders in the Google Cloud organization.
|
2584
|
+
#
|
2585
|
+
# See [Enabling CMEK for Log
|
2586
|
+
# Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
|
2587
|
+
# for more information.
|
2588
|
+
#
|
2589
|
+
# @overload get_settings(request, options = nil)
|
2590
|
+
# Pass arguments to `get_settings` via a request object, either of type
|
2591
|
+
# {::Google::Cloud::Logging::V2::GetSettingsRequest} or an equivalent Hash.
|
2592
|
+
#
|
2593
|
+
# @param request [::Google::Cloud::Logging::V2::GetSettingsRequest, ::Hash]
|
2594
|
+
# A request object representing the call parameters. Required. To specify no
|
2595
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2596
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2597
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2598
|
+
#
|
2599
|
+
# @overload get_settings(name: nil)
|
2600
|
+
# Pass arguments to `get_settings` via keyword arguments. Note that at
|
2601
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2602
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2603
|
+
#
|
2604
|
+
# @param name [::String]
|
2605
|
+
# Required. The resource for which to retrieve settings.
|
2606
|
+
#
|
2607
|
+
# "projects/[PROJECT_ID]/settings"
|
2608
|
+
# "organizations/[ORGANIZATION_ID]/settings"
|
2609
|
+
# "billingAccounts/[BILLING_ACCOUNT_ID]/settings"
|
2610
|
+
# "folders/[FOLDER_ID]/settings"
|
2611
|
+
#
|
2612
|
+
# For example:
|
2613
|
+
#
|
2614
|
+
# `"organizations/12345/settings"`
|
2615
|
+
#
|
2616
|
+
# Note: Settings for the Log Router can be get for Google Cloud projects,
|
2617
|
+
# folders, organizations and billing accounts. Currently it can only be
|
2618
|
+
# configured for organizations. Once configured for an organization, it
|
2619
|
+
# applies to all projects and folders in the Google Cloud organization.
|
2620
|
+
#
|
2621
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2622
|
+
# @yieldparam response [::Google::Cloud::Logging::V2::Settings]
|
2623
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2624
|
+
#
|
2625
|
+
# @return [::Google::Cloud::Logging::V2::Settings]
|
2626
|
+
#
|
2627
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2628
|
+
#
|
2629
|
+
# @example Basic example
|
2630
|
+
# require "google/cloud/logging/v2"
|
2631
|
+
#
|
2632
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2633
|
+
# client = Google::Cloud::Logging::V2::ConfigService::Client.new
|
2634
|
+
#
|
2635
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2636
|
+
# request = Google::Cloud::Logging::V2::GetSettingsRequest.new
|
2637
|
+
#
|
2638
|
+
# # Call the get_settings method.
|
2639
|
+
# result = client.get_settings request
|
2640
|
+
#
|
2641
|
+
# # The returned object is of type Google::Cloud::Logging::V2::Settings.
|
2642
|
+
# p result
|
2643
|
+
#
|
2644
|
+
def get_settings request, options = nil
|
2645
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2646
|
+
|
2647
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::GetSettingsRequest
|
2648
|
+
|
2649
|
+
# Converts hash and nil to an options object
|
2650
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2651
|
+
|
2652
|
+
# Customize the options with defaults
|
2653
|
+
metadata = @config.rpcs.get_settings.metadata.to_h
|
2654
|
+
|
2655
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2656
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2657
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2658
|
+
gapic_version: ::Google::Cloud::Logging::V2::VERSION
|
2659
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2660
|
+
|
2661
|
+
header_params = {}
|
2662
|
+
if request.name
|
2663
|
+
header_params["name"] = request.name
|
2664
|
+
end
|
2665
|
+
|
2666
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2667
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2668
|
+
|
2669
|
+
options.apply_defaults timeout: @config.rpcs.get_settings.timeout,
|
2670
|
+
metadata: metadata,
|
2671
|
+
retry_policy: @config.rpcs.get_settings.retry_policy
|
2672
|
+
|
2673
|
+
options.apply_defaults timeout: @config.timeout,
|
2674
|
+
metadata: @config.metadata,
|
2675
|
+
retry_policy: @config.retry_policy
|
2676
|
+
|
2677
|
+
@config_service_stub.call_rpc :get_settings, request, options: options do |response, operation|
|
2678
|
+
yield response, operation if block_given?
|
2679
|
+
return response
|
2680
|
+
end
|
2681
|
+
rescue ::GRPC::BadStatus => e
|
2682
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2683
|
+
end
|
2684
|
+
|
2685
|
+
##
|
2686
|
+
# Updates the Log Router settings for the given resource.
|
2687
|
+
#
|
2688
|
+
# Note: Settings for the Log Router can currently only be configured for
|
2689
|
+
# Google Cloud organizations. Once configured, it applies to all projects and
|
2690
|
+
# folders in the Google Cloud organization.
|
2691
|
+
#
|
2692
|
+
# {::Google::Cloud::Logging::V2::ConfigServiceV2::Client#update_settings UpdateSettings}
|
2693
|
+
# will fail if 1) `kms_key_name` is invalid, or 2) the associated service
|
2694
|
+
# account does not have the required
|
2695
|
+
# `roles/cloudkms.cryptoKeyEncrypterDecrypter` role assigned for the key, or
|
2696
|
+
# 3) access to the key is disabled. 4) `location_id` is not supported by
|
2697
|
+
# Logging. 5) `location_id` violate OrgPolicy.
|
2698
|
+
#
|
2699
|
+
# See [Enabling CMEK for Log
|
2700
|
+
# Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
|
2701
|
+
# for more information.
|
2702
|
+
#
|
2703
|
+
# @overload update_settings(request, options = nil)
|
2704
|
+
# Pass arguments to `update_settings` via a request object, either of type
|
2705
|
+
# {::Google::Cloud::Logging::V2::UpdateSettingsRequest} or an equivalent Hash.
|
2706
|
+
#
|
2707
|
+
# @param request [::Google::Cloud::Logging::V2::UpdateSettingsRequest, ::Hash]
|
2708
|
+
# A request object representing the call parameters. Required. To specify no
|
2709
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2710
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2711
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2712
|
+
#
|
2713
|
+
# @overload update_settings(name: nil, settings: nil, update_mask: nil)
|
2714
|
+
# Pass arguments to `update_settings` via keyword arguments. Note that at
|
2715
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2716
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2717
|
+
#
|
2718
|
+
# @param name [::String]
|
2719
|
+
# Required. The resource name for the settings to update.
|
2720
|
+
#
|
2721
|
+
# "organizations/[ORGANIZATION_ID]/settings"
|
2722
|
+
#
|
2723
|
+
# For example:
|
2724
|
+
#
|
2725
|
+
# `"organizations/12345/settings"`
|
2726
|
+
#
|
2727
|
+
# Note: Settings for the Log Router can currently only be configured for
|
2728
|
+
# Google Cloud organizations. Once configured, it applies to all projects and
|
2729
|
+
# folders in the Google Cloud organization.
|
2730
|
+
# @param settings [::Google::Cloud::Logging::V2::Settings, ::Hash]
|
2731
|
+
# Required. The settings to update.
|
2732
|
+
#
|
2733
|
+
# See [Enabling CMEK for Log
|
2734
|
+
# Router](https://cloud.google.com/logging/docs/routing/managed-encryption)
|
2735
|
+
# for more information.
|
2736
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
2737
|
+
# Optional. Field mask identifying which fields from `settings` should
|
2738
|
+
# be updated. A field will be overwritten if and only if it is in the update
|
2739
|
+
# mask. Output only fields cannot be updated.
|
2740
|
+
#
|
2741
|
+
# See {::Google::Protobuf::FieldMask FieldMask} for more information.
|
2742
|
+
#
|
2743
|
+
# For example: `"updateMask=kmsKeyName"`
|
2744
|
+
#
|
2745
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2746
|
+
# @yieldparam response [::Google::Cloud::Logging::V2::Settings]
|
2747
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2748
|
+
#
|
2749
|
+
# @return [::Google::Cloud::Logging::V2::Settings]
|
2750
|
+
#
|
2751
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2752
|
+
#
|
2753
|
+
# @example Basic example
|
2754
|
+
# require "google/cloud/logging/v2"
|
2755
|
+
#
|
2756
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2757
|
+
# client = Google::Cloud::Logging::V2::ConfigService::Client.new
|
2758
|
+
#
|
2759
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2760
|
+
# request = Google::Cloud::Logging::V2::UpdateSettingsRequest.new
|
2761
|
+
#
|
2762
|
+
# # Call the update_settings method.
|
2763
|
+
# result = client.update_settings request
|
2764
|
+
#
|
2765
|
+
# # The returned object is of type Google::Cloud::Logging::V2::Settings.
|
2766
|
+
# p result
|
2767
|
+
#
|
2768
|
+
def update_settings request, options = nil
|
2769
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2770
|
+
|
2771
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::UpdateSettingsRequest
|
2772
|
+
|
2773
|
+
# Converts hash and nil to an options object
|
2774
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2775
|
+
|
2776
|
+
# Customize the options with defaults
|
2777
|
+
metadata = @config.rpcs.update_settings.metadata.to_h
|
2778
|
+
|
2779
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2780
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2781
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2782
|
+
gapic_version: ::Google::Cloud::Logging::V2::VERSION
|
2783
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2784
|
+
|
2785
|
+
header_params = {}
|
2786
|
+
if request.name
|
2787
|
+
header_params["name"] = request.name
|
2788
|
+
end
|
2789
|
+
|
2790
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2791
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2792
|
+
|
2793
|
+
options.apply_defaults timeout: @config.rpcs.update_settings.timeout,
|
2794
|
+
metadata: metadata,
|
2795
|
+
retry_policy: @config.rpcs.update_settings.retry_policy
|
2796
|
+
|
2797
|
+
options.apply_defaults timeout: @config.timeout,
|
2798
|
+
metadata: @config.metadata,
|
2799
|
+
retry_policy: @config.retry_policy
|
2800
|
+
|
2801
|
+
@config_service_stub.call_rpc :update_settings, request, options: options do |response, operation|
|
2802
|
+
yield response, operation if block_given?
|
2803
|
+
return response
|
2804
|
+
end
|
2805
|
+
rescue ::GRPC::BadStatus => e
|
2806
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2807
|
+
end
|
2808
|
+
|
2809
|
+
##
|
2810
|
+
# Copies a set of log entries from a log bucket to a Cloud Storage bucket.
|
2811
|
+
#
|
2812
|
+
# @overload copy_log_entries(request, options = nil)
|
2813
|
+
# Pass arguments to `copy_log_entries` via a request object, either of type
|
2814
|
+
# {::Google::Cloud::Logging::V2::CopyLogEntriesRequest} or an equivalent Hash.
|
2815
|
+
#
|
2816
|
+
# @param request [::Google::Cloud::Logging::V2::CopyLogEntriesRequest, ::Hash]
|
2817
|
+
# A request object representing the call parameters. Required. To specify no
|
2818
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2819
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2820
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2821
|
+
#
|
2822
|
+
# @overload copy_log_entries(name: nil, filter: nil, destination: nil)
|
2823
|
+
# Pass arguments to `copy_log_entries` via keyword arguments. Note that at
|
2824
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2825
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2826
|
+
#
|
2827
|
+
# @param name [::String]
|
2828
|
+
# Required. Log bucket from which to copy log entries.
|
2829
|
+
#
|
2830
|
+
# For example:
|
2831
|
+
#
|
2832
|
+
# `"projects/my-project/locations/global/buckets/my-source-bucket"`
|
2833
|
+
# @param filter [::String]
|
2834
|
+
# Optional. A filter specifying which log entries to copy. The filter must be no more
|
2835
|
+
# than 20k characters. An empty filter matches all log entries.
|
2836
|
+
# @param destination [::String]
|
2837
|
+
# Required. Destination to which to copy log entries.
|
2838
|
+
#
|
2839
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2840
|
+
# @yieldparam response [::Gapic::Operation]
|
2841
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2842
|
+
#
|
2843
|
+
# @return [::Gapic::Operation]
|
2844
|
+
#
|
2845
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2846
|
+
#
|
2847
|
+
# @example Basic example
|
2848
|
+
# require "google/cloud/logging/v2"
|
2849
|
+
#
|
2850
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2851
|
+
# client = Google::Cloud::Logging::V2::ConfigService::Client.new
|
2852
|
+
#
|
2853
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2854
|
+
# request = Google::Cloud::Logging::V2::CopyLogEntriesRequest.new
|
2855
|
+
#
|
2856
|
+
# # Call the copy_log_entries method.
|
2857
|
+
# result = client.copy_log_entries request
|
2858
|
+
#
|
2859
|
+
# # The returned object is of type Gapic::Operation. You can use this
|
2860
|
+
# # object to check the status of an operation, cancel it, or wait
|
2861
|
+
# # for results. Here is how to block until completion:
|
2862
|
+
# result.wait_until_done! timeout: 60
|
2863
|
+
# if result.response?
|
2864
|
+
# p result.response
|
2865
|
+
# else
|
2866
|
+
# puts "Error!"
|
2867
|
+
# end
|
2868
|
+
#
|
2869
|
+
def copy_log_entries request, options = nil
|
2870
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2871
|
+
|
2872
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::CopyLogEntriesRequest
|
2873
|
+
|
2874
|
+
# Converts hash and nil to an options object
|
2875
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2876
|
+
|
2877
|
+
# Customize the options with defaults
|
2878
|
+
metadata = @config.rpcs.copy_log_entries.metadata.to_h
|
2879
|
+
|
2880
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2881
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2882
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2883
|
+
gapic_version: ::Google::Cloud::Logging::V2::VERSION
|
2884
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2885
|
+
|
2886
|
+
options.apply_defaults timeout: @config.rpcs.copy_log_entries.timeout,
|
2887
|
+
metadata: metadata,
|
2888
|
+
retry_policy: @config.rpcs.copy_log_entries.retry_policy
|
2889
|
+
|
2890
|
+
options.apply_defaults timeout: @config.timeout,
|
2891
|
+
metadata: @config.metadata,
|
2892
|
+
retry_policy: @config.retry_policy
|
2893
|
+
|
2894
|
+
@config_service_stub.call_rpc :copy_log_entries, request, options: options do |response, operation|
|
2895
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
2896
|
+
yield response, operation if block_given?
|
2897
|
+
return response
|
2898
|
+
end
|
2899
|
+
rescue ::GRPC::BadStatus => e
|
2900
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2901
|
+
end
|
2902
|
+
|
2066
2903
|
##
|
2067
2904
|
# Configuration class for the ConfigService API.
|
2068
2905
|
#
|
@@ -2076,22 +2913,21 @@ module Google
|
|
2076
2913
|
# Configuration can be applied globally to all clients, or to a single client
|
2077
2914
|
# on construction.
|
2078
2915
|
#
|
2079
|
-
#
|
2080
|
-
#
|
2081
|
-
# To modify the global config, setting the timeout for list_buckets
|
2082
|
-
# to 20 seconds, and all remaining timeouts to 10 seconds:
|
2083
|
-
#
|
2084
|
-
# ::Google::Cloud::Logging::V2::ConfigService::Client.configure do |config|
|
2085
|
-
# config.timeout = 10.0
|
2086
|
-
# config.rpcs.list_buckets.timeout = 20.0
|
2087
|
-
# end
|
2916
|
+
# @example
|
2088
2917
|
#
|
2089
|
-
#
|
2918
|
+
# # Modify the global config, setting the timeout for
|
2919
|
+
# # list_buckets to 20 seconds,
|
2920
|
+
# # and all remaining timeouts to 10 seconds.
|
2921
|
+
# ::Google::Cloud::Logging::V2::ConfigService::Client.configure do |config|
|
2922
|
+
# config.timeout = 10.0
|
2923
|
+
# config.rpcs.list_buckets.timeout = 20.0
|
2924
|
+
# end
|
2090
2925
|
#
|
2091
|
-
#
|
2092
|
-
#
|
2093
|
-
#
|
2094
|
-
#
|
2926
|
+
# # Apply the above configuration only to a new client.
|
2927
|
+
# client = ::Google::Cloud::Logging::V2::ConfigService::Client.new do |config|
|
2928
|
+
# config.timeout = 10.0
|
2929
|
+
# config.rpcs.list_buckets.timeout = 20.0
|
2930
|
+
# end
|
2095
2931
|
#
|
2096
2932
|
# @!attribute [rw] endpoint
|
2097
2933
|
# The hostname or hostname:port of the service endpoint.
|
@@ -2314,6 +3150,21 @@ module Google
|
|
2314
3150
|
# @return [::Gapic::Config::Method]
|
2315
3151
|
#
|
2316
3152
|
attr_reader :update_cmek_settings
|
3153
|
+
##
|
3154
|
+
# RPC-specific configuration for `get_settings`
|
3155
|
+
# @return [::Gapic::Config::Method]
|
3156
|
+
#
|
3157
|
+
attr_reader :get_settings
|
3158
|
+
##
|
3159
|
+
# RPC-specific configuration for `update_settings`
|
3160
|
+
# @return [::Gapic::Config::Method]
|
3161
|
+
#
|
3162
|
+
attr_reader :update_settings
|
3163
|
+
##
|
3164
|
+
# RPC-specific configuration for `copy_log_entries`
|
3165
|
+
# @return [::Gapic::Config::Method]
|
3166
|
+
#
|
3167
|
+
attr_reader :copy_log_entries
|
2317
3168
|
|
2318
3169
|
# @private
|
2319
3170
|
def initialize parent_rpcs = nil
|
@@ -2363,6 +3214,12 @@ module Google
|
|
2363
3214
|
@get_cmek_settings = ::Gapic::Config::Method.new get_cmek_settings_config
|
2364
3215
|
update_cmek_settings_config = parent_rpcs.update_cmek_settings if parent_rpcs.respond_to? :update_cmek_settings
|
2365
3216
|
@update_cmek_settings = ::Gapic::Config::Method.new update_cmek_settings_config
|
3217
|
+
get_settings_config = parent_rpcs.get_settings if parent_rpcs.respond_to? :get_settings
|
3218
|
+
@get_settings = ::Gapic::Config::Method.new get_settings_config
|
3219
|
+
update_settings_config = parent_rpcs.update_settings if parent_rpcs.respond_to? :update_settings
|
3220
|
+
@update_settings = ::Gapic::Config::Method.new update_settings_config
|
3221
|
+
copy_log_entries_config = parent_rpcs.copy_log_entries if parent_rpcs.respond_to? :copy_log_entries
|
3222
|
+
@copy_log_entries = ::Gapic::Config::Method.new copy_log_entries_config
|
2366
3223
|
|
2367
3224
|
yield self if block_given?
|
2368
3225
|
end
|