google-api-client 0.9.22 → 0.9.23

Sign up to get free protection for your applications and to get access to all the features.
@@ -22,6 +22,30 @@ module Google
22
22
  module Apis
23
23
  module LoggingV2beta1
24
24
 
25
+ class ListLogMetricsResponse
26
+ class Representation < Google::Apis::Core::JsonRepresentation; end
27
+
28
+ include Google::Apis::Core::JsonObjectSupport
29
+ end
30
+
31
+ class Empty
32
+ class Representation < Google::Apis::Core::JsonRepresentation; end
33
+
34
+ include Google::Apis::Core::JsonObjectSupport
35
+ end
36
+
37
+ class LogEntry
38
+ class Representation < Google::Apis::Core::JsonRepresentation; end
39
+
40
+ include Google::Apis::Core::JsonObjectSupport
41
+ end
42
+
43
+ class SourceLocation
44
+ class Representation < Google::Apis::Core::JsonRepresentation; end
45
+
46
+ include Google::Apis::Core::JsonObjectSupport
47
+ end
48
+
25
49
  class ListLogEntriesRequest
26
50
  class Representation < Google::Apis::Core::JsonRepresentation; end
27
51
 
@@ -52,13 +76,13 @@ module Google
52
76
  include Google::Apis::Core::JsonObjectSupport
53
77
  end
54
78
 
55
- class WriteLogEntriesResponse
79
+ class LogEntryOperation
56
80
  class Representation < Google::Apis::Core::JsonRepresentation; end
57
81
 
58
82
  include Google::Apis::Core::JsonObjectSupport
59
83
  end
60
84
 
61
- class LogEntryOperation
85
+ class WriteLogEntriesResponse
62
86
  class Representation < Google::Apis::Core::JsonRepresentation; end
63
87
 
64
88
  include Google::Apis::Core::JsonObjectSupport
@@ -70,13 +94,13 @@ module Google
70
94
  include Google::Apis::Core::JsonObjectSupport
71
95
  end
72
96
 
73
- class WriteLogEntriesRequest
97
+ class LogSink
74
98
  class Representation < Google::Apis::Core::JsonRepresentation; end
75
99
 
76
100
  include Google::Apis::Core::JsonObjectSupport
77
101
  end
78
102
 
79
- class LogSink
103
+ class WriteLogEntriesRequest
80
104
  class Representation < Google::Apis::Core::JsonRepresentation; end
81
105
 
82
106
  include Google::Apis::Core::JsonObjectSupport
@@ -131,44 +155,72 @@ module Google
131
155
  end
132
156
 
133
157
  class ListLogMetricsResponse
134
- class Representation < Google::Apis::Core::JsonRepresentation; end
158
+ # @private
159
+ class Representation < Google::Apis::Core::JsonRepresentation
160
+ collection :metrics, as: 'metrics', class: Google::Apis::LoggingV2beta1::LogMetric, decorator: Google::Apis::LoggingV2beta1::LogMetric::Representation
135
161
 
136
- include Google::Apis::Core::JsonObjectSupport
162
+ property :next_page_token, as: 'nextPageToken'
163
+ end
137
164
  end
138
165
 
139
166
  class Empty
140
- class Representation < Google::Apis::Core::JsonRepresentation; end
141
-
142
- include Google::Apis::Core::JsonObjectSupport
167
+ # @private
168
+ class Representation < Google::Apis::Core::JsonRepresentation
169
+ end
143
170
  end
144
171
 
145
172
  class LogEntry
146
- class Representation < Google::Apis::Core::JsonRepresentation; end
173
+ # @private
174
+ class Representation < Google::Apis::Core::JsonRepresentation
175
+ property :timestamp, as: 'timestamp'
176
+ property :log_name, as: 'logName'
177
+ property :http_request, as: 'httpRequest', class: Google::Apis::LoggingV2beta1::HttpRequest, decorator: Google::Apis::LoggingV2beta1::HttpRequest::Representation
147
178
 
148
- include Google::Apis::Core::JsonObjectSupport
179
+ property :resource, as: 'resource', class: Google::Apis::LoggingV2beta1::MonitoredResource, decorator: Google::Apis::LoggingV2beta1::MonitoredResource::Representation
180
+
181
+ hash :json_payload, as: 'jsonPayload'
182
+ property :insert_id, as: 'insertId'
183
+ property :operation, as: 'operation', class: Google::Apis::LoggingV2beta1::LogEntryOperation, decorator: Google::Apis::LoggingV2beta1::LogEntryOperation::Representation
184
+
185
+ property :text_payload, as: 'textPayload'
186
+ hash :proto_payload, as: 'protoPayload'
187
+ property :trace, as: 'trace'
188
+ hash :labels, as: 'labels'
189
+ property :severity, as: 'severity'
190
+ property :source_location, as: 'sourceLocation', class: Google::Apis::LoggingV2beta1::LogEntrySourceLocation, decorator: Google::Apis::LoggingV2beta1::LogEntrySourceLocation::Representation
191
+
192
+ end
149
193
  end
150
194
 
151
195
  class SourceLocation
152
- class Representation < Google::Apis::Core::JsonRepresentation; end
153
-
154
- include Google::Apis::Core::JsonObjectSupport
196
+ # @private
197
+ class Representation < Google::Apis::Core::JsonRepresentation
198
+ property :line, as: 'line'
199
+ property :file, as: 'file'
200
+ property :function_name, as: 'functionName'
201
+ end
155
202
  end
156
203
 
157
204
  class ListLogEntriesRequest
158
205
  # @private
159
206
  class Representation < Google::Apis::Core::JsonRepresentation
160
- property :order_by, as: 'orderBy'
161
- collection :resource_names, as: 'resourceNames'
162
207
  collection :project_ids, as: 'projectIds'
163
208
  property :filter, as: 'filter'
164
209
  property :page_token, as: 'pageToken'
165
210
  property :page_size, as: 'pageSize'
211
+ property :order_by, as: 'orderBy'
212
+ collection :resource_names, as: 'resourceNames'
166
213
  end
167
214
  end
168
215
 
169
216
  class RequestLog
170
217
  # @private
171
218
  class Representation < Google::Apis::Core::JsonRepresentation
219
+ property :nickname, as: 'nickname'
220
+ property :status, as: 'status'
221
+ property :resource, as: 'resource'
222
+ property :pending_time, as: 'pendingTime'
223
+ property :task_name, as: 'taskName'
172
224
  property :url_map_entry, as: 'urlMapEntry'
173
225
  property :instance_index, as: 'instanceIndex'
174
226
  property :host, as: 'host'
@@ -198,11 +250,6 @@ module Google
198
250
  property :task_queue_name, as: 'taskQueueName'
199
251
  property :referrer, as: 'referrer'
200
252
  property :request_id, as: 'requestId'
201
- property :nickname, as: 'nickname'
202
- property :status, as: 'status'
203
- property :resource, as: 'resource'
204
- property :pending_time, as: 'pendingTime'
205
- property :task_name, as: 'taskName'
206
253
  end
207
254
  end
208
255
 
@@ -226,16 +273,10 @@ module Google
226
273
  class LogMetric
227
274
  # @private
228
275
  class Representation < Google::Apis::Core::JsonRepresentation
229
- property :filter, as: 'filter'
230
276
  property :name, as: 'name'
231
277
  property :description, as: 'description'
232
278
  property :version, as: 'version'
233
- end
234
- end
235
-
236
- class WriteLogEntriesResponse
237
- # @private
238
- class Representation < Google::Apis::Core::JsonRepresentation
279
+ property :filter, as: 'filter'
239
280
  end
240
281
  end
241
282
 
@@ -249,45 +290,51 @@ module Google
249
290
  end
250
291
  end
251
292
 
252
- class MonitoredResource
293
+ class WriteLogEntriesResponse
253
294
  # @private
254
295
  class Representation < Google::Apis::Core::JsonRepresentation
255
- property :type, as: 'type'
256
- hash :labels, as: 'labels'
257
296
  end
258
297
  end
259
298
 
260
- class WriteLogEntriesRequest
299
+ class MonitoredResource
261
300
  # @private
