google-cloud-logging 1.10.0 → 1.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/google/cloud/logging/v2/config_service_v2_client.rb +71 -5
- data/lib/google/cloud/logging/v2/logging_service_v2_client.rb +64 -51
- data/lib/google/cloud/logging/v2/logging_service_v2_client_config.json +8 -3
- data/lib/google/cloud/logging/version.rb +1 -1
- data/lib/google/logging/v2/logging_config_services_pb.rb +1 -2
- data/lib/google/logging/v2/logging_metrics_services_pb.rb +1 -2
- data/lib/google/logging/v2/logging_services_pb.rb +1 -2
- 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: ed920587c56cb57f57505e5ea4ee30dae5ac01921fbbd9d1f45e39e92e9835aa
|
4
|
+
data.tar.gz: '08204ac2e295318ed2a4b27047467047c52ba04b9d88f2c7620c2d17a2022e94'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0acd45976a00020f802c016bd0e685111451ffad5e059c3a600acf3007624cb382a4cd8df7c6eb3246a8aaf5236af3fddb8b437d13ce25ca4f4d21e6c7a5f1c2
|
7
|
+
data.tar.gz: efc1bce358b585489277e87b503c82d6f69c2a85a2d6c3c9e06d4879fc6ccbc5299d7224e054134e26eb917d01b1ee2689ce7dbc57a0f44ead726a44c9a12cbf
|
data/CHANGELOG.md
CHANGED
@@ -86,18 +86,42 @@ module Google
|
|
86
86
|
|
87
87
|
private_constant :BILLING_ACCOUNT_PATH_TEMPLATE
|
88
88
|
|
89
|
+
BILLING_ACCOUNT_LOCATION_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
90
|
+
"billingAccounts/{billing_account}/locations/{location}"
|
91
|
+
)
|
92
|
+
|
93
|
+
private_constant :BILLING_ACCOUNT_LOCATION_PATH_TEMPLATE
|
94
|
+
|
89
95
|
FOLDER_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
90
96
|
"folders/{folder}"
|
91
97
|
)
|
92
98
|
|
93
99
|
private_constant :FOLDER_PATH_TEMPLATE
|
94
100
|
|
101
|
+
FOLDER_LOCATION_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
102
|
+
"folders/{folder}/locations/{location}"
|
103
|
+
)
|
104
|
+
|
105
|
+
private_constant :FOLDER_LOCATION_PATH_TEMPLATE
|
106
|
+
|
107
|
+
LOCATION_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
108
|
+
"projects/{project}/locations/{location}"
|
109
|
+
)
|
110
|
+
|
111
|
+
private_constant :LOCATION_PATH_TEMPLATE
|
112
|
+
|
95
113
|
ORGANIZATION_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
96
114
|
"organizations/{organization}"
|
97
115
|
)
|
98
116
|
|
99
117
|
private_constant :ORGANIZATION_PATH_TEMPLATE
|
100
118
|
|
119
|
+
ORGANIZATION_LOCATION_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
120
|
+
"organizations/{organization}/locations/{location}"
|
121
|
+
)
|
122
|
+
|
123
|
+
private_constant :ORGANIZATION_LOCATION_PATH_TEMPLATE
|
124
|
+
|
101
125
|
PROJECT_PATH_TEMPLATE = Google::Gax::PathTemplate.new(
|
102
126
|
"projects/{project}"
|
103
127
|
)
|
@@ -113,6 +137,17 @@ module Google
|
|
113
137
|
)
|
114
138
|
end
|
115
139
|
|
140
|
+
# Returns a fully-qualified billing_account_location resource name string.
|
141
|
+
# @param billing_account [String]
|
142
|
+
# @param location [String]
|
143
|
+
# @return [String]
|
144
|
+
def self.billing_account_location_path billing_account, location
|
145
|
+
BILLING_ACCOUNT_LOCATION_PATH_TEMPLATE.render(
|
146
|
+
:"billing_account" => billing_account,
|
147
|
+
:"location" => location
|
148
|
+
)
|
149
|
+
end
|
150
|
+
|
116
151
|
# Returns a fully-qualified folder resource name string.
|
117
152
|
# @param folder [String]
|
118
153
|
# @return [String]
|
@@ -122,6 +157,28 @@ module Google
|
|
122
157
|
)
|
123
158
|
end
|
124
159
|
|
160
|
+
# Returns a fully-qualified folder_location resource name string.
|
161
|
+
# @param folder [String]
|
162
|
+
# @param location [String]
|
163
|
+
# @return [String]
|
164
|
+
def self.folder_location_path folder, location
|
165
|
+
FOLDER_LOCATION_PATH_TEMPLATE.render(
|
166
|
+
:"folder" => folder,
|
167
|
+
:"location" => location
|
168
|
+
)
|
169
|
+
end
|
170
|
+
|
171
|
+
# Returns a fully-qualified location resource name string.
|
172
|
+
# @param project [String]
|
173
|
+
# @param location [String]
|
174
|
+
# @return [String]
|
175
|
+
def self.location_path project, location
|
176
|
+
LOCATION_PATH_TEMPLATE.render(
|
177
|
+
:"project" => project,
|
178
|
+
:"location" => location
|
179
|
+
)
|
180
|
+
end
|
181
|
+
|
125
182
|
# Returns a fully-qualified organization resource name string.
|
126
183
|
# @param organization [String]
|
127
184
|
# @return [String]
|
@@ -131,6 +188,17 @@ module Google
|
|
131
188
|
)
|
132
189
|
end
|
133
190
|
|
191
|
+
# Returns a fully-qualified organization_location resource name string.
|
192
|
+
# @param organization [String]
|
193
|
+
# @param location [String]
|
194
|
+
# @return [String]
|
195
|
+
def self.organization_location_path organization, location
|
196
|
+
ORGANIZATION_LOCATION_PATH_TEMPLATE.render(
|
197
|
+
:"organization" => organization,
|
198
|
+
:"location" => location
|
199
|
+
)
|
200
|
+
end
|
201
|
+
|
134
202
|
# Returns a fully-qualified project resource name string.
|
135
203
|
# @param project [String]
|
136
204
|
# @return [String]
|
@@ -411,17 +479,15 @@ module Google
|
|
411
479
|
# require "google/cloud/logging/v2"
|
412
480
|
#
|
413
481
|
# config_client = Google::Cloud::Logging::V2::ConfigServiceV2Client.new
|
414
|
-
#
|
415
|
-
# # TODO: Initialize `parent`:
|
416
|
-
# parent = ''
|
482
|
+
# formatted_parent = Google::Cloud::Logging::V2::ConfigServiceV2Client.location_path("[PROJECT]", "[LOCATION]")
|
417
483
|
#
|
418
484
|
# # Iterate over all results.
|
419
|
-
# config_client.list_buckets(
|
485
|
+
# config_client.list_buckets(formatted_parent).each do |element|
|
420
486
|
# # Process element.
|
421
487
|
# end
|
422
488
|
#
|
423
489
|
# # Or iterate over results one page at a time.
|
424
|
-
# config_client.list_buckets(
|
490
|
+
# config_client.list_buckets(formatted_parent).each_page do |page|
|
425
491
|
# # Process each page at a time.
|
426
492
|
# page.each do |element|
|
427
493
|
# # Process element.
|
@@ -69,6 +69,18 @@ module Google
|
|
69
69
|
|
70
70
|
private_constant :PAGE_DESCRIPTORS
|
71
71
|
|
72
|
+
BUNDLE_DESCRIPTORS = {
|
73
|
+
"write_log_entries" => Google::Gax::BundleDescriptor.new(
|
74
|
+
"entries",
|
75
|
+
[
|
76
|
+
"logName",
|
77
|
+
"resource",
|
78
|
+
"labels"
|
79
|
+
])
|
80
|
+
}.freeze
|
81
|
+
|
82
|
+
private_constant :BUNDLE_DESCRIPTORS
|
83
|
+
|
72
84
|
# The scopes needed to make gRPC calls to all of the methods defined in
|
73
85
|
# this service.
|
74
86
|
ALL_SCOPES = [
|
@@ -231,6 +243,7 @@ module Google
|
|
231
243
|
client_config,
|
232
244
|
Google::Gax::Grpc::STATUS_CODE_NAMES,
|
233
245
|
timeout,
|
246
|
+
bundle_descriptors: BUNDLE_DESCRIPTORS,
|
234
247
|
page_descriptors: PAGE_DESCRIPTORS,
|
235
248
|
errors: Google::Gax::Grpc::API_ERRORS,
|
236
249
|
metadata: headers
|
@@ -252,6 +265,11 @@ module Google
|
|
252
265
|
&Google::Logging::V2::LoggingServiceV2::Stub.method(:new)
|
253
266
|
)
|
254
267
|
|
268
|
+
@write_log_entries = Google::Gax.create_api_call(
|
269
|
+
@logging_service_v2_stub.method(:write_log_entries),
|
270
|
+
defaults["write_log_entries"],
|
271
|
+
exception_transformer: exception_transformer
|
272
|
+
)
|
255
273
|
@delete_log = Google::Gax.create_api_call(
|
256
274
|
@logging_service_v2_stub.method(:delete_log),
|
257
275
|
defaults["delete_log"],
|
@@ -260,11 +278,6 @@ module Google
|
|
260
278
|
{'log_name' => request.log_name}
|
261
279
|
end
|
262
280
|
)
|
263
|
-
@write_log_entries = Google::Gax.create_api_call(
|
264
|
-
@logging_service_v2_stub.method(:write_log_entries),
|
265
|
-
defaults["write_log_entries"],
|
266
|
-
exception_transformer: exception_transformer
|
267
|
-
)
|
268
281
|
@list_log_entries = Google::Gax.create_api_call(
|
269
282
|
@logging_service_v2_stub.method(:list_log_entries),
|
270
283
|
defaults["list_log_entries"],
|
@@ -287,52 +300,6 @@ module Google
|
|
287
300
|
|
288
301
|
# Service calls
|
289
302
|
|
290
|
-
# Deletes all the log entries in a log. The log reappears if it receives new
|
291
|
-
# entries. Log entries written shortly before the delete operation might not
|
292
|
-
# be deleted. Entries received after the delete operation with a timestamp
|
293
|
-
# before the operation will be deleted.
|
294
|
-
#
|
295
|
-
# @param log_name [String]
|
296
|
-
# Required. The resource name of the log to delete:
|
297
|
-
#
|
298
|
-
# "projects/[PROJECT_ID]/logs/[LOG_ID]"
|
299
|
-
# "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
|
300
|
-
# "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
|
301
|
-
# "folders/[FOLDER_ID]/logs/[LOG_ID]"
|
302
|
-
#
|
303
|
-
# `[LOG_ID]` must be URL-encoded. For example,
|
304
|
-
# `"projects/my-project-id/logs/syslog"`,
|
305
|
-
# `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
|
306
|
-
# For more information about log names, see
|
307
|
-
# {Google::Logging::V2::LogEntry LogEntry}.
|
308
|
-
# @param options [Google::Gax::CallOptions]
|
309
|
-
# Overrides the default settings for this call, e.g, timeout,
|
310
|
-
# retries, etc.
|
311
|
-
# @yield [result, operation] Access the result along with the RPC operation
|
312
|
-
# @yieldparam result []
|
313
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
314
|
-
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
315
|
-
# @example
|
316
|
-
# require "google/cloud/logging/v2"
|
317
|
-
#
|
318
|
-
# logging_client = Google::Cloud::Logging::V2::LoggingServiceV2Client.new
|
319
|
-
#
|
320
|
-
# # TODO: Initialize `log_name`:
|
321
|
-
# log_name = ''
|
322
|
-
# logging_client.delete_log(log_name)
|
323
|
-
|
324
|
-
def delete_log \
|
325
|
-
log_name,
|
326
|
-
options: nil,
|
327
|
-
&block
|
328
|
-
req = {
|
329
|
-
log_name: log_name
|
330
|
-
}.delete_if { |_, v| v.nil? }
|
331
|
-
req = Google::Gax::to_proto(req, Google::Logging::V2::DeleteLogRequest)
|
332
|
-
@delete_log.call(req, options, &block)
|
333
|
-
nil
|
334
|
-
end
|
335
|
-
|
336
303
|
# Writes log entries to Logging. This API method is the
|
337
304
|
# only way to send log entries to Logging. This method
|
338
305
|
# is used, directly or indirectly, by the Logging agent
|
@@ -449,6 +416,52 @@ module Google
|
|
449
416
|
@write_log_entries.call(req, options, &block)
|
450
417
|
end
|
451
418
|
|
419
|
+
# Deletes all the log entries in a log. The log reappears if it receives new
|
420
|
+
# entries. Log entries written shortly before the delete operation might not
|
421
|
+
# be deleted. Entries received after the delete operation with a timestamp
|
422
|
+
# before the operation will be deleted.
|
423
|
+
#
|
424
|
+
# @param log_name [String]
|
425
|
+
# Required. The resource name of the log to delete:
|
426
|
+
#
|
427
|
+
# "projects/[PROJECT_ID]/logs/[LOG_ID]"
|
428
|
+
# "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
|
429
|
+
# "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
|
430
|
+
# "folders/[FOLDER_ID]/logs/[LOG_ID]"
|
431
|
+
#
|
432
|
+
# `[LOG_ID]` must be URL-encoded. For example,
|
433
|
+
# `"projects/my-project-id/logs/syslog"`,
|
434
|
+
# `"organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"`.
|
435
|
+
# For more information about log names, see
|
436
|
+
# {Google::Logging::V2::LogEntry LogEntry}.
|
437
|
+
# @param options [Google::Gax::CallOptions]
|
438
|
+
# Overrides the default settings for this call, e.g, timeout,
|
439
|
+
# retries, etc.
|
440
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
441
|
+
# @yieldparam result []
|
442
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
443
|
+
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
444
|
+
# @example
|
445
|
+
# require "google/cloud/logging/v2"
|
446
|
+
#
|
447
|
+
# logging_client = Google::Cloud::Logging::V2::LoggingServiceV2Client.new
|
448
|
+
#
|
449
|
+
# # TODO: Initialize `log_name`:
|
450
|
+
# log_name = ''
|
451
|
+
# logging_client.delete_log(log_name)
|
452
|
+
|
453
|
+
def delete_log \
|
454
|
+
log_name,
|
455
|
+
options: nil,
|
456
|
+
&block
|
457
|
+
req = {
|
458
|
+
log_name: log_name
|
459
|
+
}.delete_if { |_, v| v.nil? }
|
460
|
+
req = Google::Gax::to_proto(req, Google::Logging::V2::DeleteLogRequest)
|
461
|
+
@delete_log.call(req, options, &block)
|
462
|
+
nil
|
463
|
+
end
|
464
|
+
|
452
465
|
# Lists log entries. Use this method to retrieve log entries that originated
|
453
466
|
# from a project/folder/organization/billing account. For ways to export log
|
454
467
|
# entries, see [Exporting Logs](https://cloud.google.com/logging/docs/export).
|
@@ -20,12 +20,17 @@
|
|
20
20
|
}
|
21
21
|
},
|
22
22
|
"methods": {
|
23
|
-
"
|
23
|
+
"WriteLogEntries": {
|
24
24
|
"timeout_millis": 60000,
|
25
25
|
"retry_codes_name": "non_idempotent",
|
26
|
-
"retry_params_name": "default"
|
26
|
+
"retry_params_name": "default",
|
27
|
+
"bundling": {
|
28
|
+
"element_count_threshold": 1000,
|
29
|
+
"request_byte_threshold": 1048576,
|
30
|
+
"delay_threshold_millis": 50
|
31
|
+
}
|
27
32
|
},
|
28
|
-
"
|
33
|
+
"DeleteLog": {
|
29
34
|
"timeout_millis": 60000,
|
30
35
|
"retry_codes_name": "non_idempotent",
|
31
36
|
"retry_params_name": "default"
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
2
|
# Source: google/logging/v2/logging_config.proto for package 'google.logging.v2'
|
3
3
|
# Original file comments:
|
4
|
-
# Copyright
|
4
|
+
# Copyright 2020 Google LLC
|
5
5
|
#
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
7
|
# you may not use this file except in compliance with the License.
|
@@ -15,7 +15,6 @@
|
|
15
15
|
# See the License for the specific language governing permissions and
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
|
-
#
|
19
18
|
|
20
19
|
|
21
20
|
require 'grpc'
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
2
|
# Source: google/logging/v2/logging_metrics.proto for package 'google.logging.v2'
|
3
3
|
# Original file comments:
|
4
|
-
# Copyright
|
4
|
+
# Copyright 2020 Google LLC
|
5
5
|
#
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
7
|
# you may not use this file except in compliance with the License.
|
@@ -15,7 +15,6 @@
|
|
15
15
|
# See the License for the specific language governing permissions and
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
|
-
#
|
19
18
|
|
20
19
|
|
21
20
|
require 'grpc'
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
2
|
# Source: google/logging/v2/logging.proto for package 'google.logging.v2'
|
3
3
|
# Original file comments:
|
4
|
-
# Copyright
|
4
|
+
# Copyright 2020 Google LLC
|
5
5
|
#
|
6
6
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
7
7
|
# you may not use this file except in compliance with the License.
|
@@ -15,7 +15,6 @@
|
|
15
15
|
# See the License for the specific language governing permissions and
|
16
16
|
# limitations under the License.
|
17
17
|
#
|
18
|
-
#
|
19
18
|
|
20
19
|
|
21
20
|
require 'grpc'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-logging
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.10.
|
4
|
+
version: 1.10.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Moore
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-03-
|
12
|
+
date: 2020-03-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: google-cloud-core
|