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.
@@ -485,6 +485,59 @@ module Google
485
485
  "projects/#{project}"
486
486
  end
487
487
 
488
+ ##
489
+ # Create a fully-qualified Settings resource string.
490
+ #
491
+ # @overload settings_path(project:)
492
+ # The resource will be in the following format:
493
+ #
494
+ # `projects/{project}/settings`
495
+ #
496
+ # @param project [String]
497
+ #
498
+ # @overload settings_path(organization:)
499
+ # The resource will be in the following format:
500
+ #
501
+ # `organizations/{organization}/settings`
502
+ #
503
+ # @param organization [String]
504
+ #
505
+ # @overload settings_path(folder:)
506
+ # The resource will be in the following format:
507
+ #
508
+ # `folders/{folder}/settings`
509
+ #
510
+ # @param folder [String]
511
+ #
512
+ # @overload settings_path(billing_account:)
513
+ # The resource will be in the following format:
514
+ #
515
+ # `billingAccounts/{billing_account}/settings`
516
+ #
517
+ # @param billing_account [String]
518
+ #
519
+ # @return [::String]
520
+ def settings_path **args
521
+ resources = {
522
+ "project" => (proc do |project:|
523
+ "projects/#{project}/settings"
524
+ end),
525
+ "organization" => (proc do |organization:|
526
+ "organizations/#{organization}/settings"
527
+ end),
528
+ "folder" => (proc do |folder:|
529
+ "folders/#{folder}/settings"
530
+ end),
531
+ "billing_account" => (proc do |billing_account:|
532
+ "billingAccounts/#{billing_account}/settings"
533
+ end)
534
+ }
535
+
536
+ resource = resources[args.keys.sort.join(":")]
537
+ raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
538
+ resource.call(**args)
539
+ end
540
+
488
541
  extend self
489
542
  end
490
543
  end
@@ -24,6 +24,7 @@ require "google/cloud/logging/v2/version"
24
24
 
25
25
  require "google/cloud/logging/v2/config_service/credentials"
26
26
  require "google/cloud/logging/v2/config_service/paths"
27
+ require "google/cloud/logging/v2/config_service/operations"
27
28
  require "google/cloud/logging/v2/config_service/client"
28
29
 
29
30
  module Google
@@ -41,13 +41,12 @@ module Google
41
41
  # See {::Google::Cloud::Logging::V2::LoggingService::Client::Configuration}
42
42
  # for a description of the configuration fields.
43
43
  #
44
- # ## Example
44
+ # @example
45
45
  #
46
- # To modify the configuration for all LoggingService clients:
47
- #
48
- # ::Google::Cloud::Logging::V2::LoggingService::Client.configure do |config|
49
- # config.timeout = 10.0
50
- # end
46
+ # # Modify the configuration for all LoggingService clients
47
+ # ::Google::Cloud::Logging::V2::LoggingService::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]
@@ -124,19 +123,15 @@ module Google
124
123
  ##
125
124
  # Create a new LoggingService client object.
126
125
  #
127
- # ## Examples
128
- #
129
- # To create a new LoggingService client with the default
130
- # configuration:
126
+ # @example
131
127
  #
132
- # client = ::Google::Cloud::Logging::V2::LoggingService::Client.new
128
+ # # Create a client using the default configuration
129
+ # client = ::Google::Cloud::Logging::V2::LoggingService::Client.new
133
130
  #
134
- # To create a new LoggingService client with a custom
135
- # configuration:
136
- #
137
- # client = ::Google::Cloud::Logging::V2::LoggingService::Client.new do |config|
138
- # config.timeout = 10.0
139
- # end
131
+ # # Create a client using a custom configuration
132
+ # client = ::Google::Cloud::Logging::V2::LoggingService::Client.new do |config|
133
+ # config.timeout = 10.0
134
+ # end
140
135
  #
141
136
  # @yield [config] Configure the LoggingService client.
142
137
  # @yieldparam config [Client::Configuration]
@@ -156,10 +151,9 @@ module Google
156
151
 
157
152
  # Create credentials
158
153
  credentials = @config.credentials
