google-cloud-logging 1.10.2 → 1.10.7
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 +4 -4
- data/CHANGELOG.md +30 -0
- data/TROUBLESHOOTING.md +2 -8
- data/lib/google/cloud/logging/async_writer.rb +17 -9
- data/lib/google/cloud/logging/project.rb +10 -13
- data/lib/google/cloud/logging/sink.rb +14 -17
- data/lib/google/cloud/logging/v2/config_service_v2_client.rb +194 -194
- data/lib/google/cloud/logging/v2/config_service_v2_client_config.json +26 -21
- data/lib/google/cloud/logging/v2/doc/google/logging/v2/log_entry.rb +1 -1
- data/lib/google/cloud/logging/v2/doc/google/logging/v2/logging.rb +1 -1
- data/lib/google/cloud/logging/v2/doc/google/logging/v2/logging_config.rb +6 -6
- data/lib/google/cloud/logging/v2/logging_service_v2_client.rb +122 -122
- data/lib/google/cloud/logging/v2/logging_service_v2_client_config.json +19 -14
- data/lib/google/cloud/logging/v2/metrics_service_v2_client.rb +93 -93
- data/lib/google/cloud/logging/v2/metrics_service_v2_client_config.json +13 -8
- data/lib/google/cloud/logging/version.rb +1 -1
- data/lib/google/logging/v2/logging_config_services_pb.rb +2 -2
- data/lib/google/logging/v2/logging_services_pb.rb +1 -1
- metadata +4 -4
@@ -4,9 +4,14 @@
|
|
4
4
|
"retry_codes": {
|
5
5
|
"idempotent": [
|
6
6
|
"DEADLINE_EXCEEDED",
|
7
|
+
"INTERNAL",
|
7
8
|
"UNAVAILABLE"
|
8
9
|
],
|
9
|
-
"non_idempotent": []
|
10
|
+
"non_idempotent": [],
|
11
|
+
"idempotent2": [
|
12
|
+
"DEADLINE_EXCEEDED",
|
13
|
+
"UNAVAILABLE"
|
14
|
+
]
|
10
15
|
},
|
11
16
|
"retry_params": {
|
12
17
|
"default": {
|
@@ -20,54 +25,59 @@
|
|
20
25
|
}
|
21
26
|
},
|
22
27
|
"methods": {
|
23
|
-
"
|
28
|
+
"DeleteSink": {
|
24
29
|
"timeout_millis": 60000,
|
25
30
|
"retry_codes_name": "idempotent",
|
26
31
|
"retry_params_name": "default"
|
27
32
|
},
|
28
|
-
"
|
33
|
+
"UpdateSink": {
|
29
34
|
"timeout_millis": 60000,
|
30
35
|
"retry_codes_name": "idempotent",
|
31
36
|
"retry_params_name": "default"
|
32
37
|
},
|
33
|
-
"
|
38
|
+
"DeleteExclusion": {
|
34
39
|
"timeout_millis": 60000,
|
35
|
-
"retry_codes_name": "
|
40
|
+
"retry_codes_name": "idempotent",
|
36
41
|
"retry_params_name": "default"
|
37
42
|
},
|
38
|
-
"
|
43
|
+
"ListBuckets": {
|
39
44
|
"timeout_millis": 60000,
|
40
|
-
"retry_codes_name": "
|
45
|
+
"retry_codes_name": "idempotent2",
|
41
46
|
"retry_params_name": "default"
|
42
47
|
},
|
43
|
-
"
|
48
|
+
"GetBucket": {
|
44
49
|
"timeout_millis": 60000,
|
45
|
-
"retry_codes_name": "
|
50
|
+
"retry_codes_name": "idempotent2",
|
46
51
|
"retry_params_name": "default"
|
47
52
|
},
|
48
|
-
"
|
53
|
+
"UpdateBucket": {
|
49
54
|
"timeout_millis": 60000,
|
50
55
|
"retry_codes_name": "non_idempotent",
|
51
56
|
"retry_params_name": "default"
|
52
57
|
},
|
53
|
-
"
|
58
|
+
"ListSinks": {
|
54
59
|
"timeout_millis": 60000,
|
55
|
-
"retry_codes_name": "
|
60
|
+
"retry_codes_name": "idempotent2",
|
56
61
|
"retry_params_name": "default"
|
57
62
|
},
|
58
|
-
"
|
63
|
+
"GetSink": {
|
64
|
+
"timeout_millis": 60000,
|
65
|
+
"retry_codes_name": "idempotent2",
|
66
|
+
"retry_params_name": "default"
|
67
|
+
},
|
68
|
+
"CreateSink": {
|
59
69
|
"timeout_millis": 60000,
|
60
70
|
"retry_codes_name": "non_idempotent",
|
61
71
|
"retry_params_name": "default"
|
62
72
|
},
|
63
73
|
"ListExclusions": {
|
64
74
|
"timeout_millis": 60000,
|
65
|
-
"retry_codes_name": "
|
75
|
+
"retry_codes_name": "idempotent2",
|
66
76
|
"retry_params_name": "default"
|
67
77
|
},
|
68
78
|
"GetExclusion": {
|
69
79
|
"timeout_millis": 60000,
|
70
|
-
"retry_codes_name": "
|
80
|
+
"retry_codes_name": "idempotent2",
|
71
81
|
"retry_params_name": "default"
|
72
82
|
},
|
73
83
|
"CreateExclusion": {
|
@@ -80,14 +90,9 @@
|
|
80
90
|
"retry_codes_name": "non_idempotent",
|
81
91
|
"retry_params_name": "default"
|
82
92
|
},
|
83
|
-
"DeleteExclusion": {
|
84
|
-
"timeout_millis": 60000,
|
85
|
-
"retry_codes_name": "non_idempotent",
|
86
|
-
"retry_params_name": "default"
|
87
|
-
},
|
88
93
|
"GetCmekSettings": {
|
89
94
|
"timeout_millis": 60000,
|
90
|
-
"retry_codes_name": "
|
95
|
+
"retry_codes_name": "idempotent2",
|
91
96
|
"retry_params_name": "default"
|
92
97
|
},
|
93
98
|
"UpdateCmekSettings": {
|
@@ -74,7 +74,7 @@ module Google
|
|
74
74
|
# the fractional seconds might be omitted when the timestamp is displayed.
|
75
75
|
#
|
76
76
|
# Incoming log entries should have timestamps that are no more than the [logs
|
77
|
-
# retention period](/logging/quotas) in the past, and no more than 24 hours
|
77
|
+
# retention period](https://cloud.google.com/logging/quotas) in the past, and no more than 24 hours
|
78
78
|
# in the future. Log entries outside those time boundaries will not be
|
79
79
|
# available when calling `entries.list`, but those log entries can still be
|
80
80
|
# [exported with LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
|
@@ -127,7 +127,7 @@ module Google
|
|
127
127
|
# @!attribute [rw] filter
|
128
128
|
# @return [String]
|
129
129
|
# Optional. A filter that chooses which log entries to return. See [Advanced
|
130
|
-
# Logs Queries](/logging/docs/view/advanced-queries). Only log entries that
|
130
|
+
# Logs Queries](https://cloud.google.com/logging/docs/view/advanced-queries). Only log entries that
|
131
131
|
# match the filter are returned. An empty filter matches all log entries in
|
132
132
|
# the resources listed in `resource_names`. Referencing a parent resource
|
133
133
|
# that is not listed in `resource_names` will cause the filter to return no
|
@@ -104,7 +104,7 @@ module Google
|
|
104
104
|
# Until you grant this identity write-access to the destination, log entry
|
105
105
|
# exports from this sink will fail. For more information,
|
106
106
|
# see [Granting Access for a
|
107
|
-
# Resource](/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource).
|
107
|
+
# Resource](https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource).
|
108
108
|
# Consult the destination service's documentation to determine the
|
109
109
|
# appropriate IAM roles to assign to the identity.
|
110
110
|
# @!attribute [rw] include_children
|
@@ -155,11 +155,11 @@ module Google
|
|
155
155
|
# @!attribute [rw] use_partitioned_tables
|
156
156
|
# @return [true, false]
|
157
157
|
# Optional. Whether to use [BigQuery's partition
|
158
|
-
# tables](/bigquery/docs/partitioned-tables). By default, Logging
|
158
|
+
# tables](https://cloud.google.com/bigquery/docs/partitioned-tables). By default, Logging
|
159
159
|
# creates dated tables based on the log entries' timestamps, e.g.
|
160
160
|
# syslog_20170523. With partitioned tables the date suffix is no longer
|
161
161
|
# present and [special query
|
162
|
-
# syntax](/bigquery/docs/querying-partitioned-tables) has to be used instead.
|
162
|
+
# syntax](https://cloud.google.com/bigquery/docs/querying-partitioned-tables) has to be used instead.
|
163
163
|
# In both cases, tables are sharded based on UTC timezone.
|
164
164
|
# @!attribute [rw] uses_timestamp_column_partitioning
|
165
165
|
# @return [true, false]
|
@@ -578,7 +578,7 @@ module Google
|
|
578
578
|
# Required. The CMEK settings to update.
|
579
579
|
#
|
580
580
|
# See [Enabling CMEK for Logs
|
581
|
-
# Router](/logging/docs/routing/managed-encryption) for more information.
|
581
|
+
# Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.
|
582
582
|
# @!attribute [rw] update_mask
|
583
583
|
# @return [Google::Protobuf::FieldMask]
|
584
584
|
# Optional. Field mask identifying which fields from `cmek_settings` should
|
@@ -627,7 +627,7 @@ module Google
|
|
627
627
|
# To disable CMEK for the Logs Router, set this field to an empty string.
|
628
628
|
#
|
629
629
|
# See [Enabling CMEK for Logs
|
630
|
-
# Router](/logging/docs/routing/managed-encryption) for more information.
|
630
|
+
# Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.
|
631
631
|
# @!attribute [rw] service_account_id
|
632
632
|
# @return [String]
|
633
633
|
# Output only. The service account that will be used by the Logs Router to access your
|
@@ -640,7 +640,7 @@ module Google
|
|
640
640
|
# obtain the service account ID.
|
641
641
|
#
|
642
642
|
# See [Enabling CMEK for Logs
|
643
|
-
# Router](/logging/docs/routing/managed-encryption) for more information.
|
643
|
+
# Router](https://cloud.google.com/logging/docs/routing/managed-encryption) for more information.
|
644
644
|
class CmekSettings; end
|
645
645
|
|
646
646
|
# LogBucket lifecycle states (Beta).
|
@@ -282,11 +282,6 @@ module Google
|
|
282
282
|
&Google::Logging::V2::LoggingServiceV2::Stub.method(:new)
|
283
283
|
)
|
284
284
|
|
285
|
-
@write_log_entries = Google::Gax.create_api_call(
|
286
|
-
@logging_service_v2_stub.method(:write_log_entries),
|
287
|
-
defaults["write_log_entries"],
|
288
|
-
exception_transformer: exception_transformer
|
289
|
-
)
|
290
285
|
@delete_log = Google::Gax.create_api_call(
|
291
286
|
@logging_service_v2_stub.method(:delete_log),
|
292
287
|
defaults["delete_log"],
|
@@ -300,6 +295,11 @@ module Google
|
|
300
295
|
defaults["list_log_entries"],
|
301
296
|
exception_transformer: exception_transformer
|
302
297
|
)
|
298
|
+
@write_log_entries = Google::Gax.create_api_call(
|
299
|
+
@logging_service_v2_stub.method(:write_log_entries),
|
300
|
+
defaults["write_log_entries"],
|
301
|
+
exception_transformer: exception_transformer
|
302
|
+
)
|
303
303
|
@list_monitored_resource_descriptors = Google::Gax.create_api_call(
|
304
304
|
@logging_service_v2_stub.method(:list_monitored_resource_descriptors),
|
305
305
|
defaults["list_monitored_resource_descriptors"],
|
@@ -317,122 +317,6 @@ module Google
|
|
317
317
|
|
318
318
|
# Service calls
|
319
319
|
|
320
|
-
# Writes log entries to Logging. This API method is the
|
321
|
-
# only way to send log entries to Logging. This method
|
322
|
-
# is used, directly or indirectly, by the Logging agent
|
323
|
-
# (fluentd) and all logging libraries configured to use Logging.
|
324
|
-
# A single request may contain log entries for a maximum of 1000
|
325
|
-
# different resources (projects, organizations, billing accounts or
|
326
|
-
# folders)
|
327
|
-
#
|
328
|
-
# @param entries [Array<Google::Logging::V2::LogEntry | Hash>]
|
329
|
-
# Required. The log entries to send to Logging. The order of log
|
330
|
-
# entries in this list does not matter. Values supplied in this method's
|
331
|
-
# `log_name`, `resource`, and `labels` fields are copied into those log
|
332
|
-
# entries in this list that do not include values for their corresponding
|
333
|
-
# fields. For more information, see the
|
334
|
-
# {Google::Logging::V2::LogEntry LogEntry} type.
|
335
|
-
#
|
336
|
-
# If the `timestamp` or `insert_id` fields are missing in log entries, then
|
337
|
-
# this method supplies the current time or a unique identifier, respectively.
|
338
|
-
# The supplied values are chosen so that, among the log entries that did not
|
339
|
-
# supply their own values, the entries earlier in the list will sort before
|
340
|
-
# the entries later in the list. See the `entries.list` method.
|
341
|
-
#
|
342
|
-
# Log entries with timestamps that are more than the
|
343
|
-
# [logs retention period](https://cloud.google.com/logging/quota-policy) in the past or more than
|
344
|
-
# 24 hours in the future will not be available when calling `entries.list`.
|
345
|
-
# However, those log entries can still be
|
346
|
-
# [exported with LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
|
347
|
-
#
|
348
|
-
# To improve throughput and to avoid exceeding the
|
349
|
-
# [quota limit](https://cloud.google.com/logging/quota-policy) for calls to `entries.write`,
|
350
|
-
# you should try to include several log entries in this list,
|
351
|
-
# rather than calling this method for each individual log entry.
|
352
|
-
# A hash of the same form as `Google::Logging::V2::LogEntry`
|
353
|
-
# can also be provided.
|
354
|
-
# @param log_name [String]
|
355
|
-
# Optional. A default log resource name that is assigned to all log entries
|
356
|
-
# in `entries` that do not specify a value for `log_name`:
|
357
|
-
#
|
358
|
-
# "projects/[PROJECT_ID]/logs/[LOG_ID]"
|
359
|
-
# "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
|
360
|
-
# "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
|
361
|
-
# "folders/[FOLDER_ID]/logs/[LOG_ID]"
|
362
|
-
#
|
363
|
-
# `[LOG_ID]` must be URL-encoded. For example:
|
364
|
-
#
|
365
|
-
# "projects/my-project-id/logs/syslog"
|
366
|
-
# "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"
|
367
|
-
#
|
368
|
-
# The permission `logging.logEntries.create` is needed on each project,
|
369
|
-
# organization, billing account, or folder that is receiving new log
|
370
|
-
# entries, whether the resource is specified in `logName` or in an
|
371
|
-
# individual log entry.
|
372
|
-
# @param resource [Google::Api::MonitoredResource | Hash]
|
373
|
-
# Optional. A default monitored resource object that is assigned to all log
|
374
|
-
# entries in `entries` that do not specify a value for `resource`. Example:
|
375
|
-
#
|
376
|
-
# { "type": "gce_instance",
|
377
|
-
# "labels": {
|
378
|
-
# "zone": "us-central1-a", "instance_id": "00000000000000000000" }}
|
379
|
-
#
|
380
|
-
# See {Google::Logging::V2::LogEntry LogEntry}.
|
381
|
-
# A hash of the same form as `Google::Api::MonitoredResource`
|
382
|
-
# can also be provided.
|
383
|
-
# @param labels [Hash{String => String}]
|
384
|
-
# Optional. Default labels that are added to the `labels` field of all log
|
385
|
-
# entries in `entries`. If a log entry already has a label with the same key
|
386
|
-
# as a label in this parameter, then the log entry's label is not changed.
|
387
|
-
# See {Google::Logging::V2::LogEntry LogEntry}.
|
388
|
-
# @param partial_success [true, false]
|
389
|
-
# Optional. Whether valid entries should be written even if some other
|
390
|
-
# entries fail due to INVALID_ARGUMENT or PERMISSION_DENIED errors. If any
|
391
|
-
# entry is not written, then the response status is the error associated
|
392
|
-
# with one of the failed entries and the response includes error details
|
393
|
-
# keyed by the entries' zero-based index in the `entries.write` method.
|
394
|
-
# @param dry_run [true, false]
|
395
|
-
# Optional. If true, the request should expect normal response, but the
|
396
|
-
# entries won't be persisted nor exported. Useful for checking whether the
|
397
|
-
# logging API endpoints are working properly before sending valuable data.
|
398
|
-
# @param options [Google::Gax::CallOptions]
|
399
|
-
# Overrides the default settings for this call, e.g, timeout,
|
400
|
-
# retries, etc.
|
401
|
-
# @yield [result, operation] Access the result along with the RPC operation
|
402
|
-
# @yieldparam result [Google::Logging::V2::WriteLogEntriesResponse]
|
403
|
-
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
404
|
-
# @return [Google::Logging::V2::WriteLogEntriesResponse]
|
405
|
-
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
406
|
-
# @example
|
407
|
-
# require "google/cloud/logging/v2"
|
408
|
-
#
|
409
|
-
# logging_client = Google::Cloud::Logging::V2::LoggingServiceV2Client.new
|
410
|
-
#
|
411
|
-
# # TODO: Initialize `entries`:
|
412
|
-
# entries = []
|
413
|
-
# response = logging_client.write_log_entries(entries)
|
414
|
-
|
415
|
-
def write_log_entries \
|
416
|
-
entries,
|
417
|
-
log_name: nil,
|
418
|
-
resource: nil,
|
419
|
-
labels: nil,
|
420
|
-
partial_success: nil,
|
421
|
-
dry_run: nil,
|
422
|
-
options: nil,
|
423
|
-
&block
|
424
|
-
req = {
|
425
|
-
entries: entries,
|
426
|
-
log_name: log_name,
|
427
|
-
resource: resource,
|
428
|
-
labels: labels,
|
429
|
-
partial_success: partial_success,
|
430
|
-
dry_run: dry_run
|
431
|
-
}.delete_if { |_, v| v.nil? }
|
432
|
-
req = Google::Gax::to_proto(req, Google::Logging::V2::WriteLogEntriesRequest)
|
433
|
-
@write_log_entries.call(req, options, &block)
|
434
|
-
end
|
435
|
-
|
436
320
|
# Deletes all the log entries in a log. The log reappears if it receives new
|
437
321
|
# entries. Log entries written shortly before the delete operation might not
|
438
322
|
# be deleted. Entries received after the delete operation with a timestamp
|
@@ -496,7 +380,7 @@ module Google
|
|
496
380
|
# Projects listed in the `project_ids` field are added to this list.
|
497
381
|
# @param filter [String]
|
498
382
|
# Optional. A filter that chooses which log entries to return. See [Advanced
|
499
|
-
# Logs Queries](/logging/docs/view/advanced-queries). Only log entries that
|
383
|
+
# Logs Queries](https://cloud.google.com/logging/docs/view/advanced-queries). Only log entries that
|
500
384
|
# match the filter are returned. An empty filter matches all log entries in
|
501
385
|
# the resources listed in `resource_names`. Referencing a parent resource
|
502
386
|
# that is not listed in `resource_names` will cause the filter to return no
|
@@ -565,6 +449,122 @@ module Google
|
|
565
449
|
@list_log_entries.call(req, options, &block)
|
566
450
|
end
|
567
451
|
|
452
|
+
# Writes log entries to Logging. This API method is the
|
453
|
+
# only way to send log entries to Logging. This method
|
454
|
+
# is used, directly or indirectly, by the Logging agent
|
455
|
+
# (fluentd) and all logging libraries configured to use Logging.
|
456
|
+
# A single request may contain log entries for a maximum of 1000
|
457
|
+
# different resources (projects, organizations, billing accounts or
|
458
|
+
# folders)
|
459
|
+
#
|
460
|
+
# @param entries [Array<Google::Logging::V2::LogEntry | Hash>]
|
461
|
+
# Required. The log entries to send to Logging. The order of log
|
462
|
+
# entries in this list does not matter. Values supplied in this method's
|
463
|
+
# `log_name`, `resource`, and `labels` fields are copied into those log
|
464
|
+
# entries in this list that do not include values for their corresponding
|
465
|
+
# fields. For more information, see the
|
466
|
+
# {Google::Logging::V2::LogEntry LogEntry} type.
|
467
|
+
#
|
468
|
+
# If the `timestamp` or `insert_id` fields are missing in log entries, then
|
469
|
+
# this method supplies the current time or a unique identifier, respectively.
|
470
|
+
# The supplied values are chosen so that, among the log entries that did not
|
471
|
+
# supply their own values, the entries earlier in the list will sort before
|
472
|
+
# the entries later in the list. See the `entries.list` method.
|
473
|
+
#
|
474
|
+
# Log entries with timestamps that are more than the
|
475
|
+
# [logs retention period](https://cloud.google.com/logging/quota-policy) in the past or more than
|
476
|
+
# 24 hours in the future will not be available when calling `entries.list`.
|
477
|
+
# However, those log entries can still be
|
478
|
+
# [exported with LogSinks](https://cloud.google.com/logging/docs/api/tasks/exporting-logs).
|
479
|
+
#
|
480
|
+
# To improve throughput and to avoid exceeding the
|
481
|
+
# [quota limit](https://cloud.google.com/logging/quota-policy) for calls to `entries.write`,
|
482
|
+
# you should try to include several log entries in this list,
|
483
|
+
# rather than calling this method for each individual log entry.
|
484
|
+
# A hash of the same form as `Google::Logging::V2::LogEntry`
|
485
|
+
# can also be provided.
|
486
|
+
# @param log_name [String]
|
487
|
+
# Optional. A default log resource name that is assigned to all log entries
|
488
|
+
# in `entries` that do not specify a value for `log_name`:
|
489
|
+
#
|
490
|
+
# "projects/[PROJECT_ID]/logs/[LOG_ID]"
|
491
|
+
# "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
|
492
|
+
# "billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]"
|
493
|
+
# "folders/[FOLDER_ID]/logs/[LOG_ID]"
|
494
|
+
#
|
495
|
+
# `[LOG_ID]` must be URL-encoded. For example:
|
496
|
+
#
|
497
|
+
# "projects/my-project-id/logs/syslog"
|
498
|
+
# "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity"
|
499
|
+
#
|
500
|
+
# The permission `logging.logEntries.create` is needed on each project,
|
501
|
+
# organization, billing account, or folder that is receiving new log
|
502
|
+
# entries, whether the resource is specified in `logName` or in an
|
503
|
+
# individual log entry.
|
504
|
+
# @param resource [Google::Api::MonitoredResource | Hash]
|
505
|
+
# Optional. A default monitored resource object that is assigned to all log
|
506
|
+
# entries in `entries` that do not specify a value for `resource`. Example:
|
507
|
+
#
|
508
|
+
# { "type": "gce_instance",
|
509
|
+
# "labels": {
|
510
|
+
# "zone": "us-central1-a", "instance_id": "00000000000000000000" }}
|
511
|
+
#
|
512
|
+
# See {Google::Logging::V2::LogEntry LogEntry}.
|
513
|
+
# A hash of the same form as `Google::Api::MonitoredResource`
|
514
|
+
# can also be provided.
|
515
|
+
# @param labels [Hash{String => String}]
|
516
|
+
# Optional. Default labels that are added to the `labels` field of all log
|
517
|
+
# entries in `entries`. If a log entry already has a label with the same key
|
518
|
+
# as a label in this parameter, then the log entry's label is not changed.
|
519
|
+
# See {Google::Logging::V2::LogEntry LogEntry}.
|
520
|
+
# @param partial_success [true, false]
|
521
|
+
# Optional. Whether valid entries should be written even if some other
|
522
|
+
# entries fail due to INVALID_ARGUMENT or PERMISSION_DENIED errors. If any
|
523
|
+
# entry is not written, then the response status is the error associated
|
524
|
+
# with one of the failed entries and the response includes error details
|
525
|
+
# keyed by the entries' zero-based index in the `entries.write` method.
|
526
|
+
# @param dry_run [true, false]
|
527
|
+
# Optional. If true, the request should expect normal response, but the
|
528
|
+
# entries won't be persisted nor exported. Useful for checking whether the
|
529
|
+
# logging API endpoints are working properly before sending valuable data.
|
530
|
+
# @param options [Google::Gax::CallOptions]
|
531
|
+
# Overrides the default settings for this call, e.g, timeout,
|
532
|
+
# retries, etc.
|
533
|
+
# @yield [result, operation] Access the result along with the RPC operation
|
534
|
+
# @yieldparam result [Google::Logging::V2::WriteLogEntriesResponse]
|
535
|
+
# @yieldparam operation [GRPC::ActiveCall::Operation]
|
536
|
+
# @return [Google::Logging::V2::WriteLogEntriesResponse]
|
537
|
+
# @raise [Google::Gax::GaxError] if the RPC is aborted.
|
538
|
+
# @example
|
539
|
+
# require "google/cloud/logging/v2"
|
540
|
+
#
|
541
|
+
# logging_client = Google::Cloud::Logging::V2::LoggingServiceV2Client.new
|
542
|
+
#
|
543
|
+
# # TODO: Initialize `entries`:
|
544
|
+
# entries = []
|
545
|
+
# response = logging_client.write_log_entries(entries)
|
546
|
+
|
547
|
+
def write_log_entries \
|
548
|
+
entries,
|
549
|
+
log_name: nil,
|
550
|
+
resource: nil,
|
551
|
+
labels: nil,
|
552
|
+
partial_success: nil,
|
553
|
+
dry_run: nil,
|
554
|
+
options: nil,
|
555
|
+
&block
|
556
|
+
req = {
|
557
|
+
entries: entries,
|
558
|
+
log_name: log_name,
|
559
|
+
resource: resource,
|
560
|
+
labels: labels,
|
561
|
+
partial_success: partial_success,
|
562
|
+
dry_run: dry_run
|
563
|
+
}.delete_if { |_, v| v.nil? }
|
564
|
+
req = Google::Gax::to_proto(req, Google::Logging::V2::WriteLogEntriesRequest)
|
565
|
+
@write_log_entries.call(req, options, &block)
|
566
|
+
end
|
567
|
+
|
568
568
|
# Lists the descriptors for monitored resource types used by Logging.
|
569
569
|
#
|
570
570
|
# @param page_size [Integer]
|
@@ -4,9 +4,14 @@
|
|
4
4
|
"retry_codes": {
|
5
5
|
"idempotent": [
|
6
6
|
"DEADLINE_EXCEEDED",
|
7
|
+
"INTERNAL",
|
7
8
|
"UNAVAILABLE"
|
8
9
|
],
|
9
|
-
"non_idempotent": []
|
10
|
+
"non_idempotent": [],
|
11
|
+
"idempotent2": [
|
12
|
+
"DEADLINE_EXCEEDED",
|
13
|
+
"UNAVAILABLE"
|
14
|
+
]
|
10
15
|
},
|
11
16
|
"retry_params": {
|
12
17
|
"default": {
|
@@ -20,9 +25,19 @@
|
|
20
25
|
}
|
21
26
|
},
|
22
27
|
"methods": {
|
28
|
+
"DeleteLog": {
|
29
|
+
"timeout_millis": 60000,
|
30
|
+
"retry_codes_name": "idempotent",
|
31
|
+
"retry_params_name": "default"
|
32
|
+
},
|
33
|
+
"ListLogEntries": {
|
34
|
+
"timeout_millis": 10000,
|
35
|
+
"retry_codes_name": "idempotent",
|
36
|
+
"retry_params_name": "default"
|
37
|
+
},
|
23
38
|
"WriteLogEntries": {
|
24
39
|
"timeout_millis": 60000,
|
25
|
-
"retry_codes_name": "
|
40
|
+
"retry_codes_name": "idempotent",
|
26
41
|
"retry_params_name": "default",
|
27
42
|
"bundling": {
|
28
43
|
"element_count_threshold": 1000,
|
@@ -30,24 +45,14 @@
|
|
30
45
|
"delay_threshold_millis": 50
|
31
46
|
}
|
32
47
|
},
|
33
|
-
"DeleteLog": {
|
34
|
-
"timeout_millis": 60000,
|
35
|
-
"retry_codes_name": "non_idempotent",
|
36
|
-
"retry_params_name": "default"
|
37
|
-
},
|
38
|
-
"ListLogEntries": {
|
39
|
-
"timeout_millis": 10000,
|
40
|
-
"retry_codes_name": "non_idempotent",
|
41
|
-
"retry_params_name": "default"
|
42
|
-
},
|
43
48
|
"ListMonitoredResourceDescriptors": {
|
44
49
|
"timeout_millis": 60000,
|
45
|
-
"retry_codes_name": "
|
50
|
+
"retry_codes_name": "idempotent2",
|
46
51
|
"retry_params_name": "default"
|
47
52
|
},
|
48
53
|
"ListLogs": {
|
49
54
|
"timeout_millis": 60000,
|
50
|
-
"retry_codes_name": "
|
55
|
+
"retry_codes_name": "idempotent2",
|
51
56
|
"retry_params_name": "default"
|
52
57
|
}
|
53
58
|
}
|