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
@@ -158,13 +158,11 @@ module Google
|
|
158
158
|
# # Call the list_operations method.
|
159
159
|
# result = client.list_operations request
|
160
160
|
#
|
161
|
-
# # The returned object is of type Gapic::PagedEnumerable. You can
|
162
|
-
# #
|
163
|
-
#
|
164
|
-
# # methods are also available for managing paging directly.
|
165
|
-
# result.each do |response|
|
161
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
162
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
163
|
+
# result.each do |item|
|
166
164
|
# # Each element is of type ::Google::Longrunning::Operation.
|
167
|
-
# p
|
165
|
+
# p item
|
168
166
|
# end
|
169
167
|
#
|
170
168
|
def list_operations request, options = nil
|
@@ -253,14 +251,14 @@ module Google
|
|
253
251
|
# # Call the get_operation method.
|
254
252
|
# result = client.get_operation request
|
255
253
|
#
|
256
|
-
# # The returned object is of type Gapic::Operation. You can use
|
257
|
-
# #
|
258
|
-
# #
|
254
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
255
|
+
# # check the status of an operation, cancel it, or wait for results.
|
256
|
+
# # Here is how to wait for a response.
|
259
257
|
# result.wait_until_done! timeout: 60
|
260
258
|
# if result.response?
|
261
259
|
# p result.response
|
262
260
|
# else
|
263
|
-
# puts "
|
261
|
+
# puts "No response received."
|
264
262
|
# end
|
265
263
|
#
|
266
264
|
def get_operation request, options = nil
|
@@ -540,14 +538,14 @@ module Google
|
|
540
538
|
# # Call the wait_operation method.
|
541
539
|
# result = client.wait_operation request
|
542
540
|
#
|
543
|
-
# # The returned object is of type Gapic::Operation. You can use
|
544
|
-
# #
|
545
|
-
# #
|
541
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
542
|
+
# # check the status of an operation, cancel it, or wait for results.
|
543
|
+
# # Here is how to wait for a response.
|
546
544
|
# result.wait_until_done! timeout: 60
|
547
545
|
# if result.response?
|
548
546
|
# p result.response
|
549
547
|
# else
|
550
|
-
# puts "
|
548
|
+
# puts "No response received."
|
551
549
|
# end
|
552
550
|
#
|
553
551
|
def wait_operation request, options = nil
|
@@ -622,9 +620,9 @@ module Google
|
|
622
620
|
# * (`String`) The path to a service account key file in JSON format
|
623
621
|
# * (`Hash`) A service account key as a Hash
|
624
622
|
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
625
|
-
# (see the [googleauth docs](https://
|
623
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
626
624
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
627
|
-
# (see the [signet docs](https://
|
625
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
628
626
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
629
627
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
630
628
|
# * (`nil`) indicating no credentials
|
@@ -139,6 +139,87 @@ module Google
|
|
139
139
|
"folders/#{folder}/locations/#{location}"
|
140
140
|
end
|
141
141
|
|
142
|
+
##
|
143
|
+
# Create a fully-qualified Link resource string.
|
144
|
+
#
|
145
|
+
# @overload link_path(project:, location:, bucket:, link:)
|
146
|
+
# The resource will be in the following format:
|
147
|
+
#
|
148
|
+
# `projects/{project}/locations/{location}/buckets/{bucket}/links/{link}`
|
149
|
+
#
|
150
|
+
# @param project [String]
|
151
|
+
# @param location [String]
|
152
|
+
# @param bucket [String]
|
153
|
+
# @param link [String]
|
154
|
+
#
|
155
|
+
# @overload link_path(organization:, location:, bucket:, link:)
|
156
|
+
# The resource will be in the following format:
|
157
|
+
#
|
158
|
+
# `organizations/{organization}/locations/{location}/buckets/{bucket}/links/{link}`
|
159
|
+
#
|
160
|
+
# @param organization [String]
|
161
|
+
# @param location [String]
|
162
|
+
# @param bucket [String]
|
163
|
+
# @param link [String]
|
164
|
+
#
|
165
|
+
# @overload link_path(folder:, location:, bucket:, link:)
|
166
|
+
# The resource will be in the following format:
|
167
|
+
#
|
168
|
+
# `folders/{folder}/locations/{location}/buckets/{bucket}/links/{link}`
|
169
|
+
#
|
170
|
+
# @param folder [String]
|
171
|
+
# @param location [String]
|
172
|
+
# @param bucket [String]
|
173
|
+
# @param link [String]
|
174
|
+
#
|
175
|
+
# @overload link_path(billing_account:, location:, bucket:, link:)
|
176
|
+
# The resource will be in the following format:
|
177
|
+
#
|
178
|
+
# `billingAccounts/{billing_account}/locations/{location}/buckets/{bucket}/links/{link}`
|
179
|
+
#
|
180
|
+
# @param billing_account [String]
|
181
|
+
# @param location [String]
|
182
|
+
# @param bucket [String]
|
183
|
+
# @param link [String]
|
184
|
+
#
|
185
|
+
# @return [::String]
|
186
|
+
def link_path **args
|
187
|
+
resources = {
|
188
|
+
"bucket:link:location:project" => (proc do |project:, location:, bucket:, link:|
|
189
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
190
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
191
|
+
raise ::ArgumentError, "bucket cannot contain /" if bucket.to_s.include? "/"
|
192
|
+
|
193
|
+
"projects/#{project}/locations/#{location}/buckets/#{bucket}/links/#{link}"
|
194
|
+
end),
|
195
|
+
"bucket:link:location:organization" => (proc do |organization:, location:, bucket:, link:|
|
196
|
+
raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
|
197
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
198
|
+
raise ::ArgumentError, "bucket cannot contain /" if bucket.to_s.include? "/"
|
199
|
+
|
200
|
+
"organizations/#{organization}/locations/#{location}/buckets/#{bucket}/links/#{link}"
|
201
|
+
end),
|
202
|
+
"bucket:folder:link:location" => (proc do |folder:, location:, bucket:, link:|
|
203
|
+
raise ::ArgumentError, "folder cannot contain /" if folder.to_s.include? "/"
|
204
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
205
|
+
raise ::ArgumentError, "bucket cannot contain /" if bucket.to_s.include? "/"
|
206
|
+
|
207
|
+
"folders/#{folder}/locations/#{location}/buckets/#{bucket}/links/#{link}"
|
208
|
+
end),
|
209
|
+
"billing_account:bucket:link:location" => (proc do |billing_account:, location:, bucket:, link:|
|
210
|
+
raise ::ArgumentError, "billing_account cannot contain /" if billing_account.to_s.include? "/"
|
211
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
212
|
+
raise ::ArgumentError, "bucket cannot contain /" if bucket.to_s.include? "/"
|
213
|
+
|
214
|
+
"billingAccounts/#{billing_account}/locations/#{location}/buckets/#{bucket}/links/#{link}"
|
215
|
+
end)
|
216
|
+
}
|
217
|
+
|
218
|
+
resource = resources[args.keys.sort.join(":")]
|
219
|
+
raise ::ArgumentError, "no resource found for values #{args.keys}" if resource.nil?
|
220
|
+
resource.call(**args)
|
221
|
+
end
|
222
|
+
|
142
223
|
##
|
143
224
|
# Create a fully-qualified Location resource string.
|
144
225
|
#
|
@@ -34,7 +34,7 @@ module Google
|
|
34
34
|
##
|
35
35
|
# Service for configuring sinks used to route log entries.
|
36
36
|
#
|
37
|
-
#
|
37
|
+
# @example Load this service and instantiate a gRPC client
|
38
38
|
#
|
39
39
|
# require "google/cloud/logging/v2/config_service"
|
40
40
|
# client = ::Google::Cloud::Logging::V2::ConfigService::Client.new
|
@@ -356,11 +356,13 @@ module Google
|
|
356
356
|
# `entries.write`, you should try to include several log entries in this
|
357
357
|
# list, rather than calling this method for each individual log entry.
|
358
358
|
# @param partial_success [::Boolean]
|
359
|
-
# Optional. Whether valid entries should be written even if some
|
360
|
-
#
|
361
|
-
#
|
362
|
-
#
|
363
|
-
#
|
359
|
+
# Optional. Whether a batch's valid entries should be written even if some
|
360
|
+
# other entry failed due to a permanent error such as INVALID_ARGUMENT or
|
361
|
+
# PERMISSION_DENIED. If any entry failed, then the response status is the
|
362
|
+
# response status of one of the failed entries. The response will include
|
363
|
+
# error details in `WriteLogEntriesPartialErrors.log_entry_errors` keyed by
|
364
|
+
# the entries' zero-based index in the `entries`. Failed requests for which
|
365
|
+
# no entries are written will not include per-entry errors.
|
364
366
|
# @param dry_run [::Boolean]
|
365
367
|
# Optional. If true, the request should expect normal response, but the
|
366
368
|
# entries won't be persisted nor exported. Useful for checking whether the
|
@@ -460,14 +462,13 @@ module Google
|
|
460
462
|
# * `folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
|
461
463
|
#
|
462
464
|
# Projects listed in the `project_ids` field are added to this list.
|
465
|
+
# A maximum of 100 resources may be specified in a single request.
|
463
466
|
# @param filter [::String]
|
464
|
-
# Optional.
|
465
|
-
#
|
466
|
-
# Only log entries that match the filter are returned. An empty filter
|
467
|
-
# matches all log entries in the resources listed in `resource_names`.
|
467
|
+
# Optional. Only log entries that match the filter are returned. An empty
|
468
|
+
# filter matches all log entries in the resources listed in `resource_names`.
|
468
469
|
# Referencing a parent resource that is not listed in `resource_names` will
|
469
|
-
# cause the filter to return no results. The maximum length of
|
470
|
-
#
|
470
|
+
# cause the filter to return no results. The maximum length of a filter is
|
471
|
+
# 20,000 characters.
|
471
472
|
# @param order_by [::String]
|
472
473
|
# Optional. How the results should be sorted. Presently, the only permitted
|
473
474
|
# values are `"timestamp asc"` (default) and `"timestamp desc"`. The first
|
@@ -476,10 +477,10 @@ module Google
|
|
476
477
|
# in order of decreasing timestamps (newest first). Entries with equal
|
477
478
|
# timestamps are returned in order of their `insert_id` values.
|
478
479
|
# @param page_size [::Integer]
|
479
|
-
# Optional. The maximum number of results to return from this request.
|
480
|
-
# If the value is negative or exceeds 1000, the request is
|
481
|
-
# presence of `next_page_token` in the response indicates that
|
482
|
-
# might be available.
|
480
|
+
# Optional. The maximum number of results to return from this request.
|
481
|
+
# Default is 50. If the value is negative or exceeds 1000, the request is
|
482
|
+
# rejected. The presence of `next_page_token` in the response indicates that
|
483
|
+
# more results might be available.
|
483
484
|
# @param page_token [::String]
|
484
485
|
# Optional. If present, then retrieve the next batch of results from the
|
485
486
|
# preceding call to this method. `page_token` must be the value of
|
@@ -506,13 +507,11 @@ module Google
|
|
506
507
|
# # Call the list_log_entries method.
|
507
508
|
# result = client.list_log_entries request
|
508
509
|
#
|
509
|
-
# # The returned object is of type Gapic::PagedEnumerable. You can
|
510
|
-
# #
|
511
|
-
#
|
512
|
-
# # methods are also available for managing paging directly.
|
513
|
-
# result.each do |response|
|
510
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
511
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
512
|
+
# result.each do |item|
|
514
513
|
# # Each element is of type ::Google::Cloud::Logging::V2::LogEntry.
|
515
|
-
# p
|
514
|
+
# p item
|
516
515
|
# end
|
517
516
|
#
|
518
517
|
def list_log_entries request, options = nil
|
@@ -597,13 +596,11 @@ module Google
|
|
597
596
|
# # Call the list_monitored_resource_descriptors method.
|
598
597
|
# result = client.list_monitored_resource_descriptors request
|
599
598
|
#
|
600
|
-
# # The returned object is of type Gapic::PagedEnumerable. You can
|
601
|
-
# #
|
602
|
-
#
|
603
|
-
# # methods are also available for managing paging directly.
|
604
|
-
# result.each do |response|
|
599
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
600
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
601
|
+
# result.each do |item|
|
605
602
|
# # Each element is of type ::Google::Api::MonitoredResourceDescriptor.
|
606
|
-
# p
|
603
|
+
# p item
|
607
604
|
# end
|
608
605
|
#
|
609
606
|
def list_monitored_resource_descriptors request, options = nil
|
@@ -654,29 +651,20 @@ module Google
|
|
654
651
|
# @param options [::Gapic::CallOptions, ::Hash]
|
655
652
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
656
653
|
#
|
657
|
-
# @overload list_logs(parent: nil,
|
654
|
+
# @overload list_logs(parent: nil, resource_names: nil, page_size: nil, page_token: nil)
|
658
655
|
# Pass arguments to `list_logs` via keyword arguments. Note that at
|
659
656
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
660
657
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
661
658
|
#
|
662
659
|
# @param parent [::String]
|
663
|
-
# Required. The resource name
|
660
|
+
# Required. The resource name to list logs for:
|
664
661
|
#
|
665
662
|
# * `projects/[PROJECT_ID]`
|
666
663
|
# * `organizations/[ORGANIZATION_ID]`
|
667
664
|
# * `billingAccounts/[BILLING_ACCOUNT_ID]`
|
668
665
|
# * `folders/[FOLDER_ID]`
|
669
|
-
# @param page_size [::Integer]
|
670
|
-
# Optional. The maximum number of results to return from this request.
|
671
|
-
# Non-positive values are ignored. The presence of `nextPageToken` in the
|
672
|
-
# response indicates that more results might be available.
|
673
|
-
# @param page_token [::String]
|
674
|
-
# Optional. If present, then retrieve the next batch of results from the
|
675
|
-
# preceding call to this method. `pageToken` must be the value of
|
676
|
-
# `nextPageToken` from the previous response. The values of other method
|
677
|
-
# parameters should be identical to those in the previous call.
|
678
666
|
# @param resource_names [::Array<::String>]
|
679
|
-
# Optional.
|
667
|
+
# Optional. List of resource names to list logs for:
|
680
668
|
#
|
681
669
|
# * `projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
|
682
670
|
# * `organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]`
|
@@ -690,6 +678,17 @@ module Google
|
|
690
678
|
# * `billingAccounts/[BILLING_ACCOUNT_ID]`
|
691
679
|
# * `folders/[FOLDER_ID]`
|
692
680
|
#
|
681
|
+
# The resource name in the `parent` field is added to this list.
|
682
|
+
# @param page_size [::Integer]
|
683
|
+
# Optional. The maximum number of results to return from this request.
|
684
|
+
# Non-positive values are ignored. The presence of `nextPageToken` in the
|
685
|
+
# response indicates that more results might be available.
|
686
|
+
# @param page_token [::String]
|
687
|
+
# Optional. If present, then retrieve the next batch of results from the
|
688
|
+
# preceding call to this method. `pageToken` must be the value of
|
689
|
+
# `nextPageToken` from the previous response. The values of other method
|
690
|
+
# parameters should be identical to those in the previous call.
|
691
|
+
#
|
693
692
|
# @yield [response, operation] Access the result along with the RPC operation
|
694
693
|
# @yieldparam response [::Google::Cloud::Logging::V2::ListLogsResponse]
|
695
694
|
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
@@ -777,22 +776,22 @@ module Google
|
|
777
776
|
# # Create a client object. The client can be reused for multiple calls.
|
778
777
|
# client = Google::Cloud::Logging::V2::LoggingService::Client.new
|
779
778
|
#
|
780
|
-
# # Create an input stream
|
779
|
+
# # Create an input stream.
|
781
780
|
# input = Gapic::StreamInput.new
|
782
781
|
#
|
783
782
|
# # Call the tail_log_entries method to start streaming.
|
784
783
|
# output = client.tail_log_entries input
|
785
784
|
#
|
786
|
-
# # Send requests on the stream. For each request,
|
787
|
-
# #
|
785
|
+
# # Send requests on the stream. For each request object, set fields by
|
786
|
+
# # passing keyword arguments. Be sure to close the stream when done.
|
788
787
|
# input << Google::Cloud::Logging::V2::TailLogEntriesRequest.new
|
789
788
|
# input << Google::Cloud::Logging::V2::TailLogEntriesRequest.new
|
790
789
|
# input.close
|
791
790
|
#
|
792
|
-
# #
|
793
|
-
# #
|
794
|
-
# output.each do |
|
795
|
-
# p
|
791
|
+
# # The returned object is a streamed enumerable yielding elements of type
|
792
|
+
# # ::Google::Cloud::Logging::V2::TailLogEntriesResponse
|
793
|
+
# output.each do |current_response|
|
794
|
+
# p current_response
|
796
795
|
# end
|
797
796
|
#
|
798
797
|
def tail_log_entries request, options = nil
|
@@ -871,9 +870,9 @@ module Google
|
|
871
870
|
# * (`String`) The path to a service account key file in JSON format
|
872
871
|
# * (`Hash`) A service account key as a Hash
|
873
872
|
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
874
|
-
# (see the [googleauth docs](https://
|
873
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
875
874
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
876
|
-
# (see the [signet docs](https://
|
875
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
877
876
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
878
877
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
879
878
|
# * (`nil`) indicating no credentials
|
@@ -33,7 +33,7 @@ module Google
|
|
33
33
|
##
|
34
34
|
# Service for ingesting and querying logs.
|
35
35
|
#
|
36
|
-
#
|
36
|
+
# @example Load this service and instantiate a gRPC client
|
37
37
|
#
|
38
38
|
# require "google/cloud/logging/v2/logging_service"
|
39
39
|
# client = ::Google::Cloud::Logging::V2::LoggingService::Client.new
|
@@ -218,13 +218,11 @@ module Google
|
|
218
218
|
# # Call the list_log_metrics method.
|
219
219
|
# result = client.list_log_metrics request
|
220
220
|
#
|
221
|
-
# # The returned object is of type Gapic::PagedEnumerable. You can
|
222
|
-
# #
|
223
|
-
#
|
224
|
-
# # methods are also available for managing paging directly.
|
225
|
-
# result.each do |response|
|
221
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
222
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
223
|
+
# result.each do |item|
|
226
224
|
# # Each element is of type ::Google::Cloud::Logging::V2::LogMetric.
|
227
|
-
# p
|
225
|
+
# p item
|
228
226
|
# end
|
229
227
|
#
|
230
228
|
def list_log_metrics request, options = nil
|
@@ -666,9 +664,9 @@ module Google
|
|
666
664
|
# * (`String`) The path to a service account key file in JSON format
|
667
665
|
# * (`Hash`) A service account key as a Hash
|
668
666
|
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
669
|
-
# (see the [googleauth docs](https://
|
667
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
670
668
|
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
671
|
-
# (see the [signet docs](https://
|
669
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
672
670
|
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
673
671
|
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
674
672
|
# * (`nil`) indicating no credentials
|
@@ -33,7 +33,7 @@ module Google
|
|
33
33
|
##
|
34
34
|
# Service for configuring logs-based metrics.
|
35
35
|
#
|
36
|
-
#
|
36
|
+
# @example Load this service and instantiate a gRPC client
|
37
37
|
#
|
38
38
|
# require "google/cloud/logging/v2/metrics_service"
|
39
39
|
# client = ::Google::Cloud::Logging::V2::MetricsService::Client.new
|
@@ -25,9 +25,9 @@ module Google
|
|
25
25
|
module Cloud
|
26
26
|
module Logging
|
27
27
|
##
|
28
|
-
#
|
28
|
+
# API client module.
|
29
29
|
#
|
30
|
-
# @example
|
30
|
+
# @example Load this package, including all its services, and instantiate a gRPC client
|
31
31
|
#
|
32
32
|
# require "google/cloud/logging/v2"
|
33
33
|
# client = ::Google::Cloud::Logging::V2::LoggingService::Client.new
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
3
|
# source: google/logging/v2/log_entry.proto
|
3
4
|
|
@@ -12,46 +13,36 @@ require 'google/protobuf/any_pb'
|
|
12
13
|
require 'google/protobuf/struct_pb'
|
13
14
|
require 'google/protobuf/timestamp_pb'
|
14
15
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
optional :first, :bool, 3
|
42
|
-
optional :last, :bool, 4
|
43
|
-
end
|
44
|
-
add_message "google.logging.v2.LogEntrySourceLocation" do
|
45
|
-
optional :file, :string, 1
|
46
|
-
optional :line, :int64, 2
|
47
|
-
optional :function, :string, 3
|
48
|
-
end
|
49
|
-
add_message "google.logging.v2.LogSplit" do
|
50
|
-
optional :uid, :string, 1
|
51
|
-
optional :index, :int32, 2
|
52
|
-
optional :total_splits, :int32, 3
|
16
|
+
|
17
|
+
descriptor_data = "\n!google/logging/v2/log_entry.proto\x12\x11google.logging.v2\x1a\x1fgoogle/api/field_behavior.proto\x1a#google/api/monitored_resource.proto\x1a\x19google/api/resource.proto\x1a&google/logging/type/http_request.proto\x1a&google/logging/type/log_severity.proto\x1a\x19google/protobuf/any.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x83\x08\n\x08LogEntry\x12\x15\n\x08log_name\x18\x0c \x01(\tB\x03\xe0\x41\x02\x12\x34\n\x08resource\x18\x08 \x01(\x0b\x32\x1d.google.api.MonitoredResourceB\x03\xe0\x41\x02\x12-\n\rproto_payload\x18\x02 \x01(\x0b\x32\x14.google.protobuf.AnyH\x00\x12\x16\n\x0ctext_payload\x18\x03 \x01(\tH\x00\x12/\n\x0cjson_payload\x18\x06 \x01(\x0b\x32\x17.google.protobuf.StructH\x00\x12\x32\n\ttimestamp\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x01\x12:\n\x11receive_timestamp\x18\x18 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x37\n\x08severity\x18\n \x01(\x0e\x32 .google.logging.type.LogSeverityB\x03\xe0\x41\x01\x12\x16\n\tinsert_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12;\n\x0chttp_request\x18\x07 \x01(\x0b\x32 .google.logging.type.HttpRequestB\x03\xe0\x41\x01\x12<\n\x06labels\x18\x0b \x03(\x0b\x32\'.google.logging.v2.LogEntry.LabelsEntryB\x03\xe0\x41\x01\x12<\n\toperation\x18\x0f \x01(\x0b\x32$.google.logging.v2.LogEntryOperationB\x03\xe0\x41\x01\x12\x12\n\x05trace\x18\x16 \x01(\tB\x03\xe0\x41\x01\x12\x14\n\x07span_id\x18\x1b \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rtrace_sampled\x18\x1e \x01(\x08\x42\x03\xe0\x41\x01\x12G\n\x0fsource_location\x18\x17 \x01(\x0b\x32).google.logging.v2.LogEntrySourceLocationB\x03\xe0\x41\x01\x12/\n\x05split\x18# \x01(\x0b\x32\x1b.google.logging.v2.LogSplitB\x03\xe0\x41\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\xbd\x01\xea\x41\xb9\x01\n\x1alogging.googleapis.com/Log\x12\x1dprojects/{project}/logs/{log}\x12\'organizations/{organization}/logs/{log}\x12\x1b\x66olders/{folder}/logs/{log}\x12,billingAccounts/{billing_account}/logs/{log}\x1a\x08log_nameB\t\n\x07payload\"b\n\x11LogEntryOperation\x12\x0f\n\x02id\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08producer\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05\x66irst\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x11\n\x04last\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"U\n\x16LogEntrySourceLocation\x12\x11\n\x04\x66ile\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04line\x18\x02 \x01(\x03\x42\x03\xe0\x41\x01\x12\x15\n\x08\x66unction\x18\x03 \x01(\tB\x03\xe0\x41\x01\"<\n\x08LogSplit\x12\x0b\n\x03uid\x18\x01 \x01(\t\x12\r\n\x05index\x18\x02 \x01(\x05\x12\x14\n\x0ctotal_splits\x18\x03 \x01(\x05\x42\xb3\x01\n\x15\x63om.google.logging.v2B\rLogEntryProtoP\x01Z5cloud.google.com/go/logging/apiv2/loggingpb;loggingpb\xf8\x01\x01\xaa\x02\x17Google.Cloud.Logging.V2\xca\x02\x17Google\\Cloud\\Logging\\V2\xea\x02\x1aGoogle::Cloud::Logging::V2b\x06proto3"
|
18
|
+
|
19
|
+
pool = Google::Protobuf::DescriptorPool.generated_pool
|
20
|
+
|
21
|
+
begin
|
22
|
+
pool.add_serialized_file(descriptor_data)
|
23
|
+
rescue TypeError => e
|
24
|
+
# Compatibility code: will be removed in the next major version.
|
25
|
+
require 'google/protobuf/descriptor_pb'
|
26
|
+
parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
|
27
|
+
parsed.clear_dependency
|
28
|
+
serialized = parsed.class.encode(parsed)
|
29
|
+
file = pool.add_serialized_file(serialized)
|
30
|
+
warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
|
31
|
+
imports = [
|
32
|
+
["google.api.MonitoredResource", "google/api/monitored_resource.proto"],
|
33
|
+
["google.protobuf.Any", "google/protobuf/any.proto"],
|
34
|
+
["google.protobuf.Struct", "google/protobuf/struct.proto"],
|
35
|
+
["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"],
|
36
|
+
["google.logging.type.HttpRequest", "google/logging/type/http_request.proto"],
|
37
|
+
]
|
38
|
+
imports.each do |type_name, expected_filename|
|
39
|
+
import_file = pool.lookup(type_name).file_descriptor
|
40
|
+
if import_file.name != expected_filename
|
41
|
+
warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
|
53
42
|
end
|
54
43
|
end
|
44
|
+
warn "Each proto file must use a consistent fully-qualified name."
|
45
|
+
warn "This will become an error in the next major version."
|
55
46
|
end
|
56
47
|
|
57
48
|
module Google
|