159
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
154
+ # Use self-signed JWT if the endpoint is unchanged from default,
160
155
  # but only if the default endpoint does not have a region prefix.
161
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
162
- @config.endpoint == Client.configure.endpoint &&
156
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
163
157
  !@config.endpoint.split(".").first.include?("-")
164
158
  credentials ||= Credentials.default scope: @config.scope,
165
159
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -181,10 +175,10 @@ module Google
181
175
  # Service calls
182
176
 
183
177
  ##
184
- # Deletes all the log entries in a log. The log reappears if it receives new
185
- # entries. Log entries written shortly before the delete operation might not
186
- # be deleted. Entries received after the delete operation with a timestamp
187
- # before the operation will be deleted.
178
+ # Deletes all the log entries in a log for the _Default Log Bucket. The log
179
+ # reappears if it receives new entries. Log entries written shortly before
180
+ # the delete operation might not be deleted. Entries received after the
181
+ # delete operation with a timestamp before the operation will be deleted.
188
182
  #
189
183
  # @overload delete_log(request, options = nil)
190
184
  # Pass arguments to `delete_log` via a request object, either of type
@@ -204,14 +198,15 @@ module Google
204
198
  # @param log_name [::String]
205
199
  # Required. The resource name of the log to delete:
206
200
  #
207
- # "projects/[PROJECT_ID]/logs/[LOG_ID]"
208
- # "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
209
- # "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
210
- # "folders/[FOLDER_ID]/logs/[LOG_ID]"
201
+ # * `projects/[PROJECT_ID]/logs/[LOG_ID]`
202
+ # * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]`
203
+ # * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]`
204
+ # * `folders/[FOLDER_ID]/logs/[LOG_ID]`
211
205
  #
212
206
  # `[LOG_ID]` must be URL-encoded. For example,
213
207
  # `"projects/my-project-id/logs/syslog"`,
214
- # `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
208
+ # `"organizations/123/logs/cloudaudit.googleapis.com%2Factivity"`.
209
+ #
215
210
  # For more information about log names, see
216
211
  # {::Google::Cloud::Logging::V2::LogEntry LogEntry}.
217
212
  #
@@ -223,6 +218,21 @@ module Google
223
218
  #
224
219
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
225
220
  #
221
+ # @example Basic example
222
+ # require "google/cloud/logging/v2"
223
+ #
224
+ # # Create a client object. The client can be reused for multiple calls.
225
+ # client = Google::Cloud::Logging::V2::LoggingService::Client.new
226
+ #
227
+ # # Create a request. To set request fields, pass in keyword arguments.
228
+ # request = Google::Cloud::Logging::V2::DeleteLogRequest.new
229
+ #
230
+ # # Call the delete_log method.
231
+ # result = client.delete_log request
232
+ #
233
+ # # The returned object is of type Google::Protobuf::Empty.
234
+ # p result
235
+ #
226
236
  def delete_log request, options = nil
227
237
  raise ::ArgumentError, "request must be provided" if request.nil?
228
238
 
@@ -240,16 +250,20 @@ module Google
240
250
  gapic_version: ::Google::Cloud::Logging::V2::VERSION
241
251
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
242
252
 
243
- header_params = {
244
- "log_name" => request.log_name
245
- }
253
+ header_params = {}
254
+ if request.log_name
255
+ header_params["log_name"] = request.log_name
256
+ end
257
+
246
258
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
247
259
  metadata[:"x-goog-request-params"] ||= request_params_header
248
260
 
249
261
  options.apply_defaults timeout: @config.rpcs.delete_log.timeout,
250
262
  metadata: metadata,
251
263
  retry_policy: @config.rpcs.delete_log.retry_policy
252
- options.apply_defaults metadata: @config.metadata,
264
+
265
+ options.apply_defaults timeout: @config.timeout,
266
+ metadata: @config.metadata,
253
267
  retry_policy: @config.retry_policy
254
268
 
255
269
  @logging_service_stub.call_rpc :delete_log, request, options: options do |response, operation|
@@ -288,15 +302,15 @@ module Google
288
302
  # Optional. A default log resource name that is assigned to all log entries
289
303
  # in `entries` that do not specify a value for `log_name`:
