google-cloud-logging-v2 0.8.1 → 0.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +1 -1
- data/README.md +3 -3
- data/lib/google/cloud/logging/v2/config_service/client.rb +728 -71
- data/lib/google/cloud/logging/v2/config_service/operations.rb +14 -16
- data/lib/google/cloud/logging/v2/config_service/paths.rb +81 -0
- data/lib/google/cloud/logging/v2/config_service.rb +1 -1
- data/lib/google/cloud/logging/v2/logging_service/client.rb +47 -48
- data/lib/google/cloud/logging/v2/logging_service.rb +1 -1
- data/lib/google/cloud/logging/v2/metrics_service/client.rb +6 -8
- data/lib/google/cloud/logging/v2/metrics_service.rb +1 -1
- data/lib/google/cloud/logging/v2/version.rb +1 -1
- data/lib/google/cloud/logging/v2.rb +2 -2
- data/lib/google/logging/v2/log_entry_pb.rb +29 -38
- data/lib/google/logging/v2/logging_config_pb.rb +39 -215
- data/lib/google/logging/v2/logging_config_services_pb.rb +23 -5
- data/lib/google/logging/v2/logging_metrics_pb.rb +27 -41
- data/lib/google/logging/v2/logging_pb.rb +28 -64
- data/proto_docs/google/api/client.rb +381 -0
- data/proto_docs/google/api/distribution.rb +2 -0
- data/proto_docs/google/api/launch_stage.rb +3 -3
- data/proto_docs/google/api/metric.rb +10 -6
- data/proto_docs/google/api/monitored_resource.rb +30 -18
- data/proto_docs/google/logging/type/http_request.rb +1 -1
- data/proto_docs/google/logging/v2/log_entry.rb +56 -23
- data/proto_docs/google/logging/v2/logging.rb +36 -35
- data/proto_docs/google/logging/v2/logging_config.rb +350 -78
- data/proto_docs/google/logging/v2/logging_metrics.rb +14 -2
- data/proto_docs/google/protobuf/any.rb +7 -4
- data/proto_docs/google/protobuf/struct.rb +1 -1
- data/proto_docs/google/protobuf/timestamp.rb +1 -3
- data/proto_docs/google/rpc/status.rb +4 -2
- metadata +9 -8
@@ -228,14 +228,14 @@ module Google
|
|
228
228
|
# supplying the character `-` in place of [LOCATION_ID] will return all
|
229
229
|
# buckets.
|
230
230
|
# @param page_token [::String]
|
231
|
-
# Optional. If present, then retrieve the next batch of results from the
|
232
|
-
# to this method. `pageToken` must be the value of
|
233
|
-
# previous response. The values of other method
|
234
|
-
# identical to those in the previous call.
|
231
|
+
# Optional. If present, then retrieve the next batch of results from the
|
232
|
+
# preceding call to this method. `pageToken` must be the value of
|
233
|
+
# `nextPageToken` from the previous response. The values of other method
|
234
|
+
# parameters should be identical to those in the previous call.
|
235
235
|
# @param page_size [::Integer]
|
236
|
-
# Optional. The maximum number of results to return from this request.
|
237
|
-
# values are ignored. The presence of `nextPageToken` in the
|
238
|
-
# indicates that more results might be available.
|
236
|
+
# Optional. The maximum number of results to return from this request.
|
237
|
+
# Non-positive values are ignored. The presence of `nextPageToken` in the
|
238
|
+
# response indicates that more results might be available.
|
239
239
|
#
|
240
240
|
# @yield [response, operation] Access the result along with the RPC operation
|
241
241
|
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::LogBucket>]
|
@@ -257,13 +257,11 @@ module Google
|
|
257
257
|
# # Call the list_buckets method.
|
258
258
|
# result = client.list_buckets request
|
259
259
|
#
|
260
|
-
# # The returned object is of type Gapic::PagedEnumerable. You can
|
261
|
-
# #
|
262
|
-
#
|
263
|
-
# # methods are also available for managing paging directly.
|
264
|
-
# result.each do |response|
|
260
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
261
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
262
|
+
# result.each do |item|
|
265
263
|
# # Each element is of type ::Google::Cloud::Logging::V2::LogBucket.
|
266
|
-
# p
|
264
|
+
# p item
|
267
265
|
# end
|
268
266
|
#
|
269
267
|
def list_buckets request, options = nil
|
@@ -402,6 +400,233 @@ module Google
|
|
402
400
|
raise ::Google::Cloud::Error.from_error(e)
|
403
401
|
end
|
404
402
|
|
403
|
+
##
|
404
|
+
# Creates a log bucket asynchronously that can be used to store log entries.
|
405
|
+
#
|
406
|
+
# After a bucket has been created, the bucket's location cannot be changed.
|
407
|
+
#
|
408
|
+
# @overload create_bucket_async(request, options = nil)
|
409
|
+
# Pass arguments to `create_bucket_async` via a request object, either of type
|
410
|
+
# {::Google::Cloud::Logging::V2::CreateBucketRequest} or an equivalent Hash.
|
411
|
+
#
|
412
|
+
# @param request [::Google::Cloud::Logging::V2::CreateBucketRequest, ::Hash]
|
413
|
+
# A request object representing the call parameters. Required. To specify no
|
414
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
415
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
416
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
417
|
+
#
|
418
|
+
# @overload create_bucket_async(parent: nil, bucket_id: nil, bucket: nil)
|
419
|
+
# Pass arguments to `create_bucket_async` via keyword arguments. Note that at
|
420
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
421
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
422
|
+
#
|
423
|
+
# @param parent [::String]
|
424
|
+
# Required. The resource in which to create the log bucket:
|
425
|
+
#
|
426
|
+
# "projects/[PROJECT_ID]/locations/[LOCATION_ID]"
|
427
|
+
#
|
428
|
+
# For example:
|
429
|
+
#
|
430
|
+
# `"projects/my-project/locations/global"`
|
431
|
+
# @param bucket_id [::String]
|
432
|
+
# Required. A client-assigned identifier such as `"my-bucket"`. Identifiers
|
433
|
+
# are limited to 100 characters and can include only letters, digits,
|
434
|
+
# underscores, hyphens, and periods.
|
435
|
+
# @param bucket [::Google::Cloud::Logging::V2::LogBucket, ::Hash]
|
436
|
+
# Required. The new bucket. The region specified in the new bucket must be
|
437
|
+
# compliant with any Location Restriction Org Policy. The name field in the
|
438
|
+
# bucket is ignored.
|
439
|
+
#
|
440
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
441
|
+
# @yieldparam response [::Gapic::Operation]
|
442
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
443
|
+
#
|
444
|
+
# @return [::Gapic::Operation]
|
445
|
+
#
|
446
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
447
|
+
#
|
448
|
+
# @example Basic example
|
449
|
+
# require "google/cloud/logging/v2"
|
450
|
+
#
|
451
|
+
# # Create a client object. The client can be reused for multiple calls.
|
452
|
+
# client = Google::Cloud::Logging::V2::ConfigService::Client.new
|
453
|
+
#
|
454
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
455
|
+
# request = Google::Cloud::Logging::V2::CreateBucketRequest.new
|
456
|
+
#
|
457
|
+
# # Call the create_bucket_async method.
|
458
|
+
# result = client.create_bucket_async request
|
459
|
+
#
|
460
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
461
|
+
# # check the status of an operation, cancel it, or wait for results.
|
462
|
+
# # Here is how to wait for a response.
|
463
|
+
# result.wait_until_done! timeout: 60
|
464
|
+
# if result.response?
|
465
|
+
# p result.response
|
466
|
+
# else
|
467
|
+
# puts "No response received."
|
468
|
+
# end
|
469
|
+
#
|
470
|
+
def create_bucket_async request, options = nil
|
471
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
472
|
+
|
473
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::CreateBucketRequest
|
474
|
+
|
475
|
+
# Converts hash and nil to an options object
|
476
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
477
|
+
|
478
|
+
# Customize the options with defaults
|
479
|
+
metadata = @config.rpcs.create_bucket_async.metadata.to_h
|
480
|
+
|
481
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
482
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
483
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
484
|
+
gapic_version: ::Google::Cloud::Logging::V2::VERSION
|
485
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
486
|
+
|
487
|
+
header_params = {}
|
488
|
+
if request.parent
|
489
|
+
header_params["parent"] = request.parent
|
490
|
+
end
|
491
|
+
|
492
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
493
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
494
|
+
|
495
|
+
options.apply_defaults timeout: @config.rpcs.create_bucket_async.timeout,
|
496
|
+
metadata: metadata,
|
497
|
+
retry_policy: @config.rpcs.create_bucket_async.retry_policy
|
498
|
+
|
499
|
+
options.apply_defaults timeout: @config.timeout,
|
500
|
+
metadata: @config.metadata,
|
501
|
+
retry_policy: @config.retry_policy
|
502
|
+
|
503
|
+
@config_service_stub.call_rpc :create_bucket_async, request, options: options do |response, operation|
|
504
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
505
|
+
yield response, operation if block_given?
|
506
|
+
return response
|
507
|
+
end
|
508
|
+
rescue ::GRPC::BadStatus => e
|
509
|
+
raise ::Google::Cloud::Error.from_error(e)
|
510
|
+
end
|
511
|
+
|
512
|
+
##
|
513
|
+
# Updates a log bucket asynchronously.
|
514
|
+
#
|
515
|
+
# If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then
|
516
|
+
# `FAILED_PRECONDITION` will be returned.
|
517
|
+
#
|
518
|
+
# After a bucket has been created, the bucket's location cannot be changed.
|
519
|
+
#
|
520
|
+
# @overload update_bucket_async(request, options = nil)
|
521
|
+
# Pass arguments to `update_bucket_async` via a request object, either of type
|
522
|
+
# {::Google::Cloud::Logging::V2::UpdateBucketRequest} or an equivalent Hash.
|
523
|
+
#
|
524
|
+
# @param request [::Google::Cloud::Logging::V2::UpdateBucketRequest, ::Hash]
|
525
|
+
# A request object representing the call parameters. Required. To specify no
|
526
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
527
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
528
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
529
|
+
#
|
530
|
+
# @overload update_bucket_async(name: nil, bucket: nil, update_mask: nil)
|
531
|
+
# Pass arguments to `update_bucket_async` via keyword arguments. Note that at
|
532
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
533
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
534
|
+
#
|
535
|
+
# @param name [::String]
|
536
|
+
# Required. The full resource name of the bucket to update.
|
537
|
+
#
|
538
|
+
# "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
|
539
|
+
# "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
|
540
|
+
# "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
|
541
|
+
# "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
|
542
|
+
#
|
543
|
+
# For example:
|
544
|
+
#
|
545
|
+
# `"projects/my-project/locations/global/buckets/my-bucket"`
|
546
|
+
# @param bucket [::Google::Cloud::Logging::V2::LogBucket, ::Hash]
|
547
|
+
# Required. The updated bucket.
|
548
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
549
|
+
# Required. Field mask that specifies the fields in `bucket` that need an
|
550
|
+
# update. A bucket field will be overwritten if, and only if, it is in the
|
551
|
+
# update mask. `name` and output only fields cannot be updated.
|
552
|
+
#
|
553
|
+
# For a detailed `FieldMask` definition, see:
|
554
|
+
# https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
|
555
|
+
#
|
556
|
+
# For example: `updateMask=retention_days`
|
557
|
+
#
|
558
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
559
|
+
# @yieldparam response [::Gapic::Operation]
|
560
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
561
|
+
#
|
562
|
+
# @return [::Gapic::Operation]
|
563
|
+
#
|
564
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
565
|
+
#
|
566
|
+
# @example Basic example
|
567
|
+
# require "google/cloud/logging/v2"
|
568
|
+
#
|
569
|
+
# # Create a client object. The client can be reused for multiple calls.
|
570
|
+
# client = Google::Cloud::Logging::V2::ConfigService::Client.new
|
571
|
+
#
|
572
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
573
|
+
# request = Google::Cloud::Logging::V2::UpdateBucketRequest.new
|
574
|
+
#
|
575
|
+
# # Call the update_bucket_async method.
|
576
|
+
# result = client.update_bucket_async request
|
577
|
+
#
|
578
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
579
|
+
# # check the status of an operation, cancel it, or wait for results.
|
580
|
+
# # Here is how to wait for a response.
|
581
|
+
# result.wait_until_done! timeout: 60
|
582
|
+
# if result.response?
|
583
|
+
# p result.response
|
584
|
+
# else
|
585
|
+
# puts "No response received."
|
586
|
+
# end
|
587
|
+
#
|
588
|
+
def update_bucket_async request, options = nil
|
589
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
590
|
+
|
591
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::UpdateBucketRequest
|
592
|
+
|
593
|
+
# Converts hash and nil to an options object
|
594
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
595
|
+
|
596
|
+
# Customize the options with defaults
|
597
|
+
metadata = @config.rpcs.update_bucket_async.metadata.to_h
|
598
|
+
|
599
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
600
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
601
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
602
|
+
gapic_version: ::Google::Cloud::Logging::V2::VERSION
|
603
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
604
|
+
|
605
|
+
header_params = {}
|
606
|
+
if request.name
|
607
|
+
header_params["name"] = request.name
|
608
|
+
end
|
609
|
+
|
610
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
611
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
612
|
+
|
613
|
+
options.apply_defaults timeout: @config.rpcs.update_bucket_async.timeout,
|
614
|
+
metadata: metadata,
|
615
|
+
retry_policy: @config.rpcs.update_bucket_async.retry_policy
|
616
|
+
|
617
|
+
options.apply_defaults timeout: @config.timeout,
|
618
|
+
metadata: @config.metadata,
|
619
|
+
retry_policy: @config.retry_policy
|
620
|
+
|
621
|
+
@config_service_stub.call_rpc :update_bucket_async, request, options: options do |response, operation|
|
622
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
623
|
+
yield response, operation if block_given?
|
624
|
+
return response
|
625
|
+
end
|
626
|
+
rescue ::GRPC::BadStatus => e
|
627
|
+
raise ::Google::Cloud::Error.from_error(e)
|
628
|
+
end
|
629
|
+
|
405
630
|
##
|
406
631
|
# Creates a log bucket that can be used to store log entries. After a bucket
|
407
632
|
# has been created, the bucket's location cannot be changed.
|
@@ -430,13 +655,13 @@ module Google
|
|
430
655
|
#
|
431
656
|
# `"projects/my-project/locations/global"`
|
432
657
|
# @param bucket_id [::String]
|
433
|
-
# Required. A client-assigned identifier such as `"my-bucket"`. Identifiers
|
434
|
-
# to 100 characters and can include only letters, digits,
|
435
|
-
# hyphens, and periods.
|
658
|
+
# Required. A client-assigned identifier such as `"my-bucket"`. Identifiers
|
659
|
+
# are limited to 100 characters and can include only letters, digits,
|
660
|
+
# underscores, hyphens, and periods.
|
436
661
|
# @param bucket [::Google::Cloud::Logging::V2::LogBucket, ::Hash]
|
437
|
-
# Required. The new bucket. The region specified in the new bucket must be
|
438
|
-
# with any Location Restriction Org Policy. The name field in the
|
439
|
-
# ignored.
|
662
|
+
# Required. The new bucket. The region specified in the new bucket must be
|
663
|
+
# compliant with any Location Restriction Org Policy. The name field in the
|
664
|
+
# bucket is ignored.
|
440
665
|
#
|
441
666
|
# @yield [response, operation] Access the result along with the RPC operation
|
442
667
|
# @yieldparam response [::Google::Cloud::Logging::V2::LogBucket]
|
@@ -503,11 +728,7 @@ module Google
|
|
503
728
|
end
|
504
729
|
|
505
730
|
##
|
506
|
-
# Updates a log bucket.
|
507
|
-
# existing bucket with values from the new bucket: `retention_period`
|
508
|
-
#
|
509
|
-
# If the retention period is decreased and the bucket is locked,
|
510
|
-
# `FAILED_PRECONDITION` will be returned.
|
731
|
+
# Updates a log bucket.
|
511
732
|
#
|
512
733
|
# If the bucket has a `lifecycle_state` of `DELETE_REQUESTED`, then
|
513
734
|
# `FAILED_PRECONDITION` will be returned.
|
@@ -543,9 +764,9 @@ module Google
|
|
543
764
|
# @param bucket [::Google::Cloud::Logging::V2::LogBucket, ::Hash]
|
544
765
|
# Required. The updated bucket.
|
545
766
|
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
546
|
-
# Required. Field mask that specifies the fields in `bucket` that need an
|
547
|
-
# bucket field will be overwritten if, and only if, it is in the
|
548
|
-
# `name` and output only fields cannot be updated.
|
767
|
+
# Required. Field mask that specifies the fields in `bucket` that need an
|
768
|
+
# update. A bucket field will be overwritten if, and only if, it is in the
|
769
|
+
# update mask. `name` and output only fields cannot be updated.
|
549
770
|
#
|
550
771
|
# For a detailed `FieldMask` definition, see:
|
551
772
|
# https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.FieldMask
|
@@ -832,10 +1053,10 @@ module Google
|
|
832
1053
|
#
|
833
1054
|
# "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
|
834
1055
|
# @param page_token [::String]
|
835
|
-
# Optional. If present, then retrieve the next batch of results from the
|
836
|
-
# to this method. `pageToken` must be the value of
|
837
|
-
# previous response. The values of other method
|
838
|
-
# identical to those in the previous call.
|
1056
|
+
# Optional. If present, then retrieve the next batch of results from the
|
1057
|
+
# preceding call to this method. `pageToken` must be the value of
|
1058
|
+
# `nextPageToken` from the previous response. The values of other method
|
1059
|
+
# parameters should be identical to those in the previous call.
|
839
1060
|
# @param page_size [::Integer]
|
840
1061
|
# Optional. The maximum number of results to return from this request.
|
841
1062
|
#
|
@@ -862,13 +1083,11 @@ module Google
|
|
862
1083
|
# # Call the list_views method.
|
863
1084
|
# result = client.list_views request
|
864
1085
|
#
|
865
|
-
# # The returned object is of type Gapic::PagedEnumerable. You can
|
866
|
-
# #
|
867
|
-
#
|
868
|
-
# # methods are also available for managing paging directly.
|
869
|
-
# result.each do |response|
|
1086
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
1087
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
1088
|
+
# result.each do |item|
|
870
1089
|
# # Each element is of type ::Google::Cloud::Logging::V2::LogView.
|
871
|
-
# p
|
1090
|
+
# p item
|
872
1091
|
# end
|
873
1092
|
#
|
874
1093
|
def list_views request, options = nil
|
@@ -1032,7 +1251,9 @@ module Google
|
|
1032
1251
|
#
|
1033
1252
|
# `"projects/my-project/locations/global/buckets/my-bucket"`
|
1034
1253
|
# @param view_id [::String]
|
1035
|
-
# Required.
|
1254
|
+
# Required. A client-assigned identifier such as `"my-view"`. Identifiers are
|
1255
|
+
# limited to 100 characters and can include only letters, digits,
|
1256
|
+
# underscores, hyphens, and periods.
|
1036
1257
|
# @param view [::Google::Cloud::Logging::V2::LogView, ::Hash]
|
1037
1258
|
# Required. The new view.
|
1038
1259
|
#
|
@@ -1355,13 +1576,11 @@ module Google
|
|
1355
1576
|
# # Call the list_sinks method.
|
1356
1577
|
# result = client.list_sinks request
|
1357
1578
|
#
|
1358
|
-
# # The returned object is of type Gapic::PagedEnumerable. You can
|
1359
|
-
# #
|
1360
|
-
#
|
1361
|
-
# # methods are also available for managing paging directly.
|
1362
|
-
# result.each do |response|
|
1579
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
1580
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
1581
|
+
# result.each do |item|
|
1363
1582
|
# # Each element is of type ::Google::Cloud::Logging::V2::LogSink.
|
1364
|
-
# p
|
1583
|
+
# p item
|
1365
1584
|
# end
|
1366
1585
|
#
|
1367
1586
|
def list_sinks request, options = nil
|
@@ -1547,7 +1766,8 @@ module Google
|
|
1547
1766
|
# If this field is set to true, or if the sink is owned by a non-project
|
1548
1767
|
# resource such as an organization, then the value of `writer_identity` will
|
1549
1768
|
# be a unique service account used only for exports from the new sink. For
|
1550
|
-
# more information, see `writer_identity` in
|
1769
|
+
# more information, see `writer_identity` in
|
1770
|
+
# {::Google::Cloud::Logging::V2::LogSink LogSink}.
|
1551
1771
|
#
|
1552
1772
|
# @yield [response, operation] Access the result along with the RPC operation
|
1553
1773
|
# @yieldparam response [::Google::Cloud::Logging::V2::LogSink]
|
@@ -1636,8 +1856,8 @@ module Google
|
|
1636
1856
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
1637
1857
|
#
|
1638
1858
|
# @param sink_name [::String]
|
1639
|
-
# Required. The full resource name of the sink to update, including the
|
1640
|
-
# resource and the sink identifier:
|
1859
|
+
# Required. The full resource name of the sink to update, including the
|
1860
|
+
# parent resource and the sink identifier:
|
1641
1861
|
#
|
1642
1862
|
# "projects/[PROJECT_ID]/sinks/[SINK_ID]"
|
1643
1863
|
# "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
|
@@ -1648,8 +1868,8 @@ module Google
|
|
1648
1868
|
#
|
1649
1869
|
# `"projects/my-project/sinks/my-sink"`
|
1650
1870
|
# @param sink [::Google::Cloud::Logging::V2::LogSink, ::Hash]
|
1651
|
-
# Required. The updated sink, whose name is the same identifier that appears
|
1652
|
-
# of `sink_name`.
|
1871
|
+
# Required. The updated sink, whose name is the same identifier that appears
|
1872
|
+
# as part of `sink_name`.
|
1653
1873
|
# @param unique_writer_identity [::Boolean]
|
1654
1874
|
# Optional. See {::Google::Cloud::Logging::V2::ConfigService::Client#create_sink sinks.create}
|
1655
1875
|
# for a description of this field. When updating a sink, the effect of this
|
@@ -1764,8 +1984,8 @@ module Google
|
|
1764
1984
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
1765
1985
|
#
|
1766
1986
|
# @param sink_name [::String]
|
1767
|
-
# Required. The full resource name of the sink to delete, including the
|
1768
|
-
# resource and the sink identifier:
|
1987
|
+
# Required. The full resource name of the sink to delete, including the
|
1988
|
+
# parent resource and the sink identifier:
|
1769
1989
|
#
|
1770
1990
|
# "projects/[PROJECT_ID]/sinks/[SINK_ID]"
|
1771
1991
|
# "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
|
@@ -1840,6 +2060,402 @@ module Google
|
|
1840
2060
|
raise ::Google::Cloud::Error.from_error(e)
|
1841
2061
|
end
|
1842
2062
|
|
2063
|
+
##
|
2064
|
+
# Asynchronously creates a linked dataset in BigQuery which makes it possible
|
2065
|
+
# to use BigQuery to read the logs stored in the log bucket. A log bucket may
|
2066
|
+
# currently only contain one link.
|
2067
|
+
#
|
2068
|
+
# @overload create_link(request, options = nil)
|
2069
|
+
# Pass arguments to `create_link` via a request object, either of type
|
2070
|
+
# {::Google::Cloud::Logging::V2::CreateLinkRequest} or an equivalent Hash.
|
2071
|
+
#
|
2072
|
+
# @param request [::Google::Cloud::Logging::V2::CreateLinkRequest, ::Hash]
|
2073
|
+
# A request object representing the call parameters. Required. To specify no
|
2074
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2075
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2076
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2077
|
+
#
|
2078
|
+
# @overload create_link(parent: nil, link: nil, link_id: nil)
|
2079
|
+
# Pass arguments to `create_link` via keyword arguments. Note that at
|
2080
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2081
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2082
|
+
#
|
2083
|
+
# @param parent [::String]
|
2084
|
+
# Required. The full resource name of the bucket to create a link for.
|
2085
|
+
#
|
2086
|
+
# "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
|
2087
|
+
# "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
|
2088
|
+
# "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
|
2089
|
+
# "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]"
|
2090
|
+
# @param link [::Google::Cloud::Logging::V2::Link, ::Hash]
|
2091
|
+
# Required. The new link.
|
2092
|
+
# @param link_id [::String]
|
2093
|
+
# Required. The ID to use for the link. The link_id can have up to 100
|
2094
|
+
# characters. A valid link_id must only have alphanumeric characters and
|
2095
|
+
# underscores within it.
|
2096
|
+
#
|
2097
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2098
|
+
# @yieldparam response [::Gapic::Operation]
|
2099
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2100
|
+
#
|
2101
|
+
# @return [::Gapic::Operation]
|
2102
|
+
#
|
2103
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2104
|
+
#
|
2105
|
+
# @example Basic example
|
2106
|
+
# require "google/cloud/logging/v2"
|
2107
|
+
#
|
2108
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2109
|
+
# client = Google::Cloud::Logging::V2::ConfigService::Client.new
|
2110
|
+
#
|
2111
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2112
|
+
# request = Google::Cloud::Logging::V2::CreateLinkRequest.new
|
2113
|
+
#
|
2114
|
+
# # Call the create_link method.
|
2115
|
+
# result = client.create_link request
|
2116
|
+
#
|
2117
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
2118
|
+
# # check the status of an operation, cancel it, or wait for results.
|
2119
|
+
# # Here is how to wait for a response.
|
2120
|
+
# result.wait_until_done! timeout: 60
|
2121
|
+
# if result.response?
|
2122
|
+
# p result.response
|
2123
|
+
# else
|
2124
|
+
# puts "No response received."
|
2125
|
+
# end
|
2126
|
+
#
|
2127
|
+
def create_link request, options = nil
|
2128
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2129
|
+
|
2130
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::CreateLinkRequest
|
2131
|
+
|
2132
|
+
# Converts hash and nil to an options object
|
2133
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2134
|
+
|
2135
|
+
# Customize the options with defaults
|
2136
|
+
metadata = @config.rpcs.create_link.metadata.to_h
|
2137
|
+
|
2138
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2139
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2140
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2141
|
+
gapic_version: ::Google::Cloud::Logging::V2::VERSION
|
2142
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2143
|
+
|
2144
|
+
header_params = {}
|
2145
|
+
if request.parent
|
2146
|
+
header_params["parent"] = request.parent
|
2147
|
+
end
|
2148
|
+
|
2149
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2150
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2151
|
+
|
2152
|
+
options.apply_defaults timeout: @config.rpcs.create_link.timeout,
|
2153
|
+
metadata: metadata,
|
2154
|
+
retry_policy: @config.rpcs.create_link.retry_policy
|
2155
|
+
|
2156
|
+
options.apply_defaults timeout: @config.timeout,
|
2157
|
+
metadata: @config.metadata,
|
2158
|
+
retry_policy: @config.retry_policy
|
2159
|
+
|
2160
|
+
@config_service_stub.call_rpc :create_link, request, options: options do |response, operation|
|
2161
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
2162
|
+
yield response, operation if block_given?
|
2163
|
+
return response
|
2164
|
+
end
|
2165
|
+
rescue ::GRPC::BadStatus => e
|
2166
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2167
|
+
end
|
2168
|
+
|
2169
|
+
##
|
2170
|
+
# Deletes a link. This will also delete the corresponding BigQuery linked
|
2171
|
+
# dataset.
|
2172
|
+
#
|
2173
|
+
# @overload delete_link(request, options = nil)
|
2174
|
+
# Pass arguments to `delete_link` via a request object, either of type
|
2175
|
+
# {::Google::Cloud::Logging::V2::DeleteLinkRequest} or an equivalent Hash.
|
2176
|
+
#
|
2177
|
+
# @param request [::Google::Cloud::Logging::V2::DeleteLinkRequest, ::Hash]
|
2178
|
+
# A request object representing the call parameters. Required. To specify no
|
2179
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2180
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2181
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2182
|
+
#
|
2183
|
+
# @overload delete_link(name: nil)
|
2184
|
+
# Pass arguments to `delete_link` via keyword arguments. Note that at
|
2185
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2186
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2187
|
+
#
|
2188
|
+
# @param name [::String]
|
2189
|
+
# Required. The full resource name of the link to delete.
|
2190
|
+
#
|
2191
|
+
# "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
|
2192
|
+
# "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
|
2193
|
+
# "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
|
2194
|
+
# "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
|
2195
|
+
#
|
2196
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2197
|
+
# @yieldparam response [::Gapic::Operation]
|
2198
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2199
|
+
#
|
2200
|
+
# @return [::Gapic::Operation]
|
2201
|
+
#
|
2202
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2203
|
+
#
|
2204
|
+
# @example Basic example
|
2205
|
+
# require "google/cloud/logging/v2"
|
2206
|
+
#
|
2207
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2208
|
+
# client = Google::Cloud::Logging::V2::ConfigService::Client.new
|
2209
|
+
#
|
2210
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2211
|
+
# request = Google::Cloud::Logging::V2::DeleteLinkRequest.new
|
2212
|
+
#
|
2213
|
+
# # Call the delete_link method.
|
2214
|
+
# result = client.delete_link request
|
2215
|
+
#
|
2216
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
2217
|
+
# # check the status of an operation, cancel it, or wait for results.
|
2218
|
+
# # Here is how to wait for a response.
|
2219
|
+
# result.wait_until_done! timeout: 60
|
2220
|
+
# if result.response?
|
2221
|
+
# p result.response
|
2222
|
+
# else
|
2223
|
+
# puts "No response received."
|
2224
|
+
# end
|
2225
|
+
#
|
2226
|
+
def delete_link request, options = nil
|
2227
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2228
|
+
|
2229
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::DeleteLinkRequest
|
2230
|
+
|
2231
|
+
# Converts hash and nil to an options object
|
2232
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2233
|
+
|
2234
|
+
# Customize the options with defaults
|
2235
|
+
metadata = @config.rpcs.delete_link.metadata.to_h
|
2236
|
+
|
2237
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2238
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2239
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2240
|
+
gapic_version: ::Google::Cloud::Logging::V2::VERSION
|
2241
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2242
|
+
|
2243
|
+
header_params = {}
|
2244
|
+
if request.name
|
2245
|
+
header_params["name"] = request.name
|
2246
|
+
end
|
2247
|
+
|
2248
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2249
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2250
|
+
|
2251
|
+
options.apply_defaults timeout: @config.rpcs.delete_link.timeout,
|
2252
|
+
metadata: metadata,
|
2253
|
+
retry_policy: @config.rpcs.delete_link.retry_policy
|
2254
|
+
|
2255
|
+
options.apply_defaults timeout: @config.timeout,
|
2256
|
+
metadata: @config.metadata,
|
2257
|
+
retry_policy: @config.retry_policy
|
2258
|
+
|
2259
|
+
@config_service_stub.call_rpc :delete_link, request, options: options do |response, operation|
|
2260
|
+
response = ::Gapic::Operation.new response, @operations_client, options: options
|
2261
|
+
yield response, operation if block_given?
|
2262
|
+
return response
|
2263
|
+
end
|
2264
|
+
rescue ::GRPC::BadStatus => e
|
2265
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2266
|
+
end
|
2267
|
+
|
2268
|
+
##
|
2269
|
+
# Lists links.
|
2270
|
+
#
|
2271
|
+
# @overload list_links(request, options = nil)
|
2272
|
+
# Pass arguments to `list_links` via a request object, either of type
|
2273
|
+
# {::Google::Cloud::Logging::V2::ListLinksRequest} or an equivalent Hash.
|
2274
|
+
#
|
2275
|
+
# @param request [::Google::Cloud::Logging::V2::ListLinksRequest, ::Hash]
|
2276
|
+
# A request object representing the call parameters. Required. To specify no
|
2277
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2278
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2279
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2280
|
+
#
|
2281
|
+
# @overload list_links(parent: nil, page_token: nil, page_size: nil)
|
2282
|
+
# Pass arguments to `list_links` via keyword arguments. Note that at
|
2283
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2284
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2285
|
+
#
|
2286
|
+
# @param parent [::String]
|
2287
|
+
# Required. The parent resource whose links are to be listed:
|
2288
|
+
#
|
2289
|
+
# "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/"
|
2290
|
+
# "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/"
|
2291
|
+
# "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/"
|
2292
|
+
# "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/
|
2293
|
+
# @param page_token [::String]
|
2294
|
+
# Optional. If present, then retrieve the next batch of results from the
|
2295
|
+
# preceding call to this method. `pageToken` must be the value of
|
2296
|
+
# `nextPageToken` from the previous response.
|
2297
|
+
# @param page_size [::Integer]
|
2298
|
+
# Optional. The maximum number of results to return from this request.
|
2299
|
+
#
|
2300
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2301
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::Link>]
|
2302
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2303
|
+
#
|
2304
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::Logging::V2::Link>]
|
2305
|
+
#
|
2306
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2307
|
+
#
|
2308
|
+
# @example Basic example
|
2309
|
+
# require "google/cloud/logging/v2"
|
2310
|
+
#
|
2311
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2312
|
+
# client = Google::Cloud::Logging::V2::ConfigService::Client.new
|
2313
|
+
#
|
2314
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2315
|
+
# request = Google::Cloud::Logging::V2::ListLinksRequest.new
|
2316
|
+
#
|
2317
|
+
# # Call the list_links method.
|
2318
|
+
# result = client.list_links request
|
2319
|
+
#
|
2320
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
2321
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
2322
|
+
# result.each do |item|
|
2323
|
+
# # Each element is of type ::Google::Cloud::Logging::V2::Link.
|
2324
|
+
# p item
|
2325
|
+
# end
|
2326
|
+
#
|
2327
|
+
def list_links request, options = nil
|
2328
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2329
|
+
|
2330
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::ListLinksRequest
|
2331
|
+
|
2332
|
+
# Converts hash and nil to an options object
|
2333
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2334
|
+
|
2335
|
+
# Customize the options with defaults
|
2336
|
+
metadata = @config.rpcs.list_links.metadata.to_h
|
2337
|
+
|
2338
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2339
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2340
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2341
|
+
gapic_version: ::Google::Cloud::Logging::V2::VERSION
|
2342
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2343
|
+
|
2344
|
+
header_params = {}
|
2345
|
+
if request.parent
|
2346
|
+
header_params["parent"] = request.parent
|
2347
|
+
end
|
2348
|
+
|
2349
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2350
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2351
|
+
|
2352
|
+
options.apply_defaults timeout: @config.rpcs.list_links.timeout,
|
2353
|
+
metadata: metadata,
|
2354
|
+
retry_policy: @config.rpcs.list_links.retry_policy
|
2355
|
+
|
2356
|
+
options.apply_defaults timeout: @config.timeout,
|
2357
|
+
metadata: @config.metadata,
|
2358
|
+
retry_policy: @config.retry_policy
|
2359
|
+
|
2360
|
+
@config_service_stub.call_rpc :list_links, request, options: options do |response, operation|
|
2361
|
+
response = ::Gapic::PagedEnumerable.new @config_service_stub, :list_links, request, response, operation, options
|
2362
|
+
yield response, operation if block_given?
|
2363
|
+
return response
|
2364
|
+
end
|
2365
|
+
rescue ::GRPC::BadStatus => e
|
2366
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2367
|
+
end
|
2368
|
+
|
2369
|
+
##
|
2370
|
+
# Gets a link.
|
2371
|
+
#
|
2372
|
+
# @overload get_link(request, options = nil)
|
2373
|
+
# Pass arguments to `get_link` via a request object, either of type
|
2374
|
+
# {::Google::Cloud::Logging::V2::GetLinkRequest} or an equivalent Hash.
|
2375
|
+
#
|
2376
|
+
# @param request [::Google::Cloud::Logging::V2::GetLinkRequest, ::Hash]
|
2377
|
+
# A request object representing the call parameters. Required. To specify no
|
2378
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
2379
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
2380
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
2381
|
+
#
|
2382
|
+
# @overload get_link(name: nil)
|
2383
|
+
# Pass arguments to `get_link` via keyword arguments. Note that at
|
2384
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
2385
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
2386
|
+
#
|
2387
|
+
# @param name [::String]
|
2388
|
+
# Required. The resource name of the link:
|
2389
|
+
#
|
2390
|
+
# "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
|
2391
|
+
# "organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
|
2392
|
+
# "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]"
|
2393
|
+
# "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/links/[LINK_ID]
|
2394
|
+
#
|
2395
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
2396
|
+
# @yieldparam response [::Google::Cloud::Logging::V2::Link]
|
2397
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
2398
|
+
#
|
2399
|
+
# @return [::Google::Cloud::Logging::V2::Link]
|
2400
|
+
#
|
2401
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
2402
|
+
#
|
2403
|
+
# @example Basic example
|
2404
|
+
# require "google/cloud/logging/v2"
|
2405
|
+
#
|
2406
|
+
# # Create a client object. The client can be reused for multiple calls.
|
2407
|
+
# client = Google::Cloud::Logging::V2::ConfigService::Client.new
|
2408
|
+
#
|
2409
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
2410
|
+
# request = Google::Cloud::Logging::V2::GetLinkRequest.new
|
2411
|
+
#
|
2412
|
+
# # Call the get_link method.
|
2413
|
+
# result = client.get_link request
|
2414
|
+
#
|
2415
|
+
# # The returned object is of type Google::Cloud::Logging::V2::Link.
|
2416
|
+
# p result
|
2417
|
+
#
|
2418
|
+
def get_link request, options = nil
|
2419
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
2420
|
+
|
2421
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Logging::V2::GetLinkRequest
|
2422
|
+
|
2423
|
+
# Converts hash and nil to an options object
|
2424
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
2425
|
+
|
2426
|
+
# Customize the options with defaults
|
2427
|
+
metadata = @config.rpcs.get_link.metadata.to_h
|
2428
|
+
|
2429
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
2430
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
2431
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
2432
|
+
gapic_version: ::Google::Cloud::Logging::V2::VERSION
|
2433
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
2434
|
+
|
2435
|
+
header_params = {}
|
2436
|
+
if request.name
|
2437
|
+
header_params["name"] = request.name
|
2438
|
+
end
|
2439
|
+
|
2440
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
2441
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
2442
|
+
|
2443
|
+
options.apply_defaults timeout: @config.rpcs.get_link.timeout,
|
2444
|
+
metadata: metadata,
|
2445
|
+
retry_policy: @config.rpcs.get_link.retry_policy
|
2446
|
+
|
2447
|
+
options.apply_defaults timeout: @config.timeout,
|
2448
|
+
metadata: @config.metadata,
|
2449
|
+
retry_policy: @config.retry_policy
|
2450
|
+
|
2451
|
+
@config_service_stub.call_rpc :get_link, request, options: options do |response, operation|
|
2452
|
+
yield response, operation if block_given?
|
2453
|
+
return response
|
2454
|
+
end
|
2455
|
+
rescue ::GRPC::BadStatus => e
|
2456
|
+
raise ::Google::Cloud::Error.from_error(e)
|
2457
|
+
end
|
2458
|
+
|
1843
2459
|
##
|
1844
2460
|
# Lists all the exclusions on the _Default sink in a parent resource.
|
1845
2461
|
#
|
@@ -1895,13 +2511,11 @@ module Google
|
|
1895
2511
|
# # Call the list_exclusions method.
|
1896
2512
|
# result = client.list_exclusions request
|
1897
2513
|
#
|
1898
|
-
# # The returned object is of type Gapic::PagedEnumerable. You can
|
1899
|
-
# #
|
1900
|
-
#
|
1901
|
-
# # methods are also available for managing paging directly.
|
1902
|
-
# result.each do |response|
|
2514
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
2515
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
2516
|
+
# result.each do |item|
|
1903
2517
|
# # Each element is of type ::Google::Cloud::Logging::V2::LogExclusion.
|
1904
|
-
# p
|
2518
|
+
# p item
|
1905
2519
|
# end
|
1906
2520
|
#
|
1907
2521
|
def list_exclusions request, options = nil
|
@@ -2171,13 +2785,14 @@ module Google
|
|
2171
2785
|
#
|
2172
2786
|
# `"projects/my-project/exclusions/my-exclusion"`
|
2173
2787
|
# @param exclusion [::Google::Cloud::Logging::V2::LogExclusion, ::Hash]
|
2174
|
-
# Required. New values for the existing exclusion. Only the fields specified
|
2175
|
-
# `update_mask` are relevant.
|
2788
|
+
# Required. New values for the existing exclusion. Only the fields specified
|
2789
|
+
# in `update_mask` are relevant.
|
2176
2790
|
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
2177
|
-
# Required. A non-empty list of fields to change in the existing exclusion.
|
2178
|
-
# for the fields are taken from the corresponding fields in the
|
2179
|
-
# {::Google::Cloud::Logging::V2::LogExclusion LogExclusion} included in this request.
|
2180
|
-
# `update_mask` are not changed and are ignored in
|
2791
|
+
# Required. A non-empty list of fields to change in the existing exclusion.
|
2792
|
+
# New values for the fields are taken from the corresponding fields in the
|
2793
|
+
# {::Google::Cloud::Logging::V2::LogExclusion LogExclusion} included in this request.
|
2794
|
+
# Fields not mentioned in `update_mask` are not changed and are ignored in
|
2795
|
+
# the request.
|
2181
2796
|
#
|
2182
2797
|
# For example, to change the filter and description of an exclusion,
|
2183
2798
|
# specify an `update_mask` of `"filter,description"`.
|
@@ -2831,8 +3446,8 @@ module Google
|
|
2831
3446
|
#
|
2832
3447
|
# `"projects/my-project/locations/global/buckets/my-source-bucket"`
|
2833
3448
|
# @param filter [::String]
|
2834
|
-
# Optional. A filter specifying which log entries to copy. The filter must be
|
2835
|
-
# than 20k characters. An empty filter matches all log entries.
|
3449
|
+
# Optional. A filter specifying which log entries to copy. The filter must be
|
3450
|
+
# no more than 20k characters. An empty filter matches all log entries.
|
2836
3451
|
# @param destination [::String]
|
2837
3452
|
# Required. Destination to which to copy log entries.
|
2838
3453
|
#
|
@@ -2856,14 +3471,14 @@ module Google
|
|
2856
3471
|
# # Call the copy_log_entries method.
|
2857
3472
|
# result = client.copy_log_entries request
|
2858
3473
|
#
|
2859
|
-
# # The returned object is of type Gapic::Operation. You can use
|
2860
|
-
# #
|
2861
|
-
# #
|
3474
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
3475
|
+
# # check the status of an operation, cancel it, or wait for results.
|
3476
|
+
# # Here is how to wait for a response.
|
2862
3477
|
# result.wait_until_done! timeout: 60
|
2863
3478
|
# if result.response?
|
2864
3479
|
# p result.response
|
2865
3480
|
# else
|
2866
|
-
# puts "
|
3481
|
+
# puts "No response received."
|
2867
3482
|
# end
|
2868
3483
|
#
|
2869
3484
|
def copy_log_entries request, options = nil
|
@@ -2938,9 +3553,9 @@ module Google
|
|
2938
3553
|
# * (`String`) The path to a service account key file in JSON format
|
2939
3554
|
# * (`Hash`) A service account key as a Hash
|
2940
3555
|
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
2941
|
-
# (see the [googleauth docs](https://
|
3556
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
2942
3557
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
2943
|
-
# (see the [signet docs](https://
|
3558
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
2944
3559
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
2945
3560
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
2946
3561
|
# * (`nil`) indicating no credentials
|
@@ -3046,6 +3661,16 @@ module Google
|
|
3046
3661
|
#
|
3047
3662
|
attr_reader :get_bucket
|
3048
3663
|
##
|
3664
|
+
# RPC-specific configuration for `create_bucket_async`
|
3665
|
+
# @return [::Gapic::Config::Method]
|
3666
|
+
#
|
3667
|
+
attr_reader :create_bucket_async
|
3668
|
+
##
|
3669
|
+
# RPC-specific configuration for `update_bucket_async`
|
3670
|
+
# @return [::Gapic::Config::Method]
|
3671
|
+
#
|
3672
|
+
attr_reader :update_bucket_async
|
3673
|
+
##
|
3049
3674
|
# RPC-specific configuration for `create_bucket`
|
3050
3675
|
# @return [::Gapic::Config::Method]
|
3051
3676
|
#
|
@@ -3116,6 +3741,26 @@ module Google
|
|
3116
3741
|
#
|
3117
3742
|
attr_reader :delete_sink
|
3118
3743
|
##
|
3744
|
+
# RPC-specific configuration for `create_link`
|
3745
|
+
# @return [::Gapic::Config::Method]
|
3746
|
+
#
|
3747
|
+
attr_reader :create_link
|
3748
|
+
##
|
3749
|
+
# RPC-specific configuration for `delete_link`
|
3750
|
+
# @return [::Gapic::Config::Method]
|
3751
|
+
#
|
3752
|
+
attr_reader :delete_link
|
3753
|
+
##
|
3754
|
+
# RPC-specific configuration for `list_links`
|
3755
|
+
# @return [::Gapic::Config::Method]
|
3756
|
+
#
|
3757
|
+
attr_reader :list_links
|
3758
|
+
##
|
3759
|
+
# RPC-specific configuration for `get_link`
|
3760
|
+
# @return [::Gapic::Config::Method]
|
3761
|
+
#
|
3762
|
+
attr_reader :get_link
|
3763
|
+
##
|
3119
3764
|
# RPC-specific configuration for `list_exclusions`
|
3120
3765
|
# @return [::Gapic::Config::Method]
|
3121
3766
|
#
|
@@ -3172,6 +3817,10 @@ module Google
|
|
3172
3817
|
@list_buckets = ::Gapic::Config::Method.new list_buckets_config
|
3173
3818
|
get_bucket_config = parent_rpcs.get_bucket if parent_rpcs.respond_to? :get_bucket
|
3174
3819
|
@get_bucket = ::Gapic::Config::Method.new get_bucket_config
|
3820
|
+
create_bucket_async_config = parent_rpcs.create_bucket_async if parent_rpcs.respond_to? :create_bucket_async
|
3821
|
+
@create_bucket_async = ::Gapic::Config::Method.new create_bucket_async_config
|
3822
|
+
update_bucket_async_config = parent_rpcs.update_bucket_async if parent_rpcs.respond_to? :update_bucket_async
|
3823
|
+
@update_bucket_async = ::Gapic::Config::Method.new update_bucket_async_config
|
3175
3824
|
create_bucket_config = parent_rpcs.create_bucket if parent_rpcs.respond_to? :create_bucket
|
3176
3825
|
@create_bucket = ::Gapic::Config::Method.new create_bucket_config
|
3177
3826
|
update_bucket_config = parent_rpcs.update_bucket if parent_rpcs.respond_to? :update_bucket
|
@@ -3200,6 +3849,14 @@ module Google
|
|
3200
3849
|
@update_sink = ::Gapic::Config::Method.new update_sink_config
|
3201
3850
|
delete_sink_config = parent_rpcs.delete_sink if parent_rpcs.respond_to? :delete_sink
|
3202
3851
|
@delete_sink = ::Gapic::Config::Method.new delete_sink_config
|
3852
|
+
create_link_config = parent_rpcs.create_link if parent_rpcs.respond_to? :create_link
|
3853
|
+
@create_link = ::Gapic::Config::Method.new create_link_config
|
3854
|
+
delete_link_config = parent_rpcs.delete_link if parent_rpcs.respond_to? :delete_link
|
3855
|
+
@delete_link = ::Gapic::Config::Method.new delete_link_config
|
3856
|
+
list_links_config = parent_rpcs.list_links if parent_rpcs.respond_to? :list_links
|
3857
|
+
@list_links = ::Gapic::Config::Method.new list_links_config
|
3858
|
+
get_link_config = parent_rpcs.get_link if parent_rpcs.respond_to? :get_link
|
3859
|
+
@get_link = ::Gapic::Config::Method.new get_link_config
|
3203
3860
|
list_exclusions_config = parent_rpcs.list_exclusions if parent_rpcs.respond_to? :list_exclusions
|
3204
3861
|
@list_exclusions = ::Gapic::Config::Method.new list_exclusions_config
|
3205
3862
|
get_exclusion_config = parent_rpcs.get_exclusion if parent_rpcs.respond_to? :get_exclusion
|