262
301
  class Representation < Google::Apis::Core::JsonRepresentation
263
- property :log_name, as: 'logName'
264
- collection :entries, as: 'entries', class: Google::Apis::LoggingV2beta1::LogEntry, decorator: Google::Apis::LoggingV2beta1::LogEntry::Representation
265
-
266
- property :partial_success, as: 'partialSuccess'
267
302
  hash :labels, as: 'labels'
268
- property :resource, as: 'resource', class: Google::Apis::LoggingV2beta1::MonitoredResource, decorator: Google::Apis::LoggingV2beta1::MonitoredResource::Representation
269
-
303
+ property :type, as: 'type'
270
304
  end
271
305
  end
272
306
 
273
307
  class LogSink
274
308
  # @private
275
309
  class Representation < Google::Apis::Core::JsonRepresentation
276
- property :start_time, as: 'startTime'
277
- property :writer_identity, as: 'writerIdentity'
278
310
  property :output_version_format, as: 'outputVersionFormat'
279
311
  property :name, as: 'name'
280
312
  property :destination, as: 'destination'
281
313
  property :filter, as: 'filter'
282
314
  property :end_time, as: 'endTime'
315
+ property :start_time, as: 'startTime'
316
+ property :writer_identity, as: 'writerIdentity'
317
+ end
318
+ end
319
+
320
+ class WriteLogEntriesRequest
321
+ # @private
322
+ class Representation < Google::Apis::Core::JsonRepresentation
323
+ property :log_name, as: 'logName'
324
+ collection :entries, as: 'entries', class: Google::Apis::LoggingV2beta1::LogEntry, decorator: Google::Apis::LoggingV2beta1::LogEntry::Representation
325
+
326
+ property :partial_success, as: 'partialSuccess'
327
+ hash :labels, as: 'labels'
328
+ property :resource, as: 'resource', class: Google::Apis::LoggingV2beta1::MonitoredResource, decorator: Google::Apis::LoggingV2beta1::MonitoredResource::Representation
329
+
283
330
  end
284
331
  end
285
332
 
286
333
  class ListLogsResponse
287
334
  # @private
288
335
  class Representation < Google::Apis::Core::JsonRepresentation
289
- property :next_page_token, as: 'nextPageToken'
290
336
  collection :log_names, as: 'logNames'
337
+ property :next_page_token, as: 'nextPageToken'
291
338
  end
292
339
  end
293
340
 
@@ -303,10 +350,6 @@ module Google
303
350
  class HttpRequest
304
351
  # @private
305
352
  class Representation < Google::Apis::Core::JsonRepresentation
306
- property :latency, as: 'latency'
307
- property :user_agent, as: 'userAgent'
308
- property :cache_fill_bytes, as: 'cacheFillBytes'
309
- property :request_method, as: 'requestMethod'
310
353
  property :request_size, as: 'requestSize'
311
354
  property :response_size, as: 'responseSize'
312
355
  property :request_url, as: 'requestUrl'
@@ -317,15 +360,19 @@ module Google
317
360
  property :cache_validated_with_origin_server, as: 'cacheValidatedWithOriginServer'
318
361
  property :status, as: 'status'
319
362
  property :referer, as: 'referer'
363
+ property :latency, as: 'latency'
364
+ property :user_agent, as: 'userAgent'
365
+ property :cache_fill_bytes, as: 'cacheFillBytes'
366
+ property :request_method, as: 'requestMethod'
320
367
  end
321
368
  end
322
369
 
323
370
  class LabelDescriptor
324
371
  # @private
325
372
  class Representation < Google::Apis::Core::JsonRepresentation
326
- property :key, as: 'key'
327
373
  property :description, as: 'description'
328
374
  property :value_type, as: 'valueType'
375
+ property :key, as: 'key'
329
376
  end
330
377
  end
331
378
 
@@ -353,9 +400,9 @@ module Google
353
400
  class ListLogEntriesResponse
354
401
  # @private
355
402
  class Representation < Google::Apis::Core::JsonRepresentation
356
- property :next_page_token, as: 'nextPageToken'
357
403
  collection :entries, as: 'entries', class: Google::Apis::LoggingV2beta1::LogEntry, decorator: Google::Apis::LoggingV2beta1::LogEntry::Representation
358
404
 
405
+ property :next_page_token, as: 'nextPageToken'
359
406
  end
360
407
  end
361
408
 
@@ -369,53 +416,6 @@ module Google
369
416
  property :time, as: 'time'
370
417
  end
371
418
  end
372
-
373
- class ListLogMetricsResponse
374
- # @private
375
- class Representation < Google::Apis::Core::JsonRepresentation
376
- collection :metrics, as: 'metrics', class: Google::Apis::LoggingV2beta1::LogMetric, decorator: Google::Apis::LoggingV2beta1::LogMetric::Representation
377
-
378
- property :next_page_token, as: 'nextPageToken'
379
- end
380
- end
381
-
382
- class Empty
383
- # @private
384
- class Representation < Google::Apis::Core::JsonRepresentation
385
- end
386
- end
387
-
388
- class LogEntry
389
- # @private
390
- class Representation < Google::Apis::Core::JsonRepresentation
391
- property :timestamp, as: 'timestamp'
392
- property :log_name, as: 'logName'
393
- property :http_request, as: 'httpRequest', class: Google::Apis::LoggingV2beta1::HttpRequest, decorator: Google::Apis::LoggingV2beta1::HttpRequest::Representation
394
-
395
- property :resource, as: 'resource', class: Google::Apis::LoggingV2beta1::MonitoredResource, decorator: Google::Apis::LoggingV2beta1::MonitoredResource::Representation
396
-
397
- hash :json_payload, as: 'jsonPayload'
398
- property :insert_id, as: 'insertId'
399
- property :operation, as: 'operation', class: Google::Apis::LoggingV2beta1::LogEntryOperation, decorator: Google::Apis::LoggingV2beta1::LogEntryOperation::Representation
400
-
401
- property :text_payload, as: 'textPayload'
402
- hash :proto_payload, as: 'protoPayload'
403
- property :trace, as: 'trace'
404
- hash :labels, as: 'labels'
405
- property :severity, as: 'severity'
406
- property :source_location, as: 'sourceLocation', class: Google::Apis::LoggingV2beta1::LogEntrySourceLocation, decorator: Google::Apis::LoggingV2beta1::LogEntrySourceLocation::Representation
407
-
408
- end
409
- end
410
-
411
- class SourceLocation
412
- # @private
413
- class Representation < Google::Apis::Core::JsonRepresentation
414
- property :file, as: 'file'
415
- property :function_name, as: 'functionName'
416
- property :line, as: 'line'
417
- end
418
- end
419
419
  end
420
420
  end
421
421
  end
@@ -32,16 +32,16 @@ module Google
32
32
  #
33
33
  # @see https://cloud.google.com/logging/docs/
34
34
  class LoggingService < Google::Apis::Core::BaseService
35
- # @return [String]
36
- # Available to use for quota purposes for server-side applications. Can be any
37
- # arbitrary string assigned to a user, but should not exceed 40 characters.
38
- attr_accessor :quota_user
39
-
40
35
  # @return [String]
41
36
  # API key. Your API key identifies your project and provides you with API access,
42
37
  # quota, and reports. Required unless you provide an OAuth 2.0 token.
43
38
  attr_accessor :key
44
39
 
40
+ # @return [String]
41
+ # Available to use for quota purposes for server-side applications. Can be any
42
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
43
+ attr_accessor :quota_user
44
+
45
45
  def initialize
46
46
  super('https://logging.googleapis.com/', '')
47
47
  end
@@ -55,11 +55,11 @@ module Google
55
55
  # [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog"
56
56
  # , "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%
57
57
  # 2Factivity". For more information about log names, see LogEntry.
58
+ # @param [String] fields
59
+ # Selector specifying which fields to include in a partial response.
58
60
  # @param [String] quota_user
59
61
  # Available to use for quota purposes for server-side applications. Can be any
60
62
  # arbitrary string assigned to a user, but should not exceed 40 characters.
