google-cloud-logging 1.2.3 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/lib/google-cloud-logging.rb +13 -10
- data/lib/google/cloud/logging.rb +41 -17
- data/lib/google/cloud/logging/async_writer.rb +5 -2
- data/lib/google/cloud/logging/credentials.rb +31 -15
- data/lib/google/cloud/logging/entry.rb +13 -0
- data/lib/google/cloud/logging/entry/http_request.rb +35 -12
- data/lib/google/cloud/logging/logger.rb +14 -0
- data/lib/google/cloud/logging/middleware.rb +1 -1
- data/lib/google/cloud/logging/project.rb +55 -8
- data/lib/google/cloud/logging/rails.rb +1 -1
- data/lib/google/cloud/logging/service.rb +8 -27
- data/lib/google/cloud/logging/v2/config_service_v2_client.rb +360 -93
- data/lib/google/cloud/logging/v2/config_service_v2_client_config.json +43 -8
- data/lib/google/cloud/logging/v2/doc/google/api/distribution.rb +172 -0
- data/lib/google/cloud/logging/v2/doc/google/api/metric.rb +187 -0
- data/lib/google/cloud/logging/v2/doc/google/api/monitored_resource.rb +4 -4
- data/lib/google/cloud/logging/v2/doc/google/logging/type/http_request.rb +4 -1
- data/lib/google/cloud/logging/v2/doc/google/logging/v2/log_entry.rb +13 -6
- data/lib/google/cloud/logging/v2/doc/google/logging/v2/logging.rb +55 -21
- data/lib/google/cloud/logging/v2/doc/google/logging/v2/logging_config.rb +185 -23
- data/lib/google/cloud/logging/v2/doc/google/logging/v2/logging_metrics.rb +89 -5
- data/lib/google/cloud/logging/v2/doc/google/protobuf/any.rb +12 -2
- data/lib/google/cloud/logging/v2/doc/google/protobuf/duration.rb +14 -1
- data/lib/google/cloud/logging/v2/doc/google/protobuf/field_mask.rb +223 -0
- data/lib/google/cloud/logging/v2/doc/google/protobuf/timestamp.rb +26 -1
- data/lib/google/cloud/logging/v2/doc/overview.rb +67 -0
- data/lib/google/cloud/logging/v2/logging_service_v2_client.rb +116 -91
- data/lib/google/cloud/logging/v2/logging_service_v2_client_config.json +12 -11
- data/lib/google/cloud/logging/v2/metrics_service_v2_client.rb +87 -76
- data/lib/google/cloud/logging/v2/metrics_service_v2_client_config.json +9 -8
- data/lib/google/cloud/logging/version.rb +1 -1
- metadata +11 -7
@@ -0,0 +1,67 @@
|
|
1
|
+
# Copyright 2017, Google Inc. All rights reserved.
|
2
|
+
#
|
3
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
# you may not use this file except in compliance with the License.
|
5
|
+
# You may obtain a copy of the License at
|
6
|
+
#
|
7
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
#
|
9
|
+
# Unless required by applicable law or agreed to in writing, software
|
10
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
# See the License for the specific language governing permissions and
|
13
|
+
# limitations under the License.
|
14
|
+
|
15
|
+
module Google
|
16
|
+
module Cloud
|
17
|
+
# rubocop:disable LineLength
|
18
|
+
|
19
|
+
##
|
20
|
+
# # Ruby Client for Stackdriver Logging API ([Alpha](https://github.com/GoogleCloudPlatform/google-cloud-ruby#versioning))
|
21
|
+
#
|
22
|
+
# [Stackdriver Logging API][Product Documentation]:
|
23
|
+
# The Stackdriver Logging API lets you write log entries and manage your logs,
|
24
|
+
# log sinks and logs-based metrics.
|
25
|
+
# - [Product Documentation][]
|
26
|
+
#
|
27
|
+
# ## Quick Start
|
28
|
+
# In order to use this library, you first need to go through the following
|
29
|
+
# steps:
|
30
|
+
#
|
31
|
+
# 1. [Select or create a Cloud Platform project.](https://console.cloud.google.com/project)
|
32
|
+
# 2. [Enable the Stackdriver Logging API.](https://console.cloud.google.com/apis/api/logging)
|
33
|
+
# 3. [Setup Authentication.](https://googlecloudplatform.github.io/google-cloud-ruby/#/docs/google-cloud/master/guides/authentication)
|
34
|
+
#
|
35
|
+
# ### Installation
|
36
|
+
# ```
|
37
|
+
# $ gem install google-cloud-logging
|
38
|
+
# ```
|
39
|
+
#
|
40
|
+
# ### Preview
|
41
|
+
# #### LoggingServiceV2Client
|
42
|
+
# ```rb
|
43
|
+
# require "google/cloud/logging"
|
44
|
+
#
|
45
|
+
# logging_service_v2_client = Google::Cloud::Logging::Logging.new
|
46
|
+
# formatted_log_name = Google::Cloud::Logging::V2::LoggingServiceV2Client.log_path(project_id, "test-" + Time.new.to_i.to_s)
|
47
|
+
# resource = {}
|
48
|
+
# labels = {}
|
49
|
+
# entries = []
|
50
|
+
# response = logging_service_v2_client.write_log_entries(entries, log_name: formatted_log_name, resource: resource, labels: labels)
|
51
|
+
# ```
|
52
|
+
#
|
53
|
+
# ### Next Steps
|
54
|
+
# - Read the [Stackdriver Logging API Product documentation][Product Documentation]
|
55
|
+
# to learn more about the product and see How-to Guides.
|
56
|
+
# - View this [repository's main README](https://github.com/GoogleCloudPlatform/google-cloud-ruby/blob/master/README.md)
|
57
|
+
# to see the full list of Cloud APIs that we cover.
|
58
|
+
#
|
59
|
+
# [Product Documentation]: https://cloud.google.com/logging
|
60
|
+
#
|
61
|
+
#
|
62
|
+
module Logging
|
63
|
+
module V2
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -28,6 +28,7 @@ require "pathname"
|
|
28
28
|
require "google/gax"
|
29
29
|
|
30
30
|
require "google/logging/v2/logging_pb"
|
31
|
+
require "google/cloud/logging/credentials"
|
31
32
|
|
32
33
|
module Google
|
33
34
|
module Cloud
|
@@ -119,36 +120,24 @@ module Google
|
|
119
120
|
)
|
120
121
|
end
|
121
122
|
|
122
|
-
#
|
123
|
-
#
|
124
|
-
#
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
#
|
130
|
-
#
|
131
|
-
#
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
#
|
137
|
-
#
|
138
|
-
#
|
139
|
-
|
140
|
-
LOG_PATH_TEMPLATE.match(log_name)["log"]
|
141
|
-
end
|
142
|
-
|
143
|
-
# @param service_path [String]
|
144
|
-
# The domain name of the API remote host.
|
145
|
-
# @param port [Integer]
|
146
|
-
# The port on which to connect to the remote host.
|
147
|
-
# @param channel [Channel]
|
148
|
-
# A Channel object through which to make calls.
|
149
|
-
# @param chan_creds [Grpc::ChannelCredentials]
|
150
|
-
# A ChannelCredentials for the setting up the RPC client.
|
151
|
-
# @param client_config[Hash]
|
123
|
+
# @param credentials [Google::Auth::Credentials, String, Hash, GRPC::Core::Channel, GRPC::Core::ChannelCredentials, Proc]
|
124
|
+
# Provides the means for authenticating requests made by the client. This parameter can
|
125
|
+
# be many types.
|
126
|
+
# A `Google::Auth::Credentials` uses a the properties of its represented keyfile for
|
127
|
+
# authenticating requests made by this client.
|
128
|
+
# A `String` will be treated as the path to the keyfile to be used for the construction of
|
129
|
+
# credentials for this client.
|
130
|
+
# A `Hash` will be treated as the contents of a keyfile to be used for the construction of
|
131
|
+
# credentials for this client.
|
132
|
+
# A `GRPC::Core::Channel` will be used to make calls through.
|
133
|
+
# A `GRPC::Core::ChannelCredentials` for the setting up the RPC client. The channel credentials
|
134
|
+
# should already be composed with a `GRPC::Core::CallCredentials` object.
|
135
|
+
# A `Proc` will be used as an updater_proc for the Grpc channel. The proc transforms the
|
136
|
+
# metadata for requests, generally, to give OAuth credentials.
|
137
|
+
# @param scopes [Array<String>]
|
138
|
+
# The OAuth scopes for this service. This parameter is ignored if
|
139
|
+
# an updater_proc is supplied.
|
140
|
+
# @param client_config [Hash]
|
152
141
|
# A Hash for call options for each method. See
|
153
142
|
# Google::Gax#construct_settings for the structure of
|
154
143
|
# this data. Falls back to the default config if not specified
|
@@ -160,11 +149,11 @@ module Google
|
|
160
149
|
port: DEFAULT_SERVICE_PORT,
|
161
150
|
channel: nil,
|
162
151
|
chan_creds: nil,
|
152
|
+
updater_proc: nil,
|
153
|
+
credentials: nil,
|
163
154
|
scopes: ALL_SCOPES,
|
164
155
|
client_config: {},
|
165
156
|
timeout: DEFAULT_TIMEOUT,
|
166
|
-
app_name: nil,
|
167
|
-
app_version: nil,
|
168
157
|
lib_name: nil,
|
169
158
|
lib_version: ""
|
170
159
|
# These require statements are intentionally placed here to initialize
|
@@ -173,14 +162,38 @@ module Google
|
|
173
162
|
require "google/gax/grpc"
|
174
163
|
require "google/logging/v2/logging_services_pb"
|
175
164
|
|
165
|
+
if channel || chan_creds || updater_proc
|
166
|
+
warn "The `channel`, `chan_creds`, and `updater_proc` parameters will be removed " \
|
167
|
+
"on 2017/09/08"
|
168
|
+
credentials ||= channel
|
169
|
+
credentials ||= chan_creds
|
170
|
+
credentials ||= updater_proc
|
171
|
+
end
|
172
|
+
if service_path != SERVICE_ADDRESS || port != DEFAULT_SERVICE_PORT
|
173
|
+
warn "`service_path` and `port` parameters are deprecated and will be removed"
|
174
|
+
end
|
175
|
+
|
176
|
+
credentials ||= Google::Cloud::Logging::Credentials.default
|
176
177
|
|
177
|
-
if
|
178
|
-
|
178
|
+
if credentials.is_a?(String) || credentials.is_a?(Hash)
|
179
|
+
updater_proc = Google::Cloud::Logging::Credentials.new(credentials).updater_proc
|
180
|
+
end
|
181
|
+
if credentials.is_a?(GRPC::Core::Channel)
|
182
|
+
channel = credentials
|
183
|
+
end
|
184
|
+
if credentials.is_a?(GRPC::Core::ChannelCredentials)
|
185
|
+
chan_creds = credentials
|
186
|
+
end
|
187
|
+
if credentials.is_a?(Proc)
|
188
|
+
updater_proc = credentials
|
189
|
+
end
|
190
|
+
if credentials.is_a?(Google::Auth::Credentials)
|
191
|
+
updater_proc = credentials.updater_proc
|
179
192
|
end
|
180
193
|
|
181
194
|
google_api_client = "gl-ruby/#{RUBY_VERSION}"
|
182
195
|
google_api_client << " #{lib_name}/#{lib_version}" if lib_name
|
183
|
-
google_api_client << " gapic/0.
|
196
|
+
google_api_client << " gapic/0.1.0 gax/#{Google::Gax::VERSION}"
|
184
197
|
google_api_client << " grpc/#{GRPC::VERSION}"
|
185
198
|
google_api_client.freeze
|
186
199
|
|
@@ -206,6 +219,7 @@ module Google
|
|
206
219
|
port,
|
207
220
|
chan_creds: chan_creds,
|
208
221
|
channel: channel,
|
222
|
+
updater_proc: updater_proc,
|
209
223
|
scopes: scopes,
|
210
224
|
&Google::Logging::V2::LoggingServiceV2::Stub.method(:new)
|
211
225
|
)
|
@@ -248,51 +262,64 @@ module Google
|
|
248
262
|
# "folders/[FOLDER_ID]/logs/[LOG_ID]"
|
249
263
|
#
|
250
264
|
# +[LOG_ID]+ must be URL-encoded. For example,
|
251
|
-
# +"projects/my-project
|
265
|
+
# +"projects/my-project/logs/syslog"+,
|
252
266
|
# +"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"+.
|
253
267
|
# For more information about log names, see
|
254
|
-
# LogEntry.
|
268
|
+
# {Google::Logging::V2::LogEntry LogEntry}.
|
255
269
|
# @param options [Google::Gax::CallOptions]
|
256
270
|
# Overrides the default settings for this call, e.g, timeout,
|
257
271
|
# retries, etc.
|
258
272
|
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
259
273
|
# @example
|
260
|
-
# require "google/cloud/logging/v2
|
261
|
-
#
|
262
|
-
# LoggingServiceV2Client = Google::Cloud::Logging::V2::LoggingServiceV2Client
|
274
|
+
# require "google/cloud/logging/v2"
|
263
275
|
#
|
264
|
-
# logging_service_v2_client =
|
265
|
-
# formatted_log_name = LoggingServiceV2Client.log_path("[PROJECT]", "[LOG]")
|
276
|
+
# logging_service_v2_client = Google::Cloud::Logging::V2::Logging.new
|
277
|
+
# formatted_log_name = Google::Cloud::Logging::V2::LoggingServiceV2Client.log_path("[PROJECT]", "[LOG]")
|
266
278
|
# logging_service_v2_client.delete_log(formatted_log_name)
|
267
279
|
|
268
280
|
def delete_log \
|
269
281
|
log_name,
|
270
282
|
options: nil
|
271
|
-
req =
|
283
|
+
req = {
|
272
284
|
log_name: log_name
|
273
|
-
}.delete_if { |_, v| v.nil? }
|
285
|
+
}.delete_if { |_, v| v.nil? }
|
286
|
+
req = Google::Gax::to_proto(req, Google::Logging::V2::DeleteLogRequest)
|
274
287
|
@delete_log.call(req, options)
|
275
288
|
nil
|
276
289
|
end
|
277
290
|
|
278
|
-
#
|
291
|
+
# == Log entry resources
|
279
292
|
#
|
280
|
-
#
|
281
|
-
#
|
282
|
-
#
|
283
|
-
#
|
284
|
-
#
|
293
|
+
# Writes log entries to Stackdriver Logging. This API method is the
|
294
|
+
# only way to send log entries to Stackdriver Logging. This method
|
295
|
+
# is used, directly or indirectly, by the Stackdriver Logging agent
|
296
|
+
# (fluentd) and all logging libraries configured to use Stackdriver
|
297
|
+
# Logging.
|
285
298
|
#
|
286
|
-
#
|
287
|
-
#
|
288
|
-
#
|
289
|
-
#
|
290
|
-
# not
|
299
|
+
# @param entries [Array<Google::Logging::V2::LogEntry | Hash>]
|
300
|
+
# Required. The log entries to send to Stackdriver Logging. The order of log
|
301
|
+
# entries in this list does not matter. Values supplied in this method's
|
302
|
+
# +log_name+, +resource+, and +labels+ fields are copied into those log
|
303
|
+
# entries in this list that do not include values for their corresponding
|
304
|
+
# fields. For more information, see the {Google::Logging::V2::LogEntry LogEntry} type.
|
305
|
+
#
|
306
|
+
# If the +timestamp+ or +insert_id+ fields are missing in log entries, then
|
307
|
+
# this method supplies the current time or a unique identifier, respectively.
|
308
|
+
# The supplied values are chosen so that, among the log entries that did not
|
309
|
+
# supply their own values, the entries earlier in the list will sort before
|
310
|
+
# the entries later in the list. See the +entries.list+ method.
|
311
|
+
#
|
312
|
+
# Log entries with timestamps that are more than the
|
313
|
+
# [logs retention period](https://cloud.google.com/logging/quota-policy) in the past or more than
|
314
|
+
# 24 hours in the future might be discarded. Discarding does not return
|
315
|
+
# an error.
|
291
316
|
#
|
292
317
|
# To improve throughput and to avoid exceeding the
|
293
|
-
#
|
294
|
-
# you should
|
295
|
-
# calling this method for each individual log entry.
|
318
|
+
# [quota limit](https://cloud.google.com/logging/quota-policy) for calls to +entries.write+,
|
319
|
+
# you should try to include several log entries in this list,
|
320
|
+
# rather than calling this method for each individual log entry.
|
321
|
+
# A hash of the same form as `Google::Logging::V2::LogEntry`
|
322
|
+
# can also be provided.
|
296
323
|
# @param log_name [String]
|
297
324
|
# Optional. A default log resource name that is assigned to all log entries
|
298
325
|
# in +entries+ that do not specify a value for +log_name+:
|
@@ -303,11 +330,11 @@ module Google
|
|
303
330
|
# "folders/[FOLDER_ID]/logs/[LOG_ID]"
|
304
331
|
#
|
305
332
|
# +[LOG_ID]+ must be URL-encoded. For example,
|
306
|
-
# +"projects/my-project
|
333
|
+
# +"projects/my-project/logs/syslog"+ or
|
307
334
|
# +"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"+.
|
308
335
|
# For more information about log names, see
|
309
|
-
# LogEntry.
|
310
|
-
# @param resource [Google::Api::MonitoredResource]
|
336
|
+
# {Google::Logging::V2::LogEntry LogEntry}.
|
337
|
+
# @param resource [Google::Api::MonitoredResource | Hash]
|
311
338
|
# Optional. A default monitored resource object that is assigned to all log
|
312
339
|
# entries in +entries+ that do not specify a value for +resource+. Example:
|
313
340
|
#
|
@@ -315,12 +342,14 @@ module Google
|
|
315
342
|
# "labels": {
|
316
343
|
# "zone": "us-central1-a", "instance_id": "00000000000000000000" }}
|
317
344
|
#
|
318
|
-
# See LogEntry.
|
345
|
+
# See {Google::Logging::V2::LogEntry LogEntry}.
|
346
|
+
# A hash of the same form as `Google::Api::MonitoredResource`
|
347
|
+
# can also be provided.
|
319
348
|
# @param labels [Hash{String => String}]
|
320
349
|
# Optional. Default labels that are added to the +labels+ field of all log
|
321
350
|
# entries in +entries+. If a log entry already has a label with the same key
|
322
351
|
# as a label in this parameter, then the log entry's label is not changed.
|
323
|
-
# See LogEntry.
|
352
|
+
# See {Google::Logging::V2::LogEntry LogEntry}.
|
324
353
|
# @param partial_success [true, false]
|
325
354
|
# Optional. Whether valid entries should be written even if some other
|
326
355
|
# entries fail due to INVALID_ARGUMENT or PERMISSION_DENIED errors. If any
|
@@ -333,11 +362,9 @@ module Google
|
|
333
362
|
# @return [Google::Logging::V2::WriteLogEntriesResponse]
|
334
363
|
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
335
364
|
# @example
|
336
|
-
# require "google/cloud/logging/v2
|
337
|
-
#
|
338
|
-
# LoggingServiceV2Client = Google::Cloud::Logging::V2::LoggingServiceV2Client
|
365
|
+
# require "google/cloud/logging/v2"
|
339
366
|
#
|
340
|
-
# logging_service_v2_client =
|
367
|
+
# logging_service_v2_client = Google::Cloud::Logging::V2::Logging.new
|
341
368
|
# entries = []
|
342
369
|
# response = logging_service_v2_client.write_log_entries(entries)
|
343
370
|
|
@@ -348,19 +375,20 @@ module Google
|
|
348
375
|
labels: nil,
|
349
376
|
partial_success: nil,
|
350
377
|
options: nil
|
351
|
-
req =
|
378
|
+
req = {
|
352
379
|
entries: entries,
|
353
380
|
log_name: log_name,
|
354
381
|
resource: resource,
|
355
382
|
labels: labels,
|
356
383
|
partial_success: partial_success
|
357
|
-
}.delete_if { |_, v| v.nil? }
|
384
|
+
}.delete_if { |_, v| v.nil? }
|
385
|
+
req = Google::Gax::to_proto(req, Google::Logging::V2::WriteLogEntriesRequest)
|
358
386
|
@write_log_entries.call(req, options)
|
359
387
|
end
|
360
388
|
|
361
389
|
# Lists log entries. Use this method to retrieve log entries from
|
362
390
|
# Stackdriver Logging. For ways to export log entries, see
|
363
|
-
#
|
391
|
+
# [Exporting Logs](https://cloud.google.com/logging/docs/export).
|
364
392
|
#
|
365
393
|
# @param resource_names [Array<String>]
|
366
394
|
# Required. Names of one or more parent resources from which to
|
@@ -379,8 +407,8 @@ module Google
|
|
379
407
|
# resource name format and added to the list of resources in
|
380
408
|
# +resource_names+.
|
381
409
|
# @param filter [String]
|
382
|
-
# Optional. A filter that chooses which log entries to return. See
|
383
|
-
# Logs Filters
|
410
|
+
# Optional. A filter that chooses which log entries to return. See [Advanced
|
411
|
+
# Logs Filters](/logging/docs/view/advanced_filters). Only log entries that
|
384
412
|
# match the filter are returned. An empty filter matches all log entries in
|
385
413
|
# the resources listed in +resource_names+. Referencing a parent resource
|
386
414
|
# that is not listed in +resource_names+ will cause the filter to return no
|
@@ -409,11 +437,9 @@ module Google
|
|
409
437
|
# object.
|
410
438
|
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
411
439
|
# @example
|
412
|
-
# require "google/cloud/logging/v2
|
440
|
+
# require "google/cloud/logging/v2"
|
413
441
|
#
|
414
|
-
#
|
415
|
-
#
|
416
|
-
# logging_service_v2_client = LoggingServiceV2Client.new
|
442
|
+
# logging_service_v2_client = Google::Cloud::Logging::V2::Logging.new
|
417
443
|
# resource_names = []
|
418
444
|
#
|
419
445
|
# # Iterate over all results.
|
@@ -436,13 +462,14 @@ module Google
|
|
436
462
|
order_by: nil,
|
437
463
|
page_size: nil,
|
438
464
|
options: nil
|
439
|
-
req =
|
465
|
+
req = {
|
440
466
|
resource_names: resource_names,
|
441
467
|
project_ids: project_ids,
|
442
468
|
filter: filter,
|
443
469
|
order_by: order_by,
|
444
470
|
page_size: page_size
|
445
|
-
}.delete_if { |_, v| v.nil? }
|
471
|
+
}.delete_if { |_, v| v.nil? }
|
472
|
+
req = Google::Gax::to_proto(req, Google::Logging::V2::ListLogEntriesRequest)
|
446
473
|
@list_log_entries.call(req, options)
|
447
474
|
end
|
448
475
|
|
@@ -465,11 +492,9 @@ module Google
|
|
465
492
|
# object.
|
466
493
|
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
467
494
|
# @example
|
468
|
-
# require "google/cloud/logging/v2
|
469
|
-
#
|
470
|
-
# LoggingServiceV2Client = Google::Cloud::Logging::V2::LoggingServiceV2Client
|
495
|
+
# require "google/cloud/logging/v2"
|
471
496
|
#
|
472
|
-
# logging_service_v2_client =
|
497
|
+
# logging_service_v2_client = Google::Cloud::Logging::V2::Logging.new
|
473
498
|
#
|
474
499
|
# # Iterate over all results.
|
475
500
|
# logging_service_v2_client.list_monitored_resource_descriptors.each do |element|
|
@@ -487,9 +512,10 @@ module Google
|
|
487
512
|
def list_monitored_resource_descriptors \
|
488
513
|
page_size: nil,
|
489
514
|
options: nil
|
490
|
-
req =
|
515
|
+
req = {
|
491
516
|
page_size: page_size
|
492
|
-
}.delete_if { |_, v| v.nil? }
|
517
|
+
}.delete_if { |_, v| v.nil? }
|
518
|
+
req = Google::Gax::to_proto(req, Google::Logging::V2::ListMonitoredResourceDescriptorsRequest)
|
493
519
|
@list_monitored_resource_descriptors.call(req, options)
|
494
520
|
end
|
495
521
|
|
@@ -519,12 +545,10 @@ module Google
|
|
519
545
|
# object.
|
520
546
|
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
521
547
|
# @example
|
522
|
-
# require "google/cloud/logging/v2
|
523
|
-
#
|
524
|
-
# LoggingServiceV2Client = Google::Cloud::Logging::V2::LoggingServiceV2Client
|
548
|
+
# require "google/cloud/logging/v2"
|
525
549
|
#
|
526
|
-
# logging_service_v2_client =
|
527
|
-
# formatted_parent = LoggingServiceV2Client.project_path("[PROJECT]")
|
550
|
+
# logging_service_v2_client = Google::Cloud::Logging::V2::Logging.new
|
551
|
+
# formatted_parent = Google::Cloud::Logging::V2::LoggingServiceV2Client.project_path("[PROJECT]")
|
528
552
|
#
|
529
553
|
# # Iterate over all results.
|
530
554
|
# logging_service_v2_client.list_logs(formatted_parent).each do |element|
|
@@ -543,10 +567,11 @@ module Google
|
|
543
567
|
parent,
|
544
568
|
page_size: nil,
|
545
569
|
options: nil
|
546
|
-
req =
|
570
|
+
req = {
|
547
571
|
parent: parent,
|
548
572
|
page_size: page_size
|
549
|
-
}.delete_if { |_, v| v.nil? }
|
573
|
+
}.delete_if { |_, v| v.nil? }
|
574
|
+
req = Google::Gax::to_proto(req, Google::Logging::V2::ListLogsRequest)
|
550
575
|
@list_logs.call(req, options)
|
551
576
|
end
|
552
577
|
end
|
@@ -4,6 +4,7 @@
|
|
4
4
|
"retry_codes": {
|
5
5
|
"idempotent": [
|
6
6
|
"DEADLINE_EXCEEDED",
|
7
|
+
"INTERNAL",
|
7
8
|
"UNAVAILABLE"
|
8
9
|
],
|
9
10
|
"non_idempotent": []
|
@@ -13,29 +14,29 @@
|
|
13
14
|
"initial_retry_delay_millis": 100,
|
14
15
|
"retry_delay_multiplier": 1.2,
|
15
16
|
"max_retry_delay_millis": 1000,
|
16
|
-
"initial_rpc_timeout_millis":
|
17
|
+
"initial_rpc_timeout_millis": 20000,
|
17
18
|
"rpc_timeout_multiplier": 1.5,
|
18
|
-
"max_rpc_timeout_millis":
|
19
|
-
"total_timeout_millis":
|
19
|
+
"max_rpc_timeout_millis": 60000,
|
20
|
+
"total_timeout_millis": 90000
|
20
21
|
},
|
21
22
|
"list": {
|
22
23
|
"initial_retry_delay_millis": 100,
|
23
24
|
"retry_delay_multiplier": 1.2,
|
24
25
|
"max_retry_delay_millis": 1000,
|
25
|
-
"initial_rpc_timeout_millis":
|
26
|
+
"initial_rpc_timeout_millis": 2000,
|
26
27
|
"rpc_timeout_multiplier": 1.5,
|
27
|
-
"max_rpc_timeout_millis":
|
28
|
-
"total_timeout_millis":
|
28
|
+
"max_rpc_timeout_millis": 10000,
|
29
|
+
"total_timeout_millis": 20000
|
29
30
|
}
|
30
31
|
},
|
31
32
|
"methods": {
|
32
33
|
"DeleteLog": {
|
33
|
-
"timeout_millis":
|
34
|
+
"timeout_millis": 60000,
|
34
35
|
"retry_codes_name": "idempotent",
|
35
36
|
"retry_params_name": "default"
|
36
37
|
},
|
37
38
|
"WriteLogEntries": {
|
38
|
-
"timeout_millis":
|
39
|
+
"timeout_millis": 60000,
|
39
40
|
"retry_codes_name": "non_idempotent",
|
40
41
|
"retry_params_name": "default",
|
41
42
|
"bundling": {
|
@@ -45,17 +46,17 @@
|
|
45
46
|
}
|
46
47
|
},
|
47
48
|
"ListLogEntries": {
|
48
|
-
"timeout_millis":
|
49
|
+
"timeout_millis": 10000,
|
49
50
|
"retry_codes_name": "idempotent",
|
50
51
|
"retry_params_name": "list"
|
51
52
|
},
|
52
53
|
"ListMonitoredResourceDescriptors": {
|
53
|
-
"timeout_millis":
|
54
|
+
"timeout_millis": 60000,
|
54
55
|
"retry_codes_name": "idempotent",
|
55
56
|
"retry_params_name": "default"
|
56
57
|
},
|
57
58
|
"ListLogs": {
|
58
|
-
"timeout_millis":
|
59
|
+
"timeout_millis": 60000,
|
59
60
|
"retry_codes_name": "idempotent",
|
60
61
|
"retry_params_name": "default"
|
61
62
|
}
|