google-cloud-logging 0.24.0 → 0.24.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (25) hide show
  1. checksums.yaml +4 -4
  2. data/lib/google/cloud/logging/logger.rb +2 -3
  3. data/lib/google/cloud/logging/service.rb +6 -6
  4. data/lib/google/cloud/logging/v2/config_service_v2_client.rb +66 -35
  5. data/lib/google/cloud/logging/v2/config_service_v2_client_config.json +5 -5
  6. data/lib/google/cloud/logging/v2/doc/google/api/label.rb +2 -2
  7. data/lib/google/cloud/logging/v2/doc/google/api/monitored_resource.rb +2 -2
  8. data/lib/google/cloud/logging/v2/doc/google/logging/type/http_request.rb +2 -2
  9. data/lib/google/cloud/logging/v2/doc/google/logging/v2/log_entry.rb +32 -2
  10. data/lib/google/cloud/logging/v2/doc/google/logging/v2/logging.rb +54 -11
  11. data/lib/google/cloud/logging/v2/doc/google/logging/v2/logging_config.rb +80 -51
  12. data/lib/google/cloud/logging/v2/doc/google/logging/v2/logging_metrics.rb +5 -4
  13. data/lib/google/cloud/logging/v2/doc/google/protobuf/any.rb +2 -2
  14. data/lib/google/cloud/logging/v2/doc/google/protobuf/duration.rb +2 -2
  15. data/lib/google/cloud/logging/v2/doc/google/protobuf/timestamp.rb +2 -2
  16. data/lib/google/cloud/logging/v2/logging_service_v2_client.rb +105 -22
  17. data/lib/google/cloud/logging/v2/logging_service_v2_client_config.json +16 -6
  18. data/lib/google/cloud/logging/v2/metrics_service_v2_client.rb +14 -11
  19. data/lib/google/cloud/logging/v2/metrics_service_v2_client_config.json +5 -5
  20. data/lib/google/cloud/logging/version.rb +1 -1
  21. data/lib/google/logging/v2/log_entry_pb.rb +8 -0
  22. data/lib/google/logging/v2/logging_config_services_pb.rb +15 -3
  23. data/lib/google/logging/v2/logging_pb.rb +11 -0
  24. data/lib/google/logging/v2/logging_services_pb.rb +7 -3
  25. metadata +2 -16
@@ -1,10 +1,10 @@
1
- # Copyright 2016 Google Inc. All rights reserved.
1
+ # Copyright 2017, Google Inc. All rights reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
5
5
  # You may obtain a copy of the License at
6
6
  #
7
- # http://www.apache.org/licenses/LICENSE-2.0
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
8
  #
9
9
  # Unless required by applicable law or agreed to in writing, software
10
10
  # distributed under the License is distributed on an "AS IS" BASIS,
@@ -15,11 +15,10 @@
15
15
  module Google
16
16
  module Logging
17
17
  module V2
18
- # Describes a sink used to export log entries outside of Stackdriver Logging.
19
- # A logs filter controls which log entries are exported. Sinks can have a
20
- # start time and an end time; these can be used to place log entries from an
21
- # exact time range into a particular destination. If both +start_time+ and
22
- # +end_time+ are present, then +start_time+ must be less than +end_time+.
18
+ # Describes a sink used to export log entries to one of the following
19
+ # destinations in any project: a Cloud Storage bucket, a BigQuery dataset, or a
20
+ # Cloud Pub/Sub topic. A logs filter controls which log entries are
21
+ # exported. The sink must be created within a project or organization.
23
22
  # @!attribute [rw] name
24
23
  # @return [String]
25
24
  # Required. The client-assigned sink identifier, unique within the
@@ -35,47 +34,61 @@ module Google
35
34
  # "bigquery.googleapis.com/projects/[PROJECT_ID]/datasets/[DATASET]"
36
35
  # "pubsub.googleapis.com/projects/[PROJECT_ID]/topics/[TOPIC_ID]"
37
36
  #
38
- # For more information, see
37
+ # The sink's +writer_identity+, set when the sink is created, must
38
+ # have permission to write to the destination or else the log
39
+ # entries are not exported. For more information, see
39
40
  # {Exporting Logs With Sinks}[https://cloud.google.com/logging/docs/api/tasks/exporting-logs].
40
41
  # @!attribute [rw] filter
41
42
  # @return [String]
