google-cloud-logging 0.21.0 → 0.21.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,83 @@
1
+ # Copyright 2016 Google Inc. All rights reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ module Google
16
+ module Protobuf
17
+ # A Timestamp represents a point in time independent of any time zone
18
+ # or calendar, represented as seconds and fractions of seconds at
19
+ # nanosecond resolution in UTC Epoch time. It is encoded using the
20
+ # Proleptic Gregorian Calendar which extends the Gregorian calendar
21
+ # backwards to year one. It is encoded assuming all minutes are 60
22
+ # seconds long, i.e. leap seconds are "smeared" so that no leap second
23
+ # table is needed for interpretation. Range is from
24
+ # 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z.
25
+ # By restricting to that range, we ensure that we can convert to
26
+ # and from RFC 3339 date strings.
27
+ # See {https://www.ietf.org/rfc/rfc3339.txt}[https://www.ietf.org/rfc/rfc3339.txt].
28
+ #
29
+ # Example 1: Compute Timestamp from POSIX +time()+.
30
+ #
31
+ # Timestamp timestamp;
32
+ # timestamp.set_seconds(time(NULL));
33
+ # timestamp.set_nanos(0);
34
+ #
35
+ # Example 2: Compute Timestamp from POSIX +gettimeofday()+.
36
+ #
37
+ # struct timeval tv;
38
+ # gettimeofday(&tv, NULL);
39
+ #
40
+ # Timestamp timestamp;
41
+ # timestamp.set_seconds(tv.tv_sec);
42
+ # timestamp.set_nanos(tv.tv_usec * 1000);
43
+ #
44
+ # Example 3: Compute Timestamp from Win32 +GetSystemTimeAsFileTime()+.
45
+ #
46
+ # FILETIME ft;
47
+ # GetSystemTimeAsFileTime(&ft);
48
+ # UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
49
+ #
50
+ # // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
51
+ # // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
52
+ # Timestamp timestamp;
53
+ # timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
54
+ # timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
55
+ #
56
+ # Example 4: Compute Timestamp from Java +System.currentTimeMillis()+.
57
+ #
58
+ # long millis = System.currentTimeMillis();
59
+ #
60
+ # Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
61
+ # .setNanos((int) ((millis % 1000) * 1000000)).build();
62
+ #
63
+ #
64
+ # Example 5: Compute Timestamp from current time in Python.
65
+ #
66
+ # now = time.time()
67
+ # seconds = int(now)
68
+ # nanos = int((now - seconds) * 10**9)
69
+ # timestamp = Timestamp(seconds=seconds, nanos=nanos)
70
+ # @!attribute [rw] seconds
71
+ # @return [Integer]
72
+ # Represents seconds of UTC time since Unix epoch
73
+ # 1970-01-01T00:00:00Z. Must be from from 0001-01-01T00:00:00Z to
74
+ # 9999-12-31T23:59:59Z inclusive.
75
+ # @!attribute [rw] nanos
76
+ # @return [Integer]
77
+ # Non-negative fractions of a second at nanosecond resolution. Negative
78
+ # second values with fractions must still have non-negative nanos values
79
+ # that count forward in time. Must be from 0 to 999,999,999
80
+ # inclusive.
81
+ class Timestamp; end
82
+ end
83
+ end
@@ -230,9 +230,9 @@ module Google
230
230
  def delete_log \
231
231
  log_name,
232
232
  options: nil
233
- req = Google::Logging::V2::DeleteLogRequest.new(
233
+ req = Google::Logging::V2::DeleteLogRequest.new({
234
234
  log_name: log_name
235
- )
235
+ }.delete_if { |_, v| v.nil? })
236
236
  @delete_log.call(req, options)
237
237
  end
238
238
 
@@ -295,19 +295,13 @@ module Google
295
295
  labels: nil,
296
296
  partial_success: nil,
297
297
  options: nil