61
- # @param [String] fields
62
- # Selector specifying which fields to include in a partial response.
63
63
  # @param [Google::Apis::RequestOptions] options
64
64
  # Request-specific options
65
65
  #
@@ -72,13 +72,13 @@ module Google
72
72
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
73
73
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
74
74
  # @raise [Google::Apis::AuthorizationError] Authorization is required
75
- def delete_organization_log(log_name, quota_user: nil, fields: nil, options: nil, &block)
75
+ def delete_billing_account_log(log_name, fields: nil, quota_user: nil, options: nil, &block)
76
76
  command = make_simple_command(:delete, 'v2beta1/{+logName}', options)
77
77
  command.response_representation = Google::Apis::LoggingV2beta1::Empty::Representation
78
78
  command.response_class = Google::Apis::LoggingV2beta1::Empty
79
79
  command.params['logName'] = log_name unless log_name.nil?
80
- command.query['quotaUser'] = quota_user unless quota_user.nil?
81
80
  command.query['fields'] = fields unless fields.nil?
81
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
82
82
  execute_or_queue_command(command, &block)
83
83
  end
84
84
 
@@ -97,11 +97,11 @@ module Google
97
97
  # preceding call to this method. pageToken must be the value of nextPageToken
98
98
  # from the previous response. The values of other method parameters should be
99
99
  # identical to those in the previous call.
100
+ # @param [String] fields
101
+ # Selector specifying which fields to include in a partial response.
100
102
  # @param [String] quota_user
101
103
  # Available to use for quota purposes for server-side applications. Can be any
102
104
  # arbitrary string assigned to a user, but should not exceed 40 characters.
103
- # @param [String] fields
104
- # Selector specifying which fields to include in a partial response.
105
105
  # @param [Google::Apis::RequestOptions] options
106
106
  # Request-specific options
107
107
  #
@@ -114,187 +114,204 @@ module Google
114
114
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
115
115
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
116
116
  # @raise [Google::Apis::AuthorizationError] Authorization is required