42
- # Optional. An {advanced logs filter}[https://cloud.google.com/logging/docs/view/advanced_filters].
43
- # Only log entries matching the filter are exported. The filter
44
- # must be consistent with the log entry format specified by the
45
- # +outputVersionFormat+ parameter, regardless of the format of the
46
- # log entry that was originally ingested by Stackdriver Logging.
47
- # The following example uses field names in the v2 log entry format:
43
+ # Optional.
44
+ # An {advanced logs filter}[https://cloud.google.com/logging/docs/view/advanced_filters]. The only
45
+ # exported log entries are those that are in the resource owning the sink and
46
+ # that match the filter. The filter must use the log entry format specified
47
+ # by the +output_version_format+ parameter. For example, in the v2 format:
48
48
  #
49
49
  # logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERROR
50
50
  # @!attribute [rw] output_version_format
51
51
  # @return [Google::Logging::V2::LogSink::VersionFormat]
52
- # Optional. The log entry version to use for this sink's exported log
53
- # entries. This version does not have to correspond to the version of the
54
- # log entry that was written to Stackdriver Logging. If omitted, the
55
- # v2 format is used.
52
+ # Optional. The log entry format to use for this sink's exported log
53
+ # entries. The v2 format is used by default.
54
+ # **The v1 format is deprecated** and should be used only as part of a
55
+ # migration effort to v2.
56
+ # See {Migration to the v2 API}[https://cloud.google.com/logging/docs/api/v2/migration-to-v2].
56
57
  # @!attribute [rw] writer_identity
57
58
  # @return [String]
58
- # Output only. An IAM identity—a service account or group—that
59
- # will write exported log entries to the destination on behalf of Stackdriver
60
- # Logging. You must grant this identity write-access to the destination.
61
- # Consult the destination service's documentation to determine the exact role
62
- # that must be granted.
59
+ # Output only. An IAM identity—a service account or group—under
60
+ # which Stackdriver Logging writes the exported log entries to the sink's
61
+ # destination. This field is set by
62
+ # {sinks.create}[https://cloud.google.com/logging/docs/api/reference/rest/v2/projects.sinks/create]
63
+ # and
64
+ # {sinks.update}[https://cloud.google.com/logging/docs/api/reference/rest/v2/projects.sinks/update],
65
+ # based on the setting of +unique_writer_identity+ in those methods.
66
+ #
67
+ # Until you grant this identity write-access to the destination, log entry
68
+ # exports from this sink will fail. For more information,
69
+ # see {Granting access for a
70
+ # resource}[https://cloud.google.com/iam/docs/granting-roles-to-service-accounts#granting_access_to_a_service_account_for_a_resource].
71
+ # Consult the destination service's documentation to determine the
72
+ # appropriate IAM roles to assign to the identity.
63
73
  # @!attribute [rw] start_time
64
74
  # @return [Google::Protobuf::Timestamp]
65
- # Optional. The time at which this sink will begin exporting log entries. If
66
- # this value is present, then log entries are exported only if +start_time+
67
- # <=+entry.timestamp+.
75
+ # Optional. The time at which this sink will begin exporting log entries.
76
+ # Log entries are exported only if their timestamp is not earlier than the
77
+ # start time. The default value of this field is the time the sink is
78
+ # created or updated.
68
79
  # @!attribute [rw] end_time
69
80
  # @return [Google::Protobuf::Timestamp]
70
- # Optional. Time at which this sink will stop exporting log entries. If this
71
- # value is present, then log entries are exported only if +entry.timestamp+ <
72
- # +end_time+.
81
+ # Optional. The time at which this sink will stop exporting log entries. Log
82
+ # entries are exported only if their timestamp is earlier than the end time.
83
+ # If this field is not supplied, there is no end time. If both a start time
84
+ # and an end time are provided, then the end time must be later than the
85
+ # start time.
73
86
  class LogSink
74
87
  # Available log entry formats. Log entries can be written to Stackdriver
75
88
  # Logging in either format and can be exported in either format.
76
89
  # Version 2 is the preferred format.
77
90
  module VersionFormat
78
- # An unspecified version format will default to V2.
91
+ # An unspecified format version that will default to V2.
79
92
  VERSION_FORMAT_UNSPECIFIED = 0
80
93
 
81
94
  # +LogEntry+ version 2 format.
@@ -89,10 +102,8 @@ module Google
89
102
  # The parameters to +ListSinks+.
90
103
  # @!attribute [rw] parent
91
104
  # @return [String]