298
- req = Google::Logging::V2::WriteLogEntriesRequest.new(
299
- entries: entries
300
- )
301
- req.log_name = log_name unless log_name.nil?
302
- req.resource = resource unless resource.nil?
303
- # Custom code here to work around setting a Hash where a Map is expected.
304
- # If a future PR removes this code then ensure that the bug is fixed.
305
- unless labels.nil?
306
- labels_map = Google::Protobuf::Map.new(:string, :string)
307
- labels.each { |k, v| labels_map[String(k)] = String(v) }
308
- req.labels = labels_map
309
- end
310
- req.partial_success = partial_success unless partial_success.nil?
298
+ req = Google::Logging::V2::WriteLogEntriesRequest.new({
299
+ entries: entries,
300
+ log_name: log_name,
301
+ resource: resource,
302
+ labels: labels,
303
+ partial_success: partial_success
304
+ }.delete_if { |_, v| v.nil? })
311
305
  @write_log_entries.call(req, options)
312
306
  end
313
307
 
@@ -379,13 +373,13 @@ module Google
379
373
  order_by: nil,
380
374
  page_size: nil,
381
375
  options: nil
382
- req = Google::Logging::V2::ListLogEntriesRequest.new(
383
- project_ids: project_ids
384
- )
385
- req.resource_names = resource_names unless resource_names.nil?
386
- req.filter = filter unless filter.nil?
387
- req.order_by = order_by unless order_by.nil?
388
- req.page_size = page_size unless page_size.nil?
376
+ req = Google::Logging::V2::ListLogEntriesRequest.new({
377
+ project_ids: project_ids,
378
+ resource_names: resource_names,
379
+ filter: filter,
380
+ order_by: order_by,
381
+ page_size: page_size
382
+ }.delete_if { |_, v| v.nil? })
389
383
  @list_log_entries.call(req, options)
390
384
  end
391
385
 
@@ -429,8 +423,9 @@ module Google
429
423
  def list_monitored_resource_descriptors \
430
424
  page_size: nil,
431
425
  options: nil
432
- req = Google::Logging::V2::ListMonitoredResourceDescriptorsRequest.new
433
- req.page_size = page_size unless page_size.nil?
426
+ req = Google::Logging::V2::ListMonitoredResourceDescriptorsRequest.new({
427
+ page_size: page_size
428
+ }.delete_if { |_, v| v.nil? })
434
429
  @list_monitored_resource_descriptors.call(req, options)
435
430
  end
436
431
  end
@@ -253,10 +253,10 @@ module Google
253
253
  parent,
254
254
  page_size: nil,
255
255
  options: nil
256
- req = Google::Logging::V2::ListLogMetricsRequest.new(
257
- parent: parent
258
- )
259
- req.page_size = page_size unless page_size.nil?
256
+ req = Google::Logging::V2::ListLogMetricsRequest.new({
257
+ parent: parent,
258
+ page_size: page_size
259
+ }.delete_if { |_, v| v.nil? })
260
260
  @list_log_metrics.call(req, options)
261
261
  end
262
262
 
@@ -282,9 +282,9 @@ module Google
282
282
  def get_log_metric \
283
283
  metric_name,
284
284
  options: nil
285
- req = Google::Logging::V2::GetLogMetricRequest.new(
285
+ req = Google::Logging::V2::GetLogMetricRequest.new({
286
286
  metric_name: metric_name
287
- )
287
+ }.delete_if { |_, v| v.nil? })
288
288
  @get_log_metric.call(req, options)
289
289
  end
290
290
 
@@ -318,10 +318,10 @@ module Google
318
318
  parent,
319
319
  metric,
320
320
  options: nil
321
- req = Google::Logging::V2::CreateLogMetricRequest.new(
321
+ req = Google::Logging::V2::CreateLogMetricRequest.new({
322
322
  parent: parent,
323
323
  metric: metric
324
- )
324
+ }.delete_if { |_, v| v.nil? })
325
325
  @create_log_metric.call(req, options)
326
326
  end
327
327
 
@@ -358,10 +358,10 @@ module Google
358
358
  metric_name,
359
359
  metric,
360
360
  options: nil
