google-cloud-batch 0.2.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +1 -1
- data/README.md +1 -27
- data/lib/google/cloud/batch/version.rb +1 -1
- data/lib/google/cloud/batch.rb +12 -8
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a1a8b436f47e8df4391c3c006bf8a52b960365d149e279d4790eb108f3079d8
|
4
|
+
data.tar.gz: 4cec10306aa2dbe022e0b1181f256352c4a1a003b848e2a56604e49626c9ddf0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e19a3623498801bdfca889fc1d360ab3643c87bcbffde3162beae596e6d3635c1a507afd69784e739f00f11aadd7cfc9d3621d49c65763aff557eb8e6f551e23
|
7
|
+
data.tar.gz: 51ee8fb928542af801905c687af4ef77d882b11760693064ed14e9a40a8e8cfe8e24cfa39a9c1ed8c5a5dc7e7c6f67e2dfe9eff5cfdbb0a01a314a7996bf814b
|
data/AUTHENTICATION.md
CHANGED
@@ -112,7 +112,7 @@ credentials are discovered.
|
|
112
112
|
To configure your system for this, simply:
|
113
113
|
|
114
114
|
1. [Download and install the Cloud SDK](https://cloud.google.com/sdk)
|
115
|
-
2. Authenticate using OAuth 2.0 `$ gcloud auth login`
|
115
|
+
2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login`
|
116
116
|
3. Write code as if already authenticated.
|
117
117
|
|
118
118
|
**NOTE:** This is _not_ recommended for running in production. The Cloud SDK
|
data/README.md
CHANGED
@@ -16,7 +16,7 @@ for this library, google-cloud-batch, to see the convenience methods for
|
|
16
16
|
constructing client objects. Reference documentation for the client objects
|
17
17
|
themselves can be found in the client library documentation for the versioned
|
18
18
|
client gems:
|
19
|
-
[google-cloud-batch-v1](https://
|
19
|
+
[google-cloud-batch-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest).
|
20
20
|
|
21
21
|
## Quick Start
|
22
22
|
|
@@ -31,32 +31,6 @@ In order to use this library, you first need to go through the following steps:
|
|
31
31
|
1. [Enable the API.](https://console.cloud.google.com/apis/library/batch.googleapis.com)
|
32
32
|
1. {file:AUTHENTICATION.md Set up authentication.}
|
33
33
|
|
34
|
-
## Enabling Logging
|
35
|
-
|
36
|
-
To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
37
|
-
The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib/libdoc/logger/rdoc/Logger.html) as shown below,
|
38
|
-
or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
|
39
|
-
that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
|
40
|
-
and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
41
|
-
|
42
|
-
Configuring a Ruby stdlib logger:
|
43
|
-
|
44
|
-
```ruby
|
45
|
-
require "logger"
|
46
|
-
|
47
|
-
module MyLogger
|
48
|
-
LOGGER = Logger.new $stderr, level: Logger::WARN
|
49
|
-
def logger
|
50
|
-
LOGGER
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
# Define a gRPC module-level logger method before grpc/logconfig.rb loads.
|
55
|
-
module GRPC
|
56
|
-
extend MyLogger
|
57
|
-
end
|
58
|
-
```
|
59
|
-
|
60
34
|
## Supported Ruby Versions
|
61
35
|
|
62
36
|
This library is supported on Ruby 2.6+.
|
data/lib/google/cloud/batch.rb
CHANGED
@@ -48,12 +48,14 @@ module Google
|
|
48
48
|
# Create a new client object for BatchService.
|
49
49
|
#
|
50
50
|
# By default, this returns an instance of
|
51
|
-
# [Google::Cloud::Batch::V1::BatchService::Client](https://
|
52
|
-
# for version V1 of the API.
|
53
|
-
# However, you can specify
|
51
|
+
# [Google::Cloud::Batch::V1::BatchService::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-batch-v1/latest/Google-Cloud-Batch-V1-BatchService-Client)
|
52
|
+
# for a gRPC client for version V1 of the API.
|
53
|
+
# However, you can specify a different API version by passing it in the
|
54
54
|
# `version` parameter. If the BatchService service is
|
55
55
|
# supported by that API version, and the corresponding gem is available, the
|
56
56
|
# appropriate versioned client will be returned.
|
57
|
+
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
58
|
+
# the `transport` parameter.
|
57
59
|
#
|
58
60
|
# ## About BatchService
|
59
61
|
#
|
@@ -63,17 +65,19 @@ module Google
|
|
63
65
|
#
|
64
66
|
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
65
67
|
# Defaults to `:v1`.
|
66
|
-
# @
|
68
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
69
|
+
# @return [::Object] A client object for the specified version.
|
67
70
|
#
|
68
|
-
def self.batch_service version: :v1, &block
|
71
|
+
def self.batch_service version: :v1, transport: :grpc, &block
|
69
72
|
require "google/cloud/batch/#{version.to_s.downcase}"
|
70
73
|
|
71
74
|
package_name = Google::Cloud::Batch
|
72
75
|
.constants
|
73
76
|
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
74
77
|
.first
|
75
|
-
|
76
|
-
|
78
|
+
service_module = Google::Cloud::Batch.const_get(package_name).const_get(:BatchService)
|
79
|
+
service_module = service_module.const_get(:Rest) if transport == :rest
|
80
|
+
service_module.const_get(:Client).new(&block)
|
77
81
|
end
|
78
82
|
|
79
83
|
##
|
@@ -93,7 +97,7 @@ module Google
|
|
93
97
|
# * `timeout` (*type:* `Numeric`) -
|
94
98
|
# Default timeout in seconds.
|
95
99
|
# * `metadata` (*type:* `Hash{Symbol=>String}`) -
|
96
|
-
# Additional
|
100
|
+
# Additional headers to be sent with the call.
|
97
101
|
# * `retry_policy` (*type:* `Hash`) -
|
98
102
|
# The retry policy. The value is a hash with the following keys:
|
99
103
|
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-batch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-cloud-batch-v1
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.7'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: 2.a
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '0.
|
29
|
+
version: '0.7'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 2.a
|
@@ -192,7 +192,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
192
192
|
- !ruby/object:Gem::Version
|
193
193
|
version: '0'
|
194
194
|
requirements: []
|
195
|
-
rubygems_version: 3.
|
195
|
+
rubygems_version: 3.4.2
|
196
196
|
signing_key:
|
197
197
|
specification_version: 4
|
198
198
|
summary: API Client library for the Batch API
|