92
- # Required. The resource name where this sink was created:
93
- #
94
- # "projects/[PROJECT_ID]"
95
- # "organizations/[ORGANIZATION_ID]"
105
+ # Required. The parent resource whose sinks are to be listed.
106
+ # Examples: +"projects/my-logging-project"+, +"organizations/123456789"+.
96
107
  # @!attribute [rw] page_token
97
108
  # @return [String]
98
109
  # Optional. If present, then retrieve the next batch of results from the
@@ -120,10 +131,12 @@ module Google
120
131
  # The parameters to +GetSink+.
121
132
  # @!attribute [rw] sink_name
122
133
  # @return [String]
123
- # Required. The resource name of the sink to return:
134
+ # Required. The parent resource name of the sink:
124
135
  #
125
136
  # "projects/[PROJECT_ID]/sinks/[SINK_ID]"
126
137
  # "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
138
+ #
139
+ # Example: +"projects/my-project-id/sinks/my-sink-id"+.
127
140
  class GetSinkRequest; end
128
141
 
129
142
  # The parameters to +CreateSink+.
@@ -133,24 +146,32 @@ module Google
133
146
  #
134
147
  # "projects/[PROJECT_ID]"
135
148
  # "organizations/[ORGANIZATION_ID]"
149
+ #
150
+ # Examples: +"projects/my-logging-project"+, +"organizations/123456789"+.
136
151
  # @!attribute [rw] sink
137
152
  # @return [Google::Logging::V2::LogSink]
138
153
  # Required. The new sink, whose +name+ parameter is a sink identifier that
139
154
  # is not already in use.
140
155
  # @!attribute [rw] unique_writer_identity
141
156
  # @return [true, false]
142
- # Optional. Whether the sink will have a dedicated service account returned
143
- # in the sink's writer_identity. Set this field to be true to export
144
- # logs from one project to a different project. This field is ignored for
145
- # non-project sinks (e.g. organization sinks) because those sinks are
146
- # required to have dedicated service accounts.
157
+ # Optional. Determines the kind of IAM identity returned as +writer_identity+
158
+ # in the new sink. If this value is omitted or set to false, and if the
159
+ # sink's parent is a project, then the value returned as +writer_identity+ is
160
+ # +cloud-logs@google.com+, the same identity used before the addition of
161
+ # writer identities to this API. The sink's destination must be in the same
162
+ # project as the sink itself.
163
+ #
164
+ # If this field is set to true, or if the sink is owned by a non-project
165
+ # resource such as an organization, then the value of +writer_identity+ will
166
+ # be a unique service account used only for exports from the new sink. For
167
+ # more information, see +writer_identity+ in LogSink.
147
168
  class CreateSinkRequest; end
148
169
 
149
170
  # The parameters to +UpdateSink+.
150
171
  # @!attribute [rw] sink_name
151
172
  # @return [String]
152
- # Required. The resource name of the sink to update, including the parent
153
- # resource and the sink identifier:
173
+ # Required. The full resource name of the sink to update, including the
174
+ # parent resource and the sink identifier:
154
175
  #
155
176
  # "projects/[PROJECT_ID]/sinks/[SINK_ID]"
156
177
  # "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
@@ -159,27 +180,35 @@ module Google
159
180
  # @!attribute [rw] sink
160
181
  # @return [Google::Logging::V2::LogSink]
161
182
  # Required. The updated sink, whose name is the same identifier that appears
162
- # as part of +sinkName+. If +sinkName+ does not exist, then
183
+ # as part of +sink_name+. If +sink_name+ does not exist, then
163
184
  # this method creates a new sink.
164
185
  # @!attribute [rw] unique_writer_identity
165
186
  # @return [true, false]
166
- # Optional. Whether the sink will have a dedicated service account returned
167
- # in the sink's writer_identity. Set this field to be true to export
168
- # logs from one project to a different project. This field is ignored for
169
- # non-project sinks (e.g. organization sinks) because those sinks are
170
- # required to have dedicated service accounts.
187
+ # Optional. See
188
+ # {sinks.create}[https://cloud.google.com/logging/docs/api/reference/rest/v2/projects.sinks/create]
189
+ # for a description of this field. When updating a sink, the effect of this
190
+ # field on the value of +writer_identity+ in the updated sink depends on both
191
+ # the old and new values of this field:
192
+ #
193
+ # + If the old and new values of this field are both false or both true,
194
+ # then there is no change to the sink's +writer_identity+.
195
+ # + If the old value was false and the new value is true, then
196
+ # +writer_identity+ is changed to a unique service account.
197
+ # + It is an error if the old value was true and the new value is false.
171
198
  class UpdateSinkRequest; end