361
- req = Google::Logging::V2::UpdateLogMetricRequest.new(
361
+ req = Google::Logging::V2::UpdateLogMetricRequest.new({
362
362
  metric_name: metric_name,
363
363
  metric: metric
364
- )
364
+ }.delete_if { |_, v| v.nil? })
365
365
  @update_log_metric.call(req, options)
366
366
  end
367
367
 
@@ -386,9 +386,9 @@ module Google
386
386
  def delete_log_metric \
387
387
  metric_name,
388
388
  options: nil
389
- req = Google::Logging::V2::DeleteLogMetricRequest.new(
389
+ req = Google::Logging::V2::DeleteLogMetricRequest.new({
390
390
  metric_name: metric_name
391
- )
391
+ }.delete_if { |_, v| v.nil? })
392
392
  @delete_log_metric.call(req, options)
393
393
  end
394
394
  end
@@ -16,7 +16,7 @@
16
16
  module Google
17
17
  module Cloud
18
18
  module Logging
19
- VERSION = "0.21.0"
19
+ VERSION = "0.21.1"
20
20
  end
21
21
  end
22
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-logging
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.0
4
+ version: 0.21.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Moore
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-10-20 00:00:00.000000000 Z
12
+ date: 2016-11-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: google-cloud-core
@@ -213,14 +213,14 @@ dependencies:
213
213
  requirements:
214
214
  - - "~>"
215
215
  - !ruby/object:Gem::Version
216
- version: 0.1.6
216
+ version: 0.1.8
217
217
  type: :development
218
218
  prerelease: false
219
219
  version_requirements: !ruby/object:Gem::Requirement
220
220
  requirements:
221
221
  - - "~>"
222
222
  - !ruby/object:Gem::Version
223
- version: 0.1.6
223
+ version: 0.1.8
224
224
  - !ruby/object:Gem::Dependency
225
225
  name: actionpack
226
226
  requirement: !ruby/object:Gem::Requirement
@@ -271,6 +271,9 @@ executables: []
271
271
  extensions: []
272
272
  extra_rdoc_files: []
273
273
  files:
274
+ - ".yardopts"
275
+ - LICENSE
276
+ - README.md
274
277
  - lib/google-cloud-logging.rb
275
278
  - lib/google/cloud/logging.rb
276
279
  - lib/google/cloud/logging/async_writer.rb
@@ -294,6 +297,15 @@ files:
294
297
  - lib/google/cloud/logging/v2.rb
295
298
  - lib/google/cloud/logging/v2/config_service_v2_api.rb
296
299
  - lib/google/cloud/logging/v2/config_service_v2_client_config.json
300
+ - lib/google/cloud/logging/v2/doc/google/api/monitored_resource.rb
301
+ - lib/google/cloud/logging/v2/doc/google/logging/type/http_request.rb
302
+ - lib/google/cloud/logging/v2/doc/google/logging/v2/log_entry.rb
303
+ - lib/google/cloud/logging/v2/doc/google/logging/v2/logging.rb
304
+ - lib/google/cloud/logging/v2/doc/google/logging/v2/logging_config.rb
305
+ - lib/google/cloud/logging/v2/doc/google/logging/v2/logging_metrics.rb
306
+ - lib/google/cloud/logging/v2/doc/google/protobuf/any.rb
307
+ - lib/google/cloud/logging/v2/doc/google/protobuf/duration.rb
308
+ - lib/google/cloud/logging/v2/doc/google/protobuf/timestamp.rb
297
309
  - lib/google/cloud/logging/v2/logging_service_v2_api.rb
298
310
  - lib/google/cloud/logging/v2/logging_service_v2_client_config.json
299
311
  - lib/google/cloud/logging/v2/metrics_service_v2_api.rb
@@ -326,7 +338,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
326
338
  version: '0'
327
339
  requirements: []
328
340
  rubyforge_project:
329
- rubygems_version: 2.6.4
341
+ rubygems_version: 2.5.1
330
342
  signing_key:
331
343
  specification_version: 4
332
344
  summary: API Client library for Stackdriver Logging