google-cloud-logging-v2 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/google/cloud/logging/v2/logging_service/client.rb +86 -1
- data/lib/google/cloud/logging/v2/version.rb +1 -1
- data/lib/google/logging/v2/logging_pb.rb +23 -0
- data/lib/google/logging/v2/logging_services_pb.rb +3 -0
- data/proto_docs/google/logging/v2/logging.rb +99 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ce53e2503c512bc545694449e4238761c2dd4bf041533908147a00f5f3519f6
|
4
|
+
data.tar.gz: bfd9c950f2714023d5cca41896271b5108cca0cedc45ef28475a3084b6773001
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 69c21ca6f0b6b1bd86581cdf2ac5667dcbdb1ef48916e1a92fd55bd0c9691633e82bb45cce08fb0aa2d02075edb9400b7fb1a1050a68cf70f52a15da32dbed04
|
7
|
+
data.tar.gz: 3facb8a86a51a6fcb7fbbabc202f6a9df9718bff690bfb3f65fbf863912dbfc8bd21a135fb81928fc67f4adf574d781e11edbca62be12a7191728fa870e6bcdb
|
@@ -105,6 +105,14 @@ module Google
|
|
105
105
|
retry_codes: [4, 13, 14]
|
106
106
|
}
|
107
107
|
|
108
|
+
default_config.rpcs.tail_log_entries.timeout = 3600.0
|
109
|
+
default_config.rpcs.tail_log_entries.retry_policy = {
|
110
|
+
initial_delay: 0.1,
|
111
|
+
max_delay: 60.0,
|
112
|
+
multiplier: 1.3,
|
113
|
+
retry_codes: [4, 13, 14]
|
114
|
+
}
|
115
|
+
|
108
116
|
default_config
|
109
117
|
end
|
110
118
|
yield @configure if block_given?
|
@@ -425,6 +433,11 @@ module Google
|
|
425
433
|
# "billingAccounts/[BILLING_ACCOUNT_ID]"
|
426
434
|
# "folders/[FOLDER_ID]"
|
427
435
|
#
|
436
|
+
# May alternatively be one or more views
|
437
|
+
# projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
|
438
|
+
# organization/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
|
439
|
+
# billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
|
440
|
+
# folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
|
428
441
|
#
|
429
442
|
# Projects listed in the `project_ids` field are added to this list.
|
430
443
|
# @param filter [::String]
|
@@ -575,7 +588,7 @@ module Google
|
|
575
588
|
# @param options [::Gapic::CallOptions, ::Hash]
|
576
589
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
577
590
|
#
|
578
|
-
# @overload list_logs(parent: nil, page_size: nil, page_token: nil)
|
591
|
+
# @overload list_logs(parent: nil, page_size: nil, page_token: nil, resource_names: nil)
|
579
592
|
# Pass arguments to `list_logs` via keyword arguments. Note that at
|
580
593
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
581
594
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
@@ -596,6 +609,18 @@ module Google
|
|
596
609
|
# preceding call to this method. `pageToken` must be the value of
|
597
610
|
# `nextPageToken` from the previous response. The values of other method
|
598
611
|
# parameters should be identical to those in the previous call.
|
612
|
+
# @param resource_names [::Array<::String>]
|
613
|
+
# Optional. The resource name that owns the logs:
|
614
|
+
# projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
|
615
|
+
# organization/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
|
616
|
+
# billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
|
617
|
+
# folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
|
618
|
+
#
|
619
|
+
# To support legacy queries, it could also be:
|
620
|
+
# "projects/[PROJECT_ID]"
|
621
|
+
# "organizations/[ORGANIZATION_ID]"
|
622
|
+
# "billingAccounts/[BILLING_ACCOUNT_ID]"
|
623
|
+
# "folders/[FOLDER_ID]"
|
599
624
|
#
|
600
625
|
# @yield [response, operation] Access the result along with the RPC operation
|
601
626
|
# @yieldparam response [::Google::Cloud::Logging::V2::ListLogsResponse]
|
@@ -642,6 +667,59 @@ module Google
|
|
642
667
|
raise ::Google::Cloud::Error.from_error(e)
|
643
668
|
end
|
644
669
|
|
670
|
+
##
|
671
|
+
# Streaming read of log entries as they are ingested. Until the stream is
|
672
|
+
# terminated, it will continue reading logs.
|
673
|
+
#
|
674
|
+
# @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::Logging::V2::TailLogEntriesRequest, ::Hash>]
|
675
|
+
# An enumerable of {::Google::Cloud::Logging::V2::TailLogEntriesRequest} instances.
|
676
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
677
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
678
|
+
#
|
679
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
680
|
+
# @yieldparam response [::Enumerable<::Google::Cloud::Logging::V2::TailLogEntriesResponse>]
|
681
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
682
|
+
#
|
683
|
+
# @return [::Enumerable<::Google::Cloud::Logging::V2::TailLogEntriesResponse>]
|
684
|
+
#
|
685
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
686
|
+
#
|
687
|
+
def tail_log_entries request, options = nil
|
688
|
+
unless request.is_a? ::Enumerable
|
689
|
+
raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum
|
690
|
+
request = request.to_enum
|
691
|
+
end
|
692
|
+
|
693
|
+
request = request.lazy.map do |req|
|
694
|
+
::Gapic::Protobuf.coerce req, to: ::Google::Cloud::Logging::V2::TailLogEntriesRequest
|
695
|
+
end
|
696
|
+
|
697
|
+
# Converts hash and nil to an options object
|
698
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
699
|
+
|
700
|
+
# Customize the options with defaults
|
701
|
+
metadata = @config.rpcs.tail_log_entries.metadata.to_h
|
702
|
+
|
703
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
704
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
705
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
706
|
+
gapic_version: ::Google::Cloud::Logging::V2::VERSION
|
707
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
708
|
+
|
709
|
+
options.apply_defaults timeout: @config.rpcs.tail_log_entries.timeout,
|
710
|
+
metadata: metadata,
|
711
|
+
retry_policy: @config.rpcs.tail_log_entries.retry_policy
|
712
|
+
options.apply_defaults metadata: @config.metadata,
|
713
|
+
retry_policy: @config.retry_policy
|
714
|
+
|
715
|
+
@logging_service_stub.call_rpc :tail_log_entries, request, options: options do |response, operation|
|
716
|
+
yield response, operation if block_given?
|
717
|
+
return response
|
718
|
+
end
|
719
|
+
rescue ::GRPC::BadStatus => e
|
720
|
+
raise ::Google::Cloud::Error.from_error(e)
|
721
|
+
end
|
722
|
+
|
645
723
|
##
|
646
724
|
# Configuration class for the LoggingService API.
|
647
725
|
#
|
@@ -803,6 +881,11 @@ module Google
|
|
803
881
|
# @return [::Gapic::Config::Method]
|
804
882
|
#
|
805
883
|
attr_reader :list_logs
|
884
|
+
##
|
885
|
+
# RPC-specific configuration for `tail_log_entries`
|
886
|
+
# @return [::Gapic::Config::Method]
|
887
|
+
#
|
888
|
+
attr_reader :tail_log_entries
|
806
889
|
|
807
890
|
# @private
|
808
891
|
def initialize parent_rpcs = nil
|
@@ -816,6 +899,8 @@ module Google
|
|
816
899
|
@list_monitored_resource_descriptors = ::Gapic::Config::Method.new list_monitored_resource_descriptors_config
|
817
900
|
list_logs_config = parent_rpcs&.list_logs if parent_rpcs&.respond_to? :list_logs
|
818
901
|
@list_logs = ::Gapic::Config::Method.new list_logs_config
|
902
|
+
tail_log_entries_config = parent_rpcs&.tail_log_entries if parent_rpcs&.respond_to? :tail_log_entries
|
903
|
+
@tail_log_entries = ::Gapic::Config::Method.new tail_log_entries_config
|
819
904
|
|
820
905
|
yield self if block_given?
|
821
906
|
end
|
@@ -56,11 +56,30 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
56
56
|
optional :parent, :string, 1
|
57
57
|
optional :page_size, :int32, 2
|
58
58
|
optional :page_token, :string, 3
|
59
|
+
repeated :resource_names, :string, 8
|
59
60
|
end
|
60
61
|
add_message "google.logging.v2.ListLogsResponse" do
|
61
62
|
repeated :log_names, :string, 3
|
62
63
|
optional :next_page_token, :string, 2
|
63
64
|
end
|
65
|
+
add_message "google.logging.v2.TailLogEntriesRequest" do
|
66
|
+
repeated :resource_names, :string, 1
|
67
|
+
optional :filter, :string, 2
|
68
|
+
optional :buffer_window, :message, 3, "google.protobuf.Duration"
|
69
|
+
end
|
70
|
+
add_message "google.logging.v2.TailLogEntriesResponse" do
|
71
|
+
repeated :entries, :message, 1, "google.logging.v2.LogEntry"
|
72
|
+
repeated :suppression_info, :message, 2, "google.logging.v2.TailLogEntriesResponse.SuppressionInfo"
|
73
|
+
end
|
74
|
+
add_message "google.logging.v2.TailLogEntriesResponse.SuppressionInfo" do
|
75
|
+
optional :reason, :enum, 1, "google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason"
|
76
|
+
optional :suppressed_count, :int32, 2
|
77
|
+
end
|
78
|
+
add_enum "google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason" do
|
79
|
+
value :REASON_UNSPECIFIED, 0
|
80
|
+
value :RATE_LIMIT, 1
|
81
|
+
value :NOT_CONSUMED, 2
|
82
|
+
end
|
64
83
|
end
|
65
84
|
end
|
66
85
|
|
@@ -78,6 +97,10 @@ module Google
|
|
78
97
|
ListMonitoredResourceDescriptorsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.ListMonitoredResourceDescriptorsResponse").msgclass
|
79
98
|
ListLogsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.ListLogsRequest").msgclass
|
80
99
|
ListLogsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.ListLogsResponse").msgclass
|
100
|
+
TailLogEntriesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.TailLogEntriesRequest").msgclass
|
101
|
+
TailLogEntriesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.TailLogEntriesResponse").msgclass
|
102
|
+
TailLogEntriesResponse::SuppressionInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.TailLogEntriesResponse.SuppressionInfo").msgclass
|
103
|
+
TailLogEntriesResponse::SuppressionInfo::Reason = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.logging.v2.TailLogEntriesResponse.SuppressionInfo.Reason").enummodule
|
81
104
|
end
|
82
105
|
end
|
83
106
|
end
|
@@ -56,6 +56,9 @@ module Google
|
|
56
56
|
# Lists the logs in projects, organizations, folders, or billing accounts.
|
57
57
|
# Only logs that have entries are listed.
|
58
58
|
rpc :ListLogs, ::Google::Cloud::Logging::V2::ListLogsRequest, ::Google::Cloud::Logging::V2::ListLogsResponse
|
59
|
+
# Streaming read of log entries as they are ingested. Until the stream is
|
60
|
+
# terminated, it will continue reading logs.
|
61
|
+
rpc :TailLogEntries, stream(::Google::Cloud::Logging::V2::TailLogEntriesRequest), stream(::Google::Cloud::Logging::V2::TailLogEntriesResponse)
|
59
62
|
end
|
60
63
|
|
61
64
|
Stub = Service.rpc_stub_class
|
@@ -169,6 +169,11 @@ module Google
|
|
169
169
|
# "billingAccounts/[BILLING_ACCOUNT_ID]"
|
170
170
|
# "folders/[FOLDER_ID]"
|
171
171
|
#
|
172
|
+
# May alternatively be one or more views
|
173
|
+
# projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
|
174
|
+
# organization/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
|
175
|
+
# billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
|
176
|
+
# folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
|
172
177
|
#
|
173
178
|
# Projects listed in the `project_ids` field are added to this list.
|
174
179
|
# @!attribute [rw] filter
|
@@ -279,6 +284,19 @@ module Google
|
|
279
284
|
# preceding call to this method. `pageToken` must be the value of
|
280
285
|
# `nextPageToken` from the previous response. The values of other method
|
281
286
|
# parameters should be identical to those in the previous call.
|
287
|
+
# @!attribute [rw] resource_names
|
288
|
+
# @return [::Array<::String>]
|
289
|
+
# Optional. The resource name that owns the logs:
|
290
|
+
# projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
|
291
|
+
# organization/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
|
292
|
+
# billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
|
293
|
+
# folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
|
294
|
+
#
|
295
|
+
# To support legacy queries, it could also be:
|
296
|
+
# "projects/[PROJECT_ID]"
|
297
|
+
# "organizations/[ORGANIZATION_ID]"
|
298
|
+
# "billingAccounts/[BILLING_ACCOUNT_ID]"
|
299
|
+
# "folders/[FOLDER_ID]"
|
282
300
|
class ListLogsRequest
|
283
301
|
include ::Google::Protobuf::MessageExts
|
284
302
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -299,6 +317,87 @@ module Google
|
|
299
317
|
include ::Google::Protobuf::MessageExts
|
300
318
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
301
319
|
end
|
320
|
+
|
321
|
+
# The parameters to `TailLogEntries`.
|
322
|
+
# @!attribute [rw] resource_names
|
323
|
+
# @return [::Array<::String>]
|
324
|
+
# Required. Name of a parent resource from which to retrieve log entries:
|
325
|
+
#
|
326
|
+
# "projects/[PROJECT_ID]"
|
327
|
+
# "organizations/[ORGANIZATION_ID]"
|
328
|
+
# "billingAccounts/[BILLING_ACCOUNT_ID]"
|
329
|
+
# "folders/[FOLDER_ID]"
|
330
|
+
#
|
331
|
+
# May alternatively be one or more views:
|
332
|
+
# "projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
|
333
|
+
# "organization/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
|
334
|
+
# "billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
|
335
|
+
# "folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]"
|
336
|
+
# @!attribute [rw] filter
|
337
|
+
# @return [::String]
|
338
|
+
# Optional. A filter that chooses which log entries to return. See [Advanced
|
339
|
+
# Logs Filters](https://cloud.google.com/logging/docs/view/advanced_filters).
|
340
|
+
# Only log entries that match the filter are returned. An empty filter
|
341
|
+
# matches all log entries in the resources listed in `resource_names`.
|
342
|
+
# Referencing a parent resource that is not in `resource_names` will cause
|
343
|
+
# the filter to return no results. The maximum length of the filter is 20000
|
344
|
+
# characters.
|
345
|
+
# @!attribute [rw] buffer_window
|
346
|
+
# @return [::Google::Protobuf::Duration]
|
347
|
+
# Optional. The amount of time to buffer log entries at the server before
|
348
|
+
# being returned to prevent out of order results due to late arriving log
|
349
|
+
# entries. Valid values are between 0-60000 milliseconds. Defaults to 2000
|
350
|
+
# milliseconds.
|
351
|
+
class TailLogEntriesRequest
|
352
|
+
include ::Google::Protobuf::MessageExts
|
353
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
354
|
+
end
|
355
|
+
|
356
|
+
# Result returned from `TailLogEntries`.
|
357
|
+
# @!attribute [rw] entries
|
358
|
+
# @return [::Array<::Google::Cloud::Logging::V2::LogEntry>]
|
359
|
+
# A list of log entries. Each response in the stream will order entries with
|
360
|
+
# increasing values of `LogEntry.timestamp`. Ordering is not guaranteed
|
361
|
+
# between separate responses.
|
362
|
+
# @!attribute [rw] suppression_info
|
363
|
+
# @return [::Array<::Google::Cloud::Logging::V2::TailLogEntriesResponse::SuppressionInfo>]
|
364
|
+
# If entries that otherwise would have been included in the session were not
|
365
|
+
# sent back to the client, counts of relevant entries omitted from the
|
366
|
+
# session with the reason that they were not included. There will be at most
|
367
|
+
# one of each reason per response. The counts represent the number of
|
368
|
+
# suppressed entries since the last streamed response.
|
369
|
+
class TailLogEntriesResponse
|
370
|
+
include ::Google::Protobuf::MessageExts
|
371
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
372
|
+
|
373
|
+
# Information about entries that were omitted from the session.
|
374
|
+
# @!attribute [rw] reason
|
375
|
+
# @return [::Google::Cloud::Logging::V2::TailLogEntriesResponse::SuppressionInfo::Reason]
|
376
|
+
# The reason that entries were omitted from the session.
|
377
|
+
# @!attribute [rw] suppressed_count
|
378
|
+
# @return [::Integer]
|
379
|
+
# A lower bound on the count of entries omitted due to `reason`.
|
380
|
+
class SuppressionInfo
|
381
|
+
include ::Google::Protobuf::MessageExts
|
382
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
383
|
+
|
384
|
+
# An indicator of why entries were omitted.
|
385
|
+
module Reason
|
386
|
+
# Unexpected default.
|
387
|
+
REASON_UNSPECIFIED = 0
|
388
|
+
|
389
|
+
# Indicates suppression occurred due to relevant entries being
|
390
|
+
# received in excess of rate limits. For quotas and limits, see
|
391
|
+
# [Logging API quotas and
|
392
|
+
# limits](https://cloud.google.com/logging/quotas#api-limits).
|
393
|
+
RATE_LIMIT = 1
|
394
|
+
|
395
|
+
# Indicates suppression occurred due to the client not consuming
|
396
|
+
# responses quickly enough.
|
397
|
+
NOT_CONSUMED = 2
|
398
|
+
end
|
399
|
+
end
|
400
|
+
end
|
302
401
|
end
|
303
402
|
end
|
304
403
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-logging-v2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gapic-common
|