172
199
 
173
200
  # The parameters to +DeleteSink+.
174
201
  # @!attribute [rw] sink_name
175
202
  # @return [String]
176
- # Required. The resource name of the sink to delete, including the parent
177
- # resource and the sink identifier:
203
+ # Required. The full resource name of the sink to delete, including the
204
+ # parent resource and the sink identifier:
178
205
  #
179
206
  # "projects/[PROJECT_ID]/sinks/[SINK_ID]"
180
207
  # "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
181
208
  #
182
- # It is an error if the sink does not exist.
209
+ # It is an error if the sink does not exist. Example:
210
+ # +"projects/my-project-id/sinks/my-sink-id"+. It is an error if
211
+ # the sink does not exist.
183
212
  class DeleteSinkRequest; end
184
213
  end
185
214
  end
@@ -1,10 +1,10 @@
1
- # Copyright 2016 Google Inc. All rights reserved.
1
+ # Copyright 2017, Google Inc. All rights reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
5
5
  # You may obtain a copy of the License at
6
6
  #
7
- # http://www.apache.org/licenses/LICENSE-2.0
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
8
  #
9
9
  # Unless required by applicable law or agreed to in writing, software
10
10
  # distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,7 +16,7 @@ module Google
16
16
  module Logging
17
17
  module V2
18
18
  # Describes a logs-based metric. The value of the metric is the
19
- # number of log entries that match a logs filter.
19
+ # number of log entries that match a logs filter in a given time interval.
20
20
  # @!attribute [rw] name
21
21
  # @return [String]
22
22
  # Required. The client-assigned metric identifier.
@@ -39,7 +39,8 @@ module Google
39
39
  # Optional. A description of this metric, which is used in documentation.
40
40
  # @!attribute [rw] filter
41
41
  # @return [String]
42
- # Required. An {advanced logs filter}[https://cloud.google.com/logging/docs/view/advanced_filters].
42
+ # Required. An {advanced logs filter}[https://cloud.google.com/logging/docs/view/advanced_filters]
43
+ # which is used to match log entries.
43
44
  # Example:
44
45
  #
45
46
  # "resource.type=gae_app AND severity>=ERROR"
@@ -1,10 +1,10 @@
1
- # Copyright 2016 Google Inc. All rights reserved.
1
+ # Copyright 2017, Google Inc. All rights reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
5
5
  # You may obtain a copy of the License at
6
6
  #
7
- # http://www.apache.org/licenses/LICENSE-2.0
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
8
  #
9
9
  # Unless required by applicable law or agreed to in writing, software
10
10
  # distributed under the License is distributed on an "AS IS" BASIS,
@@ -1,10 +1,10 @@
1
- # Copyright 2016 Google Inc. All rights reserved.
1
+ # Copyright 2017, Google Inc. All rights reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
5
5
  # You may obtain a copy of the License at
6
6
  #
7
- # http://www.apache.org/licenses/LICENSE-2.0
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
8
  #
9
9
  # Unless required by applicable law or agreed to in writing, software
10
10
  # distributed under the License is distributed on an "AS IS" BASIS,
@@ -1,10 +1,10 @@
1
- # Copyright 2016 Google Inc. All rights reserved.
1
+ # Copyright 2017, Google Inc. All rights reserved.
2
2
  #
3
3
  # Licensed under the Apache License, Version 2.0 (the "License");
4
4
  # you may not use this file except in compliance with the License.
5
5
  # You may obtain a copy of the License at
6
6
  #
7
- # http://www.apache.org/licenses/LICENSE-2.0
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
8
  #
9
9
  # Unless required by applicable law or agreed to in writing, software
10
10
  # distributed under the License is distributed on an "AS IS" BASIS,
@@ -45,8 +45,6 @@ module Google
45
45
  # The default port of the service.
46
46
  DEFAULT_SERVICE_PORT = 443
47
47
 
48
- CODE_GEN_NAME_VERSION = "gapic/0.1.0".freeze
49
-
50
48
  DEFAULT_TIMEOUT = 30
51
49
 
52
50
  PAGE_DESCRIPTORS = {
@@ -57,11 +55,27 @@ module Google
57
55
  "list_monitored_resource_descriptors" => Google::Gax::PageDescriptor.new(
58
56
  "page_token",
59
57
  "next_page_token",
60
- "resource_descriptors")
58
+ "resource_descriptors"),
59
+ "list_logs" => Google::Gax::PageDescriptor.new(
60
+ "page_token",
61
+ "next_page_token",
62
+ "log_names")
61
63
  }.freeze