290
304
  #
291
- # "projects/[PROJECT_ID]/logs/[LOG_ID]"
292
- # "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
293
- # "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
294
- # "folders/[FOLDER_ID]/logs/[LOG_ID]"
305
+ # * `projects/[PROJECT_ID]/logs/[LOG_ID]`
306
+ # * `organizations/[ORGANIZATION_ID]/logs/[LOG_ID]`
307
+ # * `billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]`
308
+ # * `folders/[FOLDER_ID]/logs/[LOG_ID]`
295
309
  #
296
310
  # `[LOG_ID]` must be URL-encoded. For example:
297
311
  #
298
312
  # "projects/my-project-id/logs/syslog"
299
- # "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"
313
+ # "organizations/123/logs/cloudaudit.googleapis.com%2Factivity"
300
314
  #
301
315
  # The permission `logging.logEntries.create` is needed on each project,
302
316
  # organization, billing account, or folder that is receiving new log
@@ -331,14 +345,14 @@ module Google
331
345
  # the entries later in the list. See the `entries.list` method.
332
346
  #
333
347
  # Log entries with timestamps that are more than the
334
- # [logs retention period](https://cloud.google.com/logging/quota-policy) in
348
+ # [logs retention period](https://cloud.google.com/logging/quotas) in
335
349
  # the past or more than 24 hours in the future will not be available when
336
350
  # calling `entries.list`. However, those log entries can still be [exported
337
351
  # with
338
352
  # LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
339
353
  #
340
354
  # To improve throughput and to avoid exceeding the
341
- # [quota limit](https://cloud.google.com/logging/quota-policy) for calls to
355
+ # [quota limit](https://cloud.google.com/logging/quotas) for calls to
342
356
  # `entries.write`, you should try to include several log entries in this
343
357
  # list, rather than calling this method for each individual log entry.
344
358
  # @param partial_success [::Boolean]
@@ -360,6 +374,21 @@ module Google
360
374
  #
361
375
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
362
376
  #
377
+ # @example Basic example
378
+ # require "google/cloud/logging/v2"
379
+ #
380
+ # # Create a client object. The client can be reused for multiple calls.
381
+ # client = Google::Cloud::Logging::V2::LoggingService::Client.new
382
+ #
383
+ # # Create a request. To set request fields, pass in keyword arguments.
384
+ # request = Google::Cloud::Logging::V2::WriteLogEntriesRequest.new
385
+ #
386
+ # # Call the write_log_entries method.
387
+ # result = client.write_log_entries request
388
+ #
389
+ # # The returned object is of type Google::Cloud::Logging::V2::WriteLogEntriesResponse.
390
+ # p result
391
+ #
363
392
  def write_log_entries request, options = nil
364
393
  raise ::ArgumentError, "request must be provided" if request.nil?
365
394
 
@@ -380,7 +409,9 @@ module Google
380
409
  options.apply_defaults timeout: @config.rpcs.write_log_entries.timeout,
381
410
  metadata: metadata,
382
411
  retry_policy: @config.rpcs.write_log_entries.retry_policy
383
- options.apply_defaults metadata: @config.metadata,
412
+
413
+ options.apply_defaults timeout: @config.timeout,
414
+ metadata: @config.metadata,
384
415
  retry_policy: @config.retry_policy
385
416
 
386
417
  @logging_service_stub.call_rpc :write_log_entries, request, options: options do |response, operation|
@@ -416,16 +447,17 @@ module Google
416
447
  # Required. Names of one or more parent resources from which to
417
448
  # retrieve log entries:
418
449
  #
419
- # "projects/[PROJECT_ID]"
420
- # "organizations/[ORGANIZATION_ID]"
421
- # "billingAccounts/[BILLING_ACCOUNT_ID]"
422
- # "folders/[FOLDER_ID]"
450
+ # * `projects/[PROJECT_ID]`
451
+ # * `organizations/[ORGANIZATION_ID]`
452
+ # * `billingAccounts/[BILLING_ACCOUNT_ID]`
453
+ # * `folders/[FOLDER_ID]`
423
454
  #