117
- def list_organization_logs(parent, page_size: nil, page_token: nil, quota_user: nil, fields: nil, options: nil, &block)
117
+ def list_billing_account_logs(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
118
118
  command = make_simple_command(:get, 'v2beta1/{+parent}/logs', options)
119
119
  command.response_representation = Google::Apis::LoggingV2beta1::ListLogsResponse::Representation
120
120
  command.response_class = Google::Apis::LoggingV2beta1::ListLogsResponse
121
121
  command.params['parent'] = parent unless parent.nil?
122
122
  command.query['pageSize'] = page_size unless page_size.nil?
123
123
  command.query['pageToken'] = page_token unless page_token.nil?
124
- command.query['quotaUser'] = quota_user unless quota_user.nil?
125
124
  command.query['fields'] = fields unless fields.nil?
125
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
126
126
  execute_or_queue_command(command, &block)
127
127
  end
128
128
 
129
- # Lists log entries. Use this method to retrieve log entries from Stackdriver
130
- # Logging. For ways to export log entries, see Exporting Logs.
131
- # @param [Google::Apis::LoggingV2beta1::ListLogEntriesRequest] list_log_entries_request_object
129
+ # Lists the descriptors for monitored resource types used by Stackdriver Logging.
130
+ # @param [String] page_token
131
+ # Optional. If present, then retrieve the next batch of results from the
132
+ # preceding call to this method. pageToken must be the value of nextPageToken
133
+ # from the previous response. The values of other method parameters should be
134
+ # identical to those in the previous call.
135
+ # @param [Fixnum] page_size
136
+ # Optional. The maximum number of results to return from this request. Non-
137
+ # positive values are ignored. The presence of nextPageToken in the response
138
+ # indicates that more results might be available.
139
+ # @param [String] fields
140
+ # Selector specifying which fields to include in a partial response.
132
141
  # @param [String] quota_user
133
142
  # Available to use for quota purposes for server-side applications. Can be any
134
143
  # arbitrary string assigned to a user, but should not exceed 40 characters.
135
- # @param [String] fields
136
- # Selector specifying which fields to include in a partial response.
137
144
  # @param [Google::Apis::RequestOptions] options
138
145
  # Request-specific options
139
146
  #
140
147
  # @yield [result, err] Result & error if block supplied
141
- # @yieldparam result [Google::Apis::LoggingV2beta1::ListLogEntriesResponse] parsed result object
148
+ # @yieldparam result [Google::Apis::LoggingV2beta1::ListMonitoredResourceDescriptorsResponse] parsed result object
142
149
  # @yieldparam err [StandardError] error object if request failed
143
150
  #
144
- # @return [Google::Apis::LoggingV2beta1::ListLogEntriesResponse]
151
+ # @return [Google::Apis::LoggingV2beta1::ListMonitoredResourceDescriptorsResponse]
145
152
  #
146
153
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
147
154
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
148
155
  # @raise [Google::Apis::AuthorizationError] Authorization is required
149
- def list_entry_log_entries(list_log_entries_request_object = nil, quota_user: nil, fields: nil, options: nil, &block)
150
- command = make_simple_command(:post, 'v2beta1/entries:list', options)
151
- command.request_representation = Google::Apis::LoggingV2beta1::ListLogEntriesRequest::Representation
152
- command.request_object = list_log_entries_request_object
153
- command.response_representation = Google::Apis::LoggingV2beta1::ListLogEntriesResponse::Representation
154
- command.response_class = Google::Apis::LoggingV2beta1::ListLogEntriesResponse
155
- command.query['quotaUser'] = quota_user unless quota_user.nil?
156
+ def list_monitored_resource_descriptors(page_token: nil, page_size: nil, fields: nil, quota_user: nil, options: nil, &block)
157
+ command = make_simple_command(:get, 'v2beta1/monitoredResourceDescriptors', options)
158
+ command.response_representation = Google::Apis::LoggingV2beta1::ListMonitoredResourceDescriptorsResponse::Representation
159
+ command.response_class = Google::Apis::LoggingV2beta1::ListMonitoredResourceDescriptorsResponse
160
+ command.query['pageToken'] = page_token unless page_token.nil?
161
+ command.query['pageSize'] = page_size unless page_size.nil?
156
162
  command.query['fields'] = fields unless fields.nil?
163
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
157
164
  execute_or_queue_command(command, &block)
158
165
  end
159
166
 
160
- # Writes log entries to Stackdriver Logging. All log entries are written by this
161
- # method.
162
- # @param [Google::Apis::LoggingV2beta1::WriteLogEntriesRequest] write_log_entries_request_object
167
+ # Lists the logs in projects or organizations. Only logs that have entries are
168
+ # listed.
169
+ # @param [String] parent
170
+ # Required. The resource name that owns the logs:
171
+ # "projects/[PROJECT_ID]"
172
+ # "organizations/[ORGANIZATION_ID]"
173
+ # @param [String] page_token
174
+ # Optional. If present, then retrieve the next batch of results from the
175
+ # preceding call to this method. pageToken must be the value of nextPageToken
176
+ # from the previous response. The values of other method parameters should be
177
+ # identical to those in the previous call.
178
+ # @param [Fixnum] page_size
179
+ # Optional. The maximum number of results to return from this request. Non-
180
+ # positive values are ignored. The presence of nextPageToken in the response
181
+ # indicates that more results might be available.
182
+ # @param [String] fields
183
+ # Selector specifying which fields to include in a partial response.
163
184
  # @param [String] quota_user
164
185
  # Available to use for quota purposes for server-side applications. Can be any
165
186
  # arbitrary string assigned to a user, but should not exceed 40 characters.
166
- # @param [String] fields
167
- # Selector specifying which fields to include in a partial response.
168
187
  # @param [Google::Apis::RequestOptions] options
169
188
  # Request-specific options
170
189
  #
171
190
  # @yield [result, err] Result & error if block supplied
172
- # @yieldparam result [Google::Apis::LoggingV2beta1::WriteLogEntriesResponse] parsed result object
191
+ # @yieldparam result [Google::Apis::LoggingV2beta1::ListLogsResponse] parsed result object
173
192
  # @yieldparam err [StandardError] error object if request failed
174
193
  #
175
- # @return [Google::Apis::LoggingV2beta1::WriteLogEntriesResponse]
194
+ # @return [Google::Apis::LoggingV2beta1::ListLogsResponse]
176
195
  #
177
196
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
178
197
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
179
198
  # @raise [Google::Apis::AuthorizationError] Authorization is required
180
- def write_entry_log_entries(write_log_entries_request_object = nil, quota_user: nil, fields: nil, options: nil, &block)
181
- command = make_simple_command(:post, 'v2beta1/entries:write', options)
182
- command.request_representation = Google::Apis::LoggingV2beta1::WriteLogEntriesRequest::Representation
183
- command.request_object = write_log_entries_request_object
184
- command.response_representation = Google::Apis::LoggingV2beta1::WriteLogEntriesResponse::Representation
185
- command.response_class = Google::Apis::LoggingV2beta1::WriteLogEntriesResponse
186
- command.query['quotaUser'] = quota_user unless quota_user.nil?
199
+ def list_organization_logs(parent, page_token: nil, page_size: nil, fields: nil, quota_user: nil, options: nil, &block)
200
+ command = make_simple_command(:get, 'v2beta1/{+parent}/logs', options)
201
+ command.response_representation = Google::Apis::LoggingV2beta1::ListLogsResponse::Representation
202
+ command.response_class = Google::Apis::LoggingV2beta1::ListLogsResponse
203
+ command.params['parent'] = parent unless parent.nil?
204
+ command.query['pageToken'] = page_token unless page_token.nil?
205
+ command.query['pageSize'] = page_size unless page_size.nil?
187
206
  command.query['fields'] = fields unless fields.nil?
207
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
188
208
  execute_or_queue_command(command, &block)
189
209
  end
190
210
 
191
- # Creates or updates a logs-based metric.
192
- # @param [String] metric_name
193
- # The resource name of the metric to update:
194
- # "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
195
- # The updated metric must be provided in the request and it's name field must be
196
- # the same as [METRIC_ID] If the metric does not exist in [PROJECT_ID], then a
197
- # new metric is created.
198
- # @param [Google::Apis::LoggingV2beta1::LogMetric] log_metric_object
211
+ # Deletes all the log entries in a log. The log reappears if it receives new
212
+ # entries.
213
+ # @param [String] log_name
214
+ # Required. The resource name of the log to delete:
215
+ # "projects/[PROJECT_ID]/logs/[LOG_ID]"
216
+ # "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
217
+ # [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog"
218
+ # , "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%
219
+ # 2Factivity". For more information about log names, see LogEntry.
220
+ # @param [String] fields
221
+ # Selector specifying which fields to include in a partial response.
199
222
  # @param [String] quota_user
200
223
  # Available to use for quota purposes for server-side applications. Can be any
201
224
  # arbitrary string assigned to a user, but should not exceed 40 characters.
202
- # @param [String] fields
203
- # Selector specifying which fields to include in a partial response.
204
225
  # @param [Google::Apis::RequestOptions] options
205
226
  # Request-specific options
206
227
  #
207
228
  # @yield [result, err] Result & error if block supplied
208
- # @yieldparam result [Google::Apis::LoggingV2beta1::LogMetric] parsed result object
229
+ # @yieldparam result [Google::Apis::LoggingV2beta1::Empty] parsed result object
209
230
  # @yieldparam err [StandardError] error object if request failed
210
231
  #
211
- # @return [Google::Apis::LoggingV2beta1::LogMetric]
232
+ # @return [Google::Apis::LoggingV2beta1::Empty]
212
233
  #
213
234
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
214
235
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
215
236
  # @raise [Google::Apis::AuthorizationError] Authorization is required
216
- def update_project_metric(metric_name, log_metric_object = nil, quota_user: nil, fields: nil, options: nil, &block)
217
- command = make_simple_command(:put, 'v2beta1/{+metricName}', options)
218
- command.request_representation = Google::Apis::LoggingV2beta1::LogMetric::Representation
219
- command.request_object = log_metric_object
220
- command.response_representation = Google::Apis::LoggingV2beta1::LogMetric::Representation
221
- command.response_class = Google::Apis::LoggingV2beta1::LogMetric
222
- command.params['metricName'] = metric_name unless metric_name.nil?
223
- command.query['quotaUser'] = quota_user unless quota_user.nil?
237
+ def delete_organization_log(log_name, fields: nil, quota_user: nil, options: nil, &block)
238
+ command = make_simple_command(:delete, 'v2beta1/{+logName}', options)
239
+ command.response_representation = Google::Apis::LoggingV2beta1::Empty::Representation
240
+ command.response_class = Google::Apis::LoggingV2beta1::Empty
241
+ command.params['logName'] = log_name unless log_name.nil?
224
242
  command.query['fields'] = fields unless fields.nil?
243
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
225
244
  execute_or_queue_command(command, &block)
226
245
  end
227
246
 
228
- # Creates a logs-based metric.
229
- # @param [String] parent
230
- # The resource name of the project in which to create the metric:
231
- # "projects/[PROJECT_ID]"
232
- # The new metric must be provided in the request.
233
- # @param [Google::Apis::LoggingV2beta1::LogMetric] log_metric_object
247
+ # Lists log entries. Use this method to retrieve log entries from Stackdriver
248
+ # Logging. For ways to export log entries, see Exporting Logs.
249
+ # @param [Google::Apis::LoggingV2beta1::ListLogEntriesRequest] list_log_entries_request_object
250
+ # @param [String] fields
251
+ # Selector specifying which fields to include in a partial response.
234
252
  # @param [String] quota_user
235
253
  # Available to use for quota purposes for server-side applications. Can be any
236
254
  # arbitrary string assigned to a user, but should not exceed 40 characters.
237
- # @param [String] fields
238
- # Selector specifying which fields to include in a partial response.
239
255
  # @param [Google::Apis::RequestOptions] options
240
256
  # Request-specific options
241
257
  #
242
258
  # @yield [result, err] Result & error if block supplied
243
- # @yieldparam result [Google::Apis::LoggingV2beta1::LogMetric] parsed result object
259
+ # @yieldparam result [Google::Apis::LoggingV2beta1::ListLogEntriesResponse] parsed result object
244
260
  # @yieldparam err [StandardError] error object if request failed
245
261
  #
246
- # @return [Google::Apis::LoggingV2beta1::LogMetric]
262
+ # @return [Google::Apis::LoggingV2beta1::ListLogEntriesResponse]
247
263
  #
248
264
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
249
265
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
250
266
  # @raise [Google::Apis::AuthorizationError] Authorization is required
251
- def create_project_metric(parent, log_metric_object = nil, quota_user: nil, fields: nil, options: nil, &block)
252
- command = make_simple_command(:post, 'v2beta1/{+parent}/metrics', options)
253
- command.request_representation = Google::Apis::LoggingV2beta1::LogMetric::Representation
254
- command.request_object = log_metric_object
255
- command.response_representation = Google::Apis::LoggingV2beta1::LogMetric::Representation
256
- command.response_class = Google::Apis::LoggingV2beta1::LogMetric
257
- command.params['parent'] = parent unless parent.nil?
258
- command.query['quotaUser'] = quota_user unless quota_user.nil?
267
+ def list_entry_log_entries(list_log_entries_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
268
+ command = make_simple_command(:post, 'v2beta1/entries:list', options)
269
+ command.request_representation = Google::Apis::LoggingV2beta1::ListLogEntriesRequest::Representation
270
+ command.request_object = list_log_entries_request_object
271
+ command.response_representation = Google::Apis::LoggingV2beta1::ListLogEntriesResponse::Representation
272
+ command.response_class = Google::Apis::LoggingV2beta1::ListLogEntriesResponse
259
273
  command.query['fields'] = fields unless fields.nil?
274
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
260
275
  execute_or_queue_command(command, &block)
261
276
  end
262
277
 
263
- # Deletes a logs-based metric.
264
- # @param [String] metric_name
265
- # The resource name of the metric to delete:
266
- # "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
278
+ # Writes log entries to Stackdriver Logging. All log entries are written by this
279
+ # method.
280
+ # @param [Google::Apis::LoggingV2beta1::WriteLogEntriesRequest] write_log_entries_request_object
281
+ # @param [String] fields
282
+ # Selector specifying which fields to include in a partial response.
267
283
  # @param [String] quota_user
268
284
  # Available to use for quota purposes for server-side applications. Can be any
269
285
  # arbitrary string assigned to a user, but should not exceed 40 characters.
270
- # @param [String] fields
271
- # Selector specifying which fields to include in a partial response.
272
286
  # @param [Google::Apis::RequestOptions] options
273
287
  # Request-specific options
274
288
  #
275
289
  # @yield [result, err] Result & error if block supplied
276
- # @yieldparam result [Google::Apis::LoggingV2beta1::Empty] parsed result object
290
+ # @yieldparam result [Google::Apis::LoggingV2beta1::WriteLogEntriesResponse] parsed result object
277
291
  # @yieldparam err [StandardError] error object if request failed
278
292
  #
279
- # @return [Google::Apis::LoggingV2beta1::Empty]
293
+ # @return [Google::Apis::LoggingV2beta1::WriteLogEntriesResponse]
280
294
  #
281
295
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
282
296
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
283
297
  # @raise [Google::Apis::AuthorizationError] Authorization is required
284
- def delete_project_metric(metric_name, quota_user: nil, fields: nil, options: nil, &block)
285
- command = make_simple_command(:delete, 'v2beta1/{+metricName}', options)
286
- command.response_representation = Google::Apis::LoggingV2beta1::Empty::Representation
287
- command.response_class = Google::Apis::LoggingV2beta1::Empty
288
- command.params['metricName'] = metric_name unless metric_name.nil?
289
- command.query['quotaUser'] = quota_user unless quota_user.nil?
298
+ def write_entry_log_entries(write_log_entries_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
299
+ command = make_simple_command(:post, 'v2beta1/entries:write', options)
300
+ command.request_representation = Google::Apis::LoggingV2beta1::WriteLogEntriesRequest::Representation
301
+ command.request_object = write_log_entries_request_object
302
+ command.response_representation = Google::Apis::LoggingV2beta1::WriteLogEntriesResponse::Representation
303
+ command.response_class = Google::Apis::LoggingV2beta1::WriteLogEntriesResponse
290
304
  command.query['fields'] = fields unless fields.nil?
305
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
291
306
  execute_or_queue_command(command, &block)
292
307
  end
293
308
 
294
- # Lists logs-based metrics.
309
+ # Lists the logs in projects or organizations. Only logs that have entries are
310
+ # listed.
295
311
  # @param [String] parent
296
- # Required. The name of the project containing the metrics:
312
+ # Required. The resource name that owns the logs:
297
313
  # "projects/[PROJECT_ID]"
314
+ # "organizations/[ORGANIZATION_ID]"
298
315
  # @param [String] page_token
299
316
  # Optional. If present, then retrieve the next batch of results from the
300
317
  # preceding call to this method. pageToken must be the value of nextPageToken
@@ -304,63 +321,32 @@ module Google
304
321
  # Optional. The maximum number of results to return from this request. Non-
305
322
  # positive values are ignored. The presence of nextPageToken in the response
306
323
  # indicates that more results might be available.
324
+ # @param [String] fields
325
+ # Selector specifying which fields to include in a partial response.
307
326
  # @param [String] quota_user
308
327
  # Available to use for quota purposes for server-side applications. Can be any
309
328
  # arbitrary string assigned to a user, but should not exceed 40 characters.
310
- # @param [String] fields
311
- # Selector specifying which fields to include in a partial response.
312
329
  # @param [Google::Apis::RequestOptions] options
313
330
  # Request-specific options
314
331
  #
315
332
  # @yield [result, err] Result & error if block supplied
316
- # @yieldparam result [Google::Apis::LoggingV2beta1::ListLogMetricsResponse] parsed result object
333
+ # @yieldparam result [Google::Apis::LoggingV2beta1::ListLogsResponse] parsed result object
317
334
  # @yieldparam err [StandardError] error object if request failed
318
335
  #
319
- # @return [Google::Apis::LoggingV2beta1::ListLogMetricsResponse]
336
+ # @return [Google::Apis::LoggingV2beta1::ListLogsResponse]
320
337
  #
321
338
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
322
339
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
323
340
  # @raise [Google::Apis::AuthorizationError] Authorization is required
324
- def list_project_metrics(parent, page_token: nil, page_size: nil, quota_user: nil, fields: nil, options: nil, &block)
325
- command = make_simple_command(:get, 'v2beta1/{+parent}/metrics', options)
326
- command.response_representation = Google::Apis::LoggingV2beta1::ListLogMetricsResponse::Representation
327
- command.response_class = Google::Apis::LoggingV2beta1::ListLogMetricsResponse
341
+ def list_logs(parent, page_token: nil, page_size: nil, fields: nil, quota_user: nil, options: nil, &block)
342
+ command = make_simple_command(:get, 'v2beta1/{+parent}/logs', options)
343
+ command.response_representation = Google::Apis::LoggingV2beta1::ListLogsResponse::Representation
344
+ command.response_class = Google::Apis::LoggingV2beta1::ListLogsResponse
328
345
  command.params['parent'] = parent unless parent.nil?
329
346
  command.query['pageToken'] = page_token unless page_token.nil?
330
347
  command.query['pageSize'] = page_size unless page_size.nil?
331
- command.query['quotaUser'] = quota_user unless quota_user.nil?
332
348
  command.query['fields'] = fields unless fields.nil?
333
- execute_or_queue_command(command, &block)
334
- end
335
-
336
- # Gets a logs-based metric.
337
- # @param [String] metric_name
338
- # The resource name of the desired metric:
339
- # "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
340
- # @param [String] quota_user
341
- # Available to use for quota purposes for server-side applications. Can be any
342
- # arbitrary string assigned to a user, but should not exceed 40 characters.
343
- # @param [String] fields
344
- # Selector specifying which fields to include in a partial response.
345
- # @param [Google::Apis::RequestOptions] options
346
- # Request-specific options
347
- #
348
- # @yield [result, err] Result & error if block supplied
349
- # @yieldparam result [Google::Apis::LoggingV2beta1::LogMetric] parsed result object
350
- # @yieldparam err [StandardError] error object if request failed
351
- #
352
- # @return [Google::Apis::LoggingV2beta1::LogMetric]
353
- #
354
- # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
355
- # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
356
- # @raise [Google::Apis::AuthorizationError] Authorization is required
357
- def get_project_metric(metric_name, quota_user: nil, fields: nil, options: nil, &block)
358
- command = make_simple_command(:get, 'v2beta1/{+metricName}', options)
359
- command.response_representation = Google::Apis::LoggingV2beta1::LogMetric::Representation
360
- command.response_class = Google::Apis::LoggingV2beta1::LogMetric
361
- command.params['metricName'] = metric_name unless metric_name.nil?
362
349
  command.query['quotaUser'] = quota_user unless quota_user.nil?
363
- command.query['fields'] = fields unless fields.nil?
364
350
  execute_or_queue_command(command, &block)
365
351
  end
366
352
 
@@ -373,11 +359,11 @@ module Google
373
359
  # [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog"
374
360
  # , "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%
375
361
  # 2Factivity". For more information about log names, see LogEntry.
362
+ # @param [String] fields
363
+ # Selector specifying which fields to include in a partial response.
376
364
  # @param [String] quota_user
377
365
  # Available to use for quota purposes for server-side applications. Can be any
378
366
  # arbitrary string assigned to a user, but should not exceed 40 characters.
379
- # @param [String] fields
380
- # Selector specifying which fields to include in a partial response.
381
367
  # @param [Google::Apis::RequestOptions] options
382
368
  # Request-specific options
383
369
  #
@@ -390,57 +376,13 @@ module Google
390
376
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
391
377
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
392
378
  # @raise [Google::Apis::AuthorizationError] Authorization is required
393
- def delete_log(log_name, quota_user: nil, fields: nil, options: nil, &block)
379
+ def delete_log(log_name, fields: nil, quota_user: nil, options: nil, &block)
394
380
  command = make_simple_command(:delete, 'v2beta1/{+logName}', options)
395
381
  command.response_representation = Google::Apis::LoggingV2beta1::Empty::Representation
396
382
  command.response_class = Google::Apis::LoggingV2beta1::Empty
397
383
  command.params['logName'] = log_name unless log_name.nil?
398
- command.query['quotaUser'] = quota_user unless quota_user.nil?
399
384
  command.query['fields'] = fields unless fields.nil?
400
- execute_or_queue_command(command, &block)
401
- end
402
-
403
- # Lists the logs in projects or organizations. Only logs that have entries are
404
- # listed.
405
- # @param [String] parent
406
- # Required. The resource name that owns the logs:
407
- # "projects/[PROJECT_ID]"
408
- # "organizations/[ORGANIZATION_ID]"
409
- # @param [String] page_token
410
- # Optional. If present, then retrieve the next batch of results from the
411
- # preceding call to this method. pageToken must be the value of nextPageToken
412
- # from the previous response. The values of other method parameters should be
413
- # identical to those in the previous call.
414
- # @param [Fixnum] page_size
415
- # Optional. The maximum number of results to return from this request. Non-
416
- # positive values are ignored. The presence of nextPageToken in the response
417
- # indicates that more results might be available.
418
- # @param [String] quota_user
419
- # Available to use for quota purposes for server-side applications. Can be any
420
- # arbitrary string assigned to a user, but should not exceed 40 characters.
421
- # @param [String] fields
422
- # Selector specifying which fields to include in a partial response.
423
- # @param [Google::Apis::RequestOptions] options
424
- # Request-specific options
425
- #
426
- # @yield [result, err] Result & error if block supplied
427
- # @yieldparam result [Google::Apis::LoggingV2beta1::ListLogsResponse] parsed result object
428
- # @yieldparam err [StandardError] error object if request failed
429
- #
430
- # @return [Google::Apis::LoggingV2beta1::ListLogsResponse]
431
- #
432
- # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
433
- # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
434
- # @raise [Google::Apis::AuthorizationError] Authorization is required
435
- def list_logs(parent, page_token: nil, page_size: nil, quota_user: nil, fields: nil, options: nil, &block)
436
- command = make_simple_command(:get, 'v2beta1/{+parent}/logs', options)
437
- command.response_representation = Google::Apis::LoggingV2beta1::ListLogsResponse::Representation
438
- command.response_class = Google::Apis::LoggingV2beta1::ListLogsResponse
439
- command.params['parent'] = parent unless parent.nil?
440
- command.query['pageToken'] = page_token unless page_token.nil?
441
- command.query['pageSize'] = page_size unless page_size.nil?
442
385
  command.query['quotaUser'] = quota_user unless quota_user.nil?
443
- command.query['fields'] = fields unless fields.nil?
444
386
  execute_or_queue_command(command, &block)
445
387
  end
446
388
 
@@ -453,11 +395,11 @@ module Google
453
395
  # "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
454
396
  # It is an error if the sink does not exist. Example: "projects/my-project-id/
455
397
  # sinks/my-sink-id". It is an error if the sink does not exist.
398
+ # @param [String] fields
399
+ # Selector specifying which fields to include in a partial response.
456
400
  # @param [String] quota_user
457
401
  # Available to use for quota purposes for server-side applications. Can be any
458
402
  # arbitrary string assigned to a user, but should not exceed 40 characters.
459
- # @param [String] fields
460
- # Selector specifying which fields to include in a partial response.
461
403
  # @param [Google::Apis::RequestOptions] options
462
404
  # Request-specific options
463
405
  #
@@ -470,13 +412,13 @@ module Google
470
412
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
471
413
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
472
414
  # @raise [Google::Apis::AuthorizationError] Authorization is required
473
- def delete_project_sink(sink_name, quota_user: nil, fields: nil, options: nil, &block)
415
+ def delete_project_sink(sink_name, fields: nil, quota_user: nil, options: nil, &block)
474
416
  command = make_simple_command(:delete, 'v2beta1/{+sinkName}', options)
475
417
  command.response_representation = Google::Apis::LoggingV2beta1::Empty::Representation
476
418
  command.response_class = Google::Apis::LoggingV2beta1::Empty
477
419
  command.params['sinkName'] = sink_name unless sink_name.nil?
478
- command.query['quotaUser'] = quota_user unless quota_user.nil?
479
420
  command.query['fields'] = fields unless fields.nil?
421
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
480
422
  execute_or_queue_command(command, &block)
481
423
  end
482
424
 
@@ -493,11 +435,11 @@ module Google
493
435
  # Optional. The maximum number of results to return from this request. Non-
494
436
  # positive values are ignored. The presence of nextPageToken in the response
495
437
  # indicates that more results might be available.
438
+ # @param [String] fields
439
+ # Selector specifying which fields to include in a partial response.
496
440
  # @param [String] quota_user
497
441
  # Available to use for quota purposes for server-side applications. Can be any
498
442
  # arbitrary string assigned to a user, but should not exceed 40 characters.
499
- # @param [String] fields
500
- # Selector specifying which fields to include in a partial response.
501
443
  # @param [Google::Apis::RequestOptions] options
502
444
  # Request-specific options
503
445
  #
@@ -510,15 +452,15 @@ module Google
510
452
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
511
453
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
512
454
  # @raise [Google::Apis::AuthorizationError] Authorization is required
513
- def list_project_sinks(parent, page_token: nil, page_size: nil, quota_user: nil, fields: nil, options: nil, &block)
455
+ def list_project_sinks(parent, page_token: nil, page_size: nil, fields: nil, quota_user: nil, options: nil, &block)
514
456
  command = make_simple_command(:get, 'v2beta1/{+parent}/sinks', options)
515
457
  command.response_representation = Google::Apis::LoggingV2beta1::ListSinksResponse::Representation
516
458
  command.response_class = Google::Apis::LoggingV2beta1::ListSinksResponse
517
459
  command.params['parent'] = parent unless parent.nil?
518
460
  command.query['pageToken'] = page_token unless page_token.nil?
519
461
  command.query['pageSize'] = page_size unless page_size.nil?
520
- command.query['quotaUser'] = quota_user unless quota_user.nil?
521
462
  command.query['fields'] = fields unless fields.nil?
463
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
522
464
  execute_or_queue_command(command, &block)
523
465
  end
524
466
 
@@ -528,11 +470,11 @@ module Google
528
470
  # "projects/[PROJECT_ID]/sinks/[SINK_ID]"
529
471
  # "organizations/[ORGANIZATION_ID]/sinks/[SINK_ID]"
530
472
  # Example: "projects/my-project-id/sinks/my-sink-id".
473
+ # @param [String] fields
474
+ # Selector specifying which fields to include in a partial response.
531
475
  # @param [String] quota_user
532
476
  # Available to use for quota purposes for server-side applications. Can be any
533
477
  # arbitrary string assigned to a user, but should not exceed 40 characters.
534
- # @param [String] fields
535
- # Selector specifying which fields to include in a partial response.
536
478
  # @param [Google::Apis::RequestOptions] options
537
479
  # Request-specific options
538
480
  #
@@ -545,13 +487,13 @@ module Google
545
487
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
546
488
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
547
489
  # @raise [Google::Apis::AuthorizationError] Authorization is required
548
- def get_project_sink(sink_name, quota_user: nil, fields: nil, options: nil, &block)
490
+ def get_project_sink(sink_name, fields: nil, quota_user: nil, options: nil, &block)
549
491
  command = make_simple_command(:get, 'v2beta1/{+sinkName}', options)
550
492
  command.response_representation = Google::Apis::LoggingV2beta1::LogSink::Representation
551
493
  command.response_class = Google::Apis::LoggingV2beta1::LogSink
552
494
  command.params['sinkName'] = sink_name unless sink_name.nil?
553
- command.query['quotaUser'] = quota_user unless quota_user.nil?
554
495
  command.query['fields'] = fields unless fields.nil?
496
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
555
497
  execute_or_queue_command(command, &block)
556
498
  end
557
499
 
@@ -577,11 +519,11 @@ module Google
577
519
  # If the old value was false and the new value is true, then writer_identity is
578
520
  # changed to a unique service account.
579
521
  # It is an error if the old value was true and the new value is false.
522
+ # @param [String] fields
523
+ # Selector specifying which fields to include in a partial response.
580
524
  # @param [String] quota_user
581
525
  # Available to use for quota purposes for server-side applications. Can be any
582
526
  # arbitrary string assigned to a user, but should not exceed 40 characters.
583
- # @param [String] fields
584
- # Selector specifying which fields to include in a partial response.
585
527
  # @param [Google::Apis::RequestOptions] options
586
528
  # Request-specific options
587
529
  #
@@ -594,7 +536,7 @@ module Google
594
536
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
595
537
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
596
538
  # @raise [Google::Apis::AuthorizationError] Authorization is required
597
- def update_project_sink(sink_name, log_sink_object = nil, unique_writer_identity: nil, quota_user: nil, fields: nil, options: nil, &block)
539
+ def update_project_sink(sink_name, log_sink_object = nil, unique_writer_identity: nil, fields: nil, quota_user: nil, options: nil, &block)
598
540
  command = make_simple_command(:put, 'v2beta1/{+sinkName}', options)
599
541
  command.request_representation = Google::Apis::LoggingV2beta1::LogSink::Representation
600
542
  command.request_object = log_sink_object
@@ -602,8 +544,8 @@ module Google
602
544
  command.response_class = Google::Apis::LoggingV2beta1::LogSink
603
545
  command.params['sinkName'] = sink_name unless sink_name.nil?
604
546
  command.query['uniqueWriterIdentity'] = unique_writer_identity unless unique_writer_identity.nil?
605
- command.query['quotaUser'] = quota_user unless quota_user.nil?
606
547
  command.query['fields'] = fields unless fields.nil?
548
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
607
549
  execute_or_queue_command(command, &block)
608
550
  end
609
551
 
@@ -628,11 +570,11 @@ module Google
628
570
  # resource such as an organization, then the value of writer_identity will be a
629
571
  # unique service account used only for exports from the new sink. For more
630
572
  # information, see writer_identity in LogSink.
573
+ # @param [String] fields
574
+ # Selector specifying which fields to include in a partial response.
631
575
  # @param [String] quota_user
632
576
  # Available to use for quota purposes for server-side applications. Can be any
633
577
  # arbitrary string assigned to a user, but should not exceed 40 characters.
634
- # @param [String] fields
635
- # Selector specifying which fields to include in a partial response.
636
578
  # @param [Google::Apis::RequestOptions] options
637
579
  # Request-specific options
638
580
  #
@@ -645,7 +587,7 @@ module Google
645
587
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
646
588
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
647
589
  # @raise [Google::Apis::AuthorizationError] Authorization is required
648
- def create_project_sink(parent, log_sink_object = nil, unique_writer_identity: nil, quota_user: nil, fields: nil, options: nil, &block)
590
+ def create_project_sink(parent, log_sink_object = nil, unique_writer_identity: nil, fields: nil, quota_user: nil, options: nil, &block)
649
591
  command = make_simple_command(:post, 'v2beta1/{+parent}/sinks', options)
650
592
  command.request_representation = Google::Apis::LoggingV2beta1::LogSink::Representation
651
593
  command.request_object = log_sink_object
@@ -653,25 +595,20 @@ module Google
653
595
  command.response_class = Google::Apis::LoggingV2beta1::LogSink
654
596
  command.params['parent'] = parent unless parent.nil?
655
597
  command.query['uniqueWriterIdentity'] = unique_writer_identity unless unique_writer_identity.nil?
656
- command.query['quotaUser'] = quota_user unless quota_user.nil?
657
598
  command.query['fields'] = fields unless fields.nil?
599
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
658
600
  execute_or_queue_command(command, &block)
659
601
  end
660
602
 
661
- # Deletes all the log entries in a log. The log reappears if it receives new
662
- # entries.
663
- # @param [String] log_name
664
- # Required. The resource name of the log to delete:
665
- # "projects/[PROJECT_ID]/logs/[LOG_ID]"
666
- # "organizations/[ORGANIZATION_ID]/logs/[LOG_ID]"
667
- # [LOG_ID] must be URL-encoded. For example, "projects/my-project-id/logs/syslog"
668
- # , "organizations/1234567890/logs/cloudresourcemanager.googleapis.com%
669
- # 2Factivity". For more information about log names, see LogEntry.
603
+ # Deletes a logs-based metric.
604
+ # @param [String] metric_name
605
+ # The resource name of the metric to delete:
606
+ # "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
607
+ # @param [String] fields
608
+ # Selector specifying which fields to include in a partial response.
670
609
  # @param [String] quota_user
671
610
  # Available to use for quota purposes for server-side applications. Can be any
672
611
  # arbitrary string assigned to a user, but should not exceed 40 characters.
673
- # @param [String] fields
674
- # Selector specifying which fields to include in a partial response.
675
612
  # @param [Google::Apis::RequestOptions] options
676
613
  # Request-specific options
677
614
  #
@@ -684,22 +621,20 @@ module Google
684
621
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
685
622
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
686
623
  # @raise [Google::Apis::AuthorizationError] Authorization is required
687
- def delete_billing_account_log(log_name, quota_user: nil, fields: nil, options: nil, &block)
688
- command = make_simple_command(:delete, 'v2beta1/{+logName}', options)
624
+ def delete_project_metric(metric_name, fields: nil, quota_user: nil, options: nil, &block)
625
+ command = make_simple_command(:delete, 'v2beta1/{+metricName}', options)
689
626
  command.response_representation = Google::Apis::LoggingV2beta1::Empty::Representation
690
627
  command.response_class = Google::Apis::LoggingV2beta1::Empty
691
- command.params['logName'] = log_name unless log_name.nil?
692
- command.query['quotaUser'] = quota_user unless quota_user.nil?
628
+ command.params['metricName'] = metric_name unless metric_name.nil?
693
629
  command.query['fields'] = fields unless fields.nil?
630
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
694
631
  execute_or_queue_command(command, &block)
695
632
  end
696
633
 
697
- # Lists the logs in projects or organizations. Only logs that have entries are
698
- # listed.
634
+ # Lists logs-based metrics.
699
635
  # @param [String] parent
700
- # Required. The resource name that owns the logs:
636
+ # Required. The name of the project containing the metrics:
701
637
  # "projects/[PROJECT_ID]"
702
- # "organizations/[ORGANIZATION_ID]"
703
638
  # @param [String] page_token
704
639
  # Optional. If present, then retrieve the next batch of results from the
705
640
  # preceding call to this method. pageToken must be the value of nextPageToken
@@ -709,78 +644,143 @@ module Google
709
644
  # Optional. The maximum number of results to return from this request. Non-
710
645
  # positive values are ignored. The presence of nextPageToken in the response
711
646
  # indicates that more results might be available.
647
+ # @param [String] fields
648
+ # Selector specifying which fields to include in a partial response.
712
649
  # @param [String] quota_user
713
650
  # Available to use for quota purposes for server-side applications. Can be any
714
651
  # arbitrary string assigned to a user, but should not exceed 40 characters.
715
- # @param [String] fields
716
- # Selector specifying which fields to include in a partial response.
717
652
  # @param [Google::Apis::RequestOptions] options
718
653
  # Request-specific options
719
654
  #
720
655
  # @yield [result, err] Result & error if block supplied
721
- # @yieldparam result [Google::Apis::LoggingV2beta1::ListLogsResponse] parsed result object
656
+ # @yieldparam result [Google::Apis::LoggingV2beta1::ListLogMetricsResponse] parsed result object
722
657
  # @yieldparam err [StandardError] error object if request failed
723
658
  #
724
- # @return [Google::Apis::LoggingV2beta1::ListLogsResponse]
659
+ # @return [Google::Apis::LoggingV2beta1::ListLogMetricsResponse]
725
660
  #
726
661
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
727
662
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
728
663
  # @raise [Google::Apis::AuthorizationError] Authorization is required
729
- def list_billing_account_logs(parent, page_token: nil, page_size: nil, quota_user: nil, fields: nil, options: nil, &block)
730
- command = make_simple_command(:get, 'v2beta1/{+parent}/logs', options)
731
- command.response_representation = Google::Apis::LoggingV2beta1::ListLogsResponse::Representation
732
- command.response_class = Google::Apis::LoggingV2beta1::ListLogsResponse
664
+ def list_project_metrics(parent, page_token: nil, page_size: nil, fields: nil, quota_user: nil, options: nil, &block)
665
+ command = make_simple_command(:get, 'v2beta1/{+parent}/metrics', options)
666
+ command.response_representation = Google::Apis::LoggingV2beta1::ListLogMetricsResponse::Representation
667
+ command.response_class = Google::Apis::LoggingV2beta1::ListLogMetricsResponse
733
668
  command.params['parent'] = parent unless parent.nil?
734
669
  command.query['pageToken'] = page_token unless page_token.nil?
735
670
  command.query['pageSize'] = page_size unless page_size.nil?
736
- command.query['quotaUser'] = quota_user unless quota_user.nil?
737
671
  command.query['fields'] = fields unless fields.nil?
672
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
738
673
  execute_or_queue_command(command, &block)
739
674
  end
740
675
 
741
- # Lists the descriptors for monitored resource types used by Stackdriver Logging.
742
- # @param [String] page_token
743
- # Optional. If present, then retrieve the next batch of results from the
744
- # preceding call to this method. pageToken must be the value of nextPageToken
745
- # from the previous response. The values of other method parameters should be
746
- # identical to those in the previous call.
747
- # @param [Fixnum] page_size
748
- # Optional. The maximum number of results to return from this request. Non-
749
- # positive values are ignored. The presence of nextPageToken in the response
750
- # indicates that more results might be available.
676
+ # Gets a logs-based metric.
677
+ # @param [String] metric_name
678
+ # The resource name of the desired metric:
679
+ # "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
680
+ # @param [String] fields
681
+ # Selector specifying which fields to include in a partial response.
751
682
  # @param [String] quota_user
752
683
  # Available to use for quota purposes for server-side applications. Can be any
753
684
  # arbitrary string assigned to a user, but should not exceed 40 characters.
685
+ # @param [Google::Apis::RequestOptions] options
686
+ # Request-specific options
687
+ #
688
+ # @yield [result, err] Result & error if block supplied
689
+ # @yieldparam result [Google::Apis::LoggingV2beta1::LogMetric] parsed result object
690
+ # @yieldparam err [StandardError] error object if request failed
691
+ #
692
+ # @return [Google::Apis::LoggingV2beta1::LogMetric]
693
+ #
694
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
695
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
696
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
697
+ def get_project_metric(metric_name, fields: nil, quota_user: nil, options: nil, &block)
698
+ command = make_simple_command(:get, 'v2beta1/{+metricName}', options)
699
+ command.response_representation = Google::Apis::LoggingV2beta1::LogMetric::Representation
700
+ command.response_class = Google::Apis::LoggingV2beta1::LogMetric
701
+ command.params['metricName'] = metric_name unless metric_name.nil?
702
+ command.query['fields'] = fields unless fields.nil?
703
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
704
+ execute_or_queue_command(command, &block)
705
+ end
706
+
707
+ # Creates or updates a logs-based metric.
708
+ # @param [String] metric_name
709
+ # The resource name of the metric to update:
710
+ # "projects/[PROJECT_ID]/metrics/[METRIC_ID]"
711
+ # The updated metric must be provided in the request and it's name field must be
712
+ # the same as [METRIC_ID] If the metric does not exist in [PROJECT_ID], then a
713
+ # new metric is created.
714
+ # @param [Google::Apis::LoggingV2beta1::LogMetric] log_metric_object
754
715
  # @param [String] fields
755
716
  # Selector specifying which fields to include in a partial response.
717
+ # @param [String] quota_user
718
+ # Available to use for quota purposes for server-side applications. Can be any
719
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
756
720
  # @param [Google::Apis::RequestOptions] options
757
721
  # Request-specific options
758
722
  #
759
723
  # @yield [result, err] Result & error if block supplied
760
- # @yieldparam result [Google::Apis::LoggingV2beta1::ListMonitoredResourceDescriptorsResponse] parsed result object
724
+ # @yieldparam result [Google::Apis::LoggingV2beta1::LogMetric] parsed result object
761
725
  # @yieldparam err [StandardError] error object if request failed
762
726
  #
763
- # @return [Google::Apis::LoggingV2beta1::ListMonitoredResourceDescriptorsResponse]
727
+ # @return [Google::Apis::LoggingV2beta1::LogMetric]
764
728
  #
765
729
  # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
766
730
  # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
767
731
  # @raise [Google::Apis::AuthorizationError] Authorization is required
768
- def list_monitored_resource_descriptors(page_token: nil, page_size: nil, quota_user: nil, fields: nil, options: nil, &block)
769
- command = make_simple_command(:get, 'v2beta1/monitoredResourceDescriptors', options)
770
- command.response_representation = Google::Apis::LoggingV2beta1::ListMonitoredResourceDescriptorsResponse::Representation
771
- command.response_class = Google::Apis::LoggingV2beta1::ListMonitoredResourceDescriptorsResponse
772
- command.query['pageToken'] = page_token unless page_token.nil?
773
- command.query['pageSize'] = page_size unless page_size.nil?
732
+ def update_project_metric(metric_name, log_metric_object = nil, fields: nil, quota_user: nil, options: nil, &block)
733
+ command = make_simple_command(:put, 'v2beta1/{+metricName}', options)
734
+ command.request_representation = Google::Apis::LoggingV2beta1::LogMetric::Representation
735
+ command.request_object = log_metric_object
736
+ command.response_representation = Google::Apis::LoggingV2beta1::LogMetric::Representation
737
+ command.response_class = Google::Apis::LoggingV2beta1::LogMetric
738
+ command.params['metricName'] = metric_name unless metric_name.nil?
739
+ command.query['fields'] = fields unless fields.nil?
774
740
  command.query['quotaUser'] = quota_user unless quota_user.nil?
741
+ execute_or_queue_command(command, &block)
742
+ end
743
+
744
+ # Creates a logs-based metric.
745
+ # @param [String] parent
746
+ # The resource name of the project in which to create the metric:
747
+ # "projects/[PROJECT_ID]"
748
+ # The new metric must be provided in the request.
749
+ # @param [Google::Apis::LoggingV2beta1::LogMetric] log_metric_object
750
+ # @param [String] fields
751
+ # Selector specifying which fields to include in a partial response.
752
+ # @param [String] quota_user
753
+ # Available to use for quota purposes for server-side applications. Can be any
754
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
755
+ # @param [Google::Apis::RequestOptions] options
756
+ # Request-specific options
757
+ #
758
+ # @yield [result, err] Result & error if block supplied
759
+ # @yieldparam result [Google::Apis::LoggingV2beta1::LogMetric] parsed result object
760
+ # @yieldparam err [StandardError] error object if request failed
761
+ #
762
+ # @return [Google::Apis::LoggingV2beta1::LogMetric]
763
+ #
764
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
765
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
766
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
767
+ def create_project_metric(parent, log_metric_object = nil, fields: nil, quota_user: nil, options: nil, &block)
768
+ command = make_simple_command(:post, 'v2beta1/{+parent}/metrics', options)
769
+ command.request_representation = Google::Apis::LoggingV2beta1::LogMetric::Representation
770
+ command.request_object = log_metric_object
771
+ command.response_representation = Google::Apis::LoggingV2beta1::LogMetric::Representation
772
+ command.response_class = Google::Apis::LoggingV2beta1::LogMetric
773
+ command.params['parent'] = parent unless parent.nil?
775
774
  command.query['fields'] = fields unless fields.nil?
775
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
776
776
  execute_or_queue_command(command, &block)
777
777
  end
778
778
 
779
779
  protected
780
780
 
781
781
  def apply_command_defaults(command)
782
- command.query['quotaUser'] = quota_user unless quota_user.nil?
783
782
  command.query['key'] = key unless key.nil?
783
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
784
784
  end
785
785
  end
786
786
  end