62
64
 
63
65
  private_constant :PAGE_DESCRIPTORS
64
66
 
67
+ BUNDLE_DESCRIPTORS = {
68
+ "write_log_entries" => Google::Gax::BundleDescriptor.new(
69
+ "entries",
70
+ [
71
+ "logName",
72
+ "resource",
73
+ "labels"
74
+ ])
75
+ }.freeze
76
+
77
+ private_constant :BUNDLE_DESCRIPTORS
78
+
65
79
  # The scopes needed to make gRPC calls to all of the methods defined in
66
80
  # this service.
67
81
  ALL_SCOPES = [
@@ -140,10 +154,6 @@ module Google
140
154
  # or the specified config is missing data points.
141
155
  # @param timeout [Numeric]
142
156
  # The default timeout, in seconds, for calls made through this client.
143
- # @param app_name [String]
144
- # The codename of the calling service.
145
- # @param app_version [String]
146
- # The version of the calling service.
147
157
  def initialize \
148
158
  service_path: SERVICE_ADDRESS,
149
159
  port: DEFAULT_SERVICE_PORT,
@@ -152,8 +162,10 @@ module Google
152
162
  scopes: ALL_SCOPES,
153
163
  client_config: {},
154
164
  timeout: DEFAULT_TIMEOUT,
155
- app_name: "gax",
156
- app_version: Google::Gax::VERSION
165
+ app_name: nil,
166
+ app_version: nil,
167
+ lib_name: nil,
168
+ lib_version: ""
157
169
  # These require statements are intentionally placed here to initialize
158
170
  # the gRPC module only when it's required.
159
171
  # See https://github.com/googleapis/toolkit/issues/446
@@ -161,9 +173,16 @@ module Google
161
173
  require "google/logging/v2/logging_services_pb"
162
174
 
163
175
 
164
- google_api_client = "#{app_name}/#{app_version} " \
165
- "#{CODE_GEN_NAME_VERSION} gax/#{Google::Gax::VERSION} " \
166
- "ruby/#{RUBY_VERSION}".freeze
176
+ if app_name || app_version
177
+ warn "`app_name` and `app_version` are no longer being used in the request headers."
178
+ end
179
+
180
+ google_api_client = "gl-ruby/#{RUBY_VERSION}"
181
+ google_api_client << " #{lib_name}/#{lib_version}" if lib_name
182
+ google_api_client << " gapic/ gax/#{Google::Gax::VERSION}"
183
+ google_api_client << " grpc/#{GRPC::VERSION}"
184
+ google_api_client.freeze
185
+
167
186
  headers = { :"x-goog-api-client" => google_api_client }
168
187
  client_config_file = Pathname.new(__dir__).join(
169
188
  "logging_service_v2_client_config.json"
@@ -175,6 +194,7 @@ module Google
175
194
  client_config,
176
195
  Google::Gax::Grpc::STATUS_CODE_NAMES,
177
196
  timeout,
197
+ bundle_descriptors: BUNDLE_DESCRIPTORS,
178
198
  page_descriptors: PAGE_DESCRIPTORS,
179
199
  errors: Google::Gax::Grpc::API_ERRORS,
180
200
  kwargs: headers
@@ -205,6 +225,10 @@ module Google
205
225
  @logging_service_v2_stub.method(:list_monitored_resource_descriptors),
206
226
  defaults["list_monitored_resource_descriptors"]
207
227
  )
228
+ @list_logs = Google::Gax.create_api_call(
229
+ @logging_service_v2_stub.method(:list_logs),
230
+ defaults["list_logs"]
231
+ )
208
232
  end
209
233
 
210
234
  # Service calls
@@ -322,18 +346,18 @@ module Google
322
346
  @write_log_entries.call(req, options)
323
347
  end
324
348
 
325
- # Lists log entries. Use this method to retrieve log entries from Cloud
326
- # Logging. For ways to export log entries, see
349
+ # Lists log entries. Use this method to retrieve log entries from
350
+ # Stackdriver Logging. For ways to export log entries, see
327
351
  # {Exporting Logs}[https://cloud.google.com/logging/docs/export].
328
352
  #
329
353
  # @param project_ids [Array<String>]
330
- # Deprecated. One or more project identifiers or project numbers from which
331
- # to retrieve log entries. Example: +"my-project-1A"+. If
332
- # present, these project identifiers are converted to resource format and
333
- # added to the list of resources in +resourceNames+. Callers should use
334
- # +resourceNames+ rather than this parameter.
354
+ # Deprecated. Use +resource_names+ instead. One or more project identifiers
355
+ # or project numbers from which to retrieve log entries. Example:
356
+ # +"my-project-1A"+. If present, these project identifiers are converted to
357
+ # resource name format and added to the list of resources in
358
+ # +resource_names+.
335
359
  # @param resource_names [Array<String>]
336
- # Required. One or more cloud resources from which to retrieve log
360
+ # Required. Names of one or more resources from which to retrieve log
337
361
  # entries:
338
362
  #
339
363
  # "projects/[PROJECT_ID]"
@@ -343,7 +367,10 @@ module Google
343
367
  # @param filter [String]
344
368
  # Optional. A filter that chooses which log entries to return. See {Advanced
345
369
  # Logs Filters}[https://cloud.google.com/logging/docs/view/advanced_filters]. Only log entries that
346
- # match the filter are returned. An empty filter matches all log entries.
370
+ # match the filter are returned. An empty filter matches all log entries in
371
+ # the resources listed in +resource_names+. Referencing a parent resource
372
+ # that is not listed in +resource_names+ will cause the filter to return no
373
+ # results.
347
374
  # The maximum length of the filter is 20000 characters.
348
375
  # @param order_by [String]
349
376
  # Optional. How the results should be sorted. Presently, the only permitted
@@ -405,7 +432,8 @@ module Google
405
432
  @list_log_entries.call(req, options)
406
433
  end
407
434
 
408
- # Lists the monitored resource descriptors used by Stackdriver Logging.
435
+ # Lists the descriptors for monitored resource types used by Stackdriver
436
+ # Logging.
409
437
  #
410
438
  # @param page_size [Integer]
411
439
  # The maximum number of resources contained in the underlying API
@@ -450,6 +478,61 @@ module Google
450
478
  }.delete_if { |_, v| v.nil? })