424
- # May alternatively be one or more views
425
- # projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
426
- # organization/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
427
- # billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
428
- # folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
455
+ # May alternatively be one or more views:
456
+ #
457
+ # * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
458
+ # * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
459
+ # * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
460
+ # * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
429
461
  #
430
462
  # Projects listed in the `project_ids` field are added to this list.
431
463
  # @param filter [::String]
@@ -444,10 +476,10 @@ module Google
444
476
  # in order of decreasing timestamps (newest first). Entries with equal
445
477
  # timestamps are returned in order of their `insert_id` values.
446
478
  # @param page_size [::Integer]
447
- # Optional. The maximum number of results to return from this request.
448
- # Default is 50. If the value is negative or exceeds 1000,
449
- # the request is rejected. The presence of `next_page_token` in the
450
- # response indicates that more results might be available.
479
+ # Optional. The maximum number of results to return from this request. Default is 50.
480
+ # If the value is negative or exceeds 1000, the request is rejected. The
481
+ # presence of `next_page_token` in the response indicates that more results
482
+ # might be available.
451
483
  # @param page_token [::String]
452
484
  # Optional. If present, then retrieve the next batch of results from the
453
485
  # preceding call to this method. `page_token` must be the value of
@@ -462,6 +494,27 @@ module Google
462
494
  #
463
495
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
464
496
  #
497
+ # @example Basic example
498
+ # require "google/cloud/logging/v2"
499
+ #
500
+ # # Create a client object. The client can be reused for multiple calls.
501
+ # client = Google::Cloud::Logging::V2::LoggingService::Client.new
502
+ #
503
+ # # Create a request. To set request fields, pass in keyword arguments.
504
+ # request = Google::Cloud::Logging::V2::ListLogEntriesRequest.new
505
+ #
506
+ # # Call the list_log_entries method.
507
+ # result = client.list_log_entries request
508
+ #
509
+ # # The returned object is of type Gapic::PagedEnumerable. You can
510
+ # # iterate over all elements by calling #each, and the enumerable
511
+ # # will lazily make API calls to fetch subsequent pages. Other
512
+ # # methods are also available for managing paging directly.
513
+ # result.each do |response|
514
+ # # Each element is of type ::Google::Cloud::Logging::V2::LogEntry.
515
+ # p response
516
+ # end
517
+ #
465
518
  def list_log_entries request, options = nil
466
519
  raise ::ArgumentError, "request must be provided" if request.nil?
467
520
 
@@ -482,7 +535,9 @@ module Google
482
535
  options.apply_defaults timeout: @config.rpcs.list_log_entries.timeout,
483
536
  metadata: metadata,
484
537
  retry_policy: @config.rpcs.list_log_entries.retry_policy
485
- options.apply_defaults metadata: @config.metadata,
538
+
539
+ options.apply_defaults timeout: @config.timeout,
540
+ metadata: @config.metadata,
486
541
  retry_policy: @config.retry_policy
487
542
 
488
543
  @logging_service_stub.call_rpc :list_log_entries, request, options: options do |response, operation|
@@ -530,6 +585,27 @@ module Google
530
585
  #
531
586
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
532
587
  #
588
+ # @example Basic example
589
+ # require "google/cloud/logging/v2"
590
+ #
591
+ # # Create a client object. The client can be reused for multiple calls.
592
+ # client = Google::Cloud::Logging::V2::LoggingService::Client.new
593
+ #
594
+ # # Create a request. To set request fields, pass in keyword arguments.
595
+ # request = Google::Cloud::Logging::V2::ListMonitoredResourceDescriptorsRequest.new
596
+ #
597
+ # # Call the list_monitored_resource_descriptors method.
598
+ # result = client.list_monitored_resource_descriptors request
599
+ #
600
+ # # The returned object is of type Gapic::PagedEnumerable. You can
601
+ # # iterate over all elements by calling #each, and the enumerable
602
+ # # will lazily make API calls to fetch subsequent pages. Other
603
+ # # methods are also available for managing paging directly.
604
+ # result.each do |response|
605
+ # # Each element is of type ::Google::Api::MonitoredResourceDescriptor.
606
+ # p response
607
+ # end
608
+ #
533
609
  def list_monitored_resource_descriptors request, options = nil
534
610
  raise ::ArgumentError, "request must be provided" if request.nil?
535
611
 
@@ -550,7 +626,9 @@ module Google
550
626
  options.apply_defaults timeout: @config.rpcs.list_monitored_resource_descriptors.timeout,
551
627
  metadata: metadata,
552
628
  retry_policy: @config.rpcs.list_monitored_resource_descriptors.retry_policy
553
- options.apply_defaults metadata: @config.metadata,
629
+
630
+ options.apply_defaults timeout: @config.timeout,
631
+ metadata: @config.metadata,
554
632
  retry_policy: @config.retry_policy
555
633
 
556
634
  @logging_service_stub.call_rpc :list_monitored_resource_descriptors, request, options: options do |response, operation|
@@ -584,10 +662,10 @@ module Google
584
662
  # @param parent [::String]
585
663
  # Required. The resource name that owns the logs:
586
664
  #
587
- # "projects/[PROJECT_ID]"
588
- # "organizations/[ORGANIZATION_ID]"
589
- # "billingAccounts/[BILLING_ACCOUNT_ID]"
590
- # "folders/[FOLDER_ID]"
665
+ # * `projects/[PROJECT_ID]`
666
+ # * `organizations/[ORGANIZATION_ID]`
667
+ # * `billingAccounts/[BILLING_ACCOUNT_ID]`
668
+ # * `folders/[FOLDER_ID]`
591
669
  # @param page_size [::Integer]
592
670
  # Optional. The maximum number of results to return from this request.
593
671
  # Non-positive values are ignored. The presence of `nextPageToken` in the
@@ -599,16 +677,18 @@ module Google
599
677
  # parameters should be identical to those in the previous call.
600
678
  # @param resource_names [::Array<::String>]
601
679
  # Optional. The resource name that owns the logs:
602
- # projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
603
- # organization/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
604
- # billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
605
- # folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
680
+ #
681
+ # * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
682
+ # * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
683
+ # * `billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
684
+ # * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
606
685
  #
607
686
  # To support legacy queries, it could also be:
608
- # "projects/[PROJECT_ID]"
609
- # "organizations/[ORGANIZATION_ID]"
610
- # "billingAccounts/[BILLING_ACCOUNT_ID]"
611
- # "folders/[FOLDER_ID]"
687
+ #
688
+ # * `projects/[PROJECT_ID]`
689
+ # * `organizations/[ORGANIZATION_ID]`
690
+ # * `billingAccounts/[BILLING_ACCOUNT_ID]`
691
+ # * `folders/[FOLDER_ID]`
612
692
  #
613
693
  # @yield [response, operation] Access the result along with the RPC operation
614
694
  # @yieldparam response [::Google::Cloud::Logging::V2::ListLogsResponse]
@@ -618,6 +698,21 @@ module Google
618
698
  #
619
699
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
620
700
  #
701
+ # @example Basic example
702
+ # require "google/cloud/logging/v2"
703
+ #
704
+ # # Create a client object. The client can be reused for multiple calls.
705
+ # client = Google::Cloud::Logging::V2::LoggingService::Client.new
706
+ #
707
+ # # Create a request. To set request fields, pass in keyword arguments.
708
+ # request = Google::Cloud::Logging::V2::ListLogsRequest.new
709
+ #
710
+ # # Call the list_logs method.
711
+ # result = client.list_logs request
712
+ #
713
+ # # The returned object is of type Google::Cloud::Logging::V2::ListLogsResponse.
714
+ # p result
715
+ #
621
716
  def list_logs request, options = nil
622
717
  raise ::ArgumentError, "request must be provided" if request.nil?
623
718
 
@@ -635,16 +730,20 @@ module Google
635
730
  gapic_version: ::Google::Cloud::Logging::V2::VERSION
636
731
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
637
732
 
638
- header_params = {
639
- "parent" => request.parent
640
- }
733
+ header_params = {}
734
+ if request.parent
735
+ header_params["parent"] = request.parent
736
+ end
737
+
641
738
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
642
739
  metadata[:"x-goog-request-params"] ||= request_params_header