451
479
  @list_monitored_resource_descriptors.call(req, options)
452
480
  end
481
+
482
+ # Lists the logs in projects or organizations.
483
+ # Only logs that have entries are listed.
484
+ #
485
+ # @param parent [String]
486
+ # Required. The resource name that owns the logs:
487
+ #
488
+ # "projects/[PROJECT_ID]"
489
+ # "organizations/[ORGANIZATION_ID]"
490
+ # @param page_size [Integer]
491
+ # The maximum number of resources contained in the underlying API
492
+ # response. If page streaming is performed per-resource, this
493
+ # parameter does not affect the return value. If page streaming is
494
+ # performed per-page, this determines the maximum number of
495
+ # resources in a page.
496
+ # @param options [Google::Gax::CallOptions]
497
+ # Overrides the default settings for this call, e.g, timeout,
498
+ # retries, etc.
499
+ # @return [Google::Gax::PagedEnumerable<String>]
500
+ # An enumerable of String instances.
501
+ # See Google::Gax::PagedEnumerable documentation for other
502
+ # operations such as per-page iteration or access to the response
503
+ # object.
504
+ # @raise [Google::Gax::GaxError] if the RPC is aborted.
505
+ # @example
506
+ # require "google/cloud/logging/v2/logging_service_v2_client"
507
+ #
508
+ # LoggingServiceV2Client = Google::Cloud::Logging::V2::LoggingServiceV2Client
509
+ #
510
+ # logging_service_v2_client = LoggingServiceV2Client.new
511
+ # formatted_parent = LoggingServiceV2Client.project_path("[PROJECT]")
512
+ #
513
+ # # Iterate over all results.
514
+ # logging_service_v2_client.list_logs(formatted_parent).each do |element|
515
+ # # Process element.
516
+ # end
517
+ #
518
+ # # Or iterate over results one page at a time.
519
+ # logging_service_v2_client.list_logs(formatted_parent).each_page do |page|
520
+ # # Process each page at a time.
521
+ # page.each do |element|
522
+ # # Process element.
523
+ # end
524
+ # end
525
+
526
+ def list_logs \
527
+ parent,
528
+ page_size: nil,
529
+ options: nil
530
+ req = Google::Logging::V2::ListLogsRequest.new({
531
+ parent: parent,
532
+ page_size: page_size
533
+ }.delete_if { |_, v| v.nil? })
534
+ @list_logs.call(req, options)
535
+ end
453
536
  end
454
537
  end
455
538
  end