643
740
 
644
741
  options.apply_defaults timeout: @config.rpcs.list_logs.timeout,
645
742
  metadata: metadata,
646
743
  retry_policy: @config.rpcs.list_logs.retry_policy
647
- options.apply_defaults metadata: @config.metadata,
744
+
745
+ options.apply_defaults timeout: @config.timeout,
746
+ metadata: @config.metadata,
648
747
  retry_policy: @config.retry_policy
649
748
 
650
749
  @logging_service_stub.call_rpc :list_logs, request, options: options do |response, operation|
@@ -672,6 +771,30 @@ module Google
672
771
  #
673
772
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
674
773
  #
774
+ # @example Basic example
775
+ # require "google/cloud/logging/v2"
776
+ #
777
+ # # Create a client object. The client can be reused for multiple calls.
778
+ # client = Google::Cloud::Logging::V2::LoggingService::Client.new
779
+ #
780
+ # # Create an input stream
781
+ # input = Gapic::StreamInput.new
782
+ #
783
+ # # Call the tail_log_entries method to start streaming.
784
+ # output = client.tail_log_entries input
785
+ #
786
+ # # Send requests on the stream. For each request, pass in keyword
787
+ # # arguments to set fields. Be sure to close the stream when done.
788
+ # input << Google::Cloud::Logging::V2::TailLogEntriesRequest.new
789
+ # input << Google::Cloud::Logging::V2::TailLogEntriesRequest.new
790
+ # input.close
791
+ #
792
+ # # Handle streamed responses. These may be interleaved with inputs.
793
+ # # Each response is of type ::Google::Cloud::Logging::V2::TailLogEntriesResponse.
794
+ # output.each do |response|
795
+ # p response
796
+ # end
797
+ #
675
798
  def tail_log_entries request, options = nil
676
799
  unless request.is_a? ::Enumerable
677
800
  raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum
@@ -697,7 +820,9 @@ module Google
697
820
  options.apply_defaults timeout: @config.rpcs.tail_log_entries.timeout,
698
821
  metadata: metadata,
699
822
  retry_policy: @config.rpcs.tail_log_entries.retry_policy
700
- options.apply_defaults metadata: @config.metadata,
823
+
824
+ options.apply_defaults timeout: @config.timeout,
825
+ metadata: @config.metadata,
701
826
  retry_policy: @config.retry_policy
702
827
 
703
828
  @logging_service_stub.call_rpc :tail_log_entries, request, options: options do |response, operation|
@@ -721,22 +846,21 @@ module Google
721
846
  # Configuration can be applied globally to all clients, or to a single client
722
847
  # on construction.
723
848
  #
724
- # # Examples
725
- #
726
- # To modify the global config, setting the timeout for delete_log
727
- # to 20 seconds, and all remaining timeouts to 10 seconds:
728
- #
729
- # ::Google::Cloud::Logging::V2::LoggingService::Client.configure do |config|
730
- # config.timeout = 10.0
731
- # config.rpcs.delete_log.timeout = 20.0
732
- # end
733
- #
734
- # To apply the above configuration only to a new client:
735
- #
736
- # client = ::Google::Cloud::Logging::V2::LoggingService::Client.new do |config|
737
- # config.timeout = 10.0
738
- # config.rpcs.delete_log.timeout = 20.0
739
- # end
849
+ # @example
850
+ #
851
+ # # Modify the global config, setting the timeout for
852
+ # # delete_log to 20 seconds,
853
+ # # and all remaining timeouts to 10 seconds.
854
+ # ::Google::Cloud::Logging::V2::LoggingService::Client.configure do |config|
855
+ # config.timeout = 10.0
856
+ # config.rpcs.delete_log.timeout = 20.0
857
+ # end
858
+ #
859
+ # # Apply the above configuration only to a new client.
860
+ # client = ::Google::Cloud::Logging::V2::LoggingService::Client.new do |config|
861
+ # config.timeout = 10.0
862
+ # config.rpcs.delete_log.timeout = 20.0
863
+ # end
740
864
  #
741
865
  # @!attribute [rw] endpoint
742
866
  # The hostname or hostname:port of the service endpoint.