google-cloud-run-client 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +0 -26
- data/lib/google/cloud/run/client/version.rb +1 -1
- data/lib/google/cloud/run.rb +51 -31
- 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: f94374952efb5ed30adb6d58fe4dcdaa1bef920338d244efd6450f8cbd04501d
|
4
|
+
data.tar.gz: ab150e9fb5790344161493e61f044577e184064a8a1f4743b12c693649fabfac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f566793f738022eab85635ad7cec14a62041b8f04d5e504b94228bb54fd53019de83c11b5eef0feae554dec1a4d7a88305a6ae134eedf99271ae6b63293c435
|
7
|
+
data.tar.gz: a998b5a73293a5bdea3058136eaf07e1a6362faf94bab3342a04c3fcf92b9c6aa2c30bcb4965079f8d304100ceae69eeee73a05278e1690518e77686b44456e7
|
data/README.md
CHANGED
@@ -34,32 +34,6 @@ In order to use this library, you first need to go through the following steps:
|
|
34
34
|
1. [Enable the API.](https://console.cloud.google.com/apis/library/run.googleapis.com)
|
35
35
|
1. {file:AUTHENTICATION.md Set up authentication.}
|
36
36
|
|
37
|
-
## Enabling Logging
|
38
|
-
|
39
|
-
To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
40
|
-
The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/stdlib/libdoc/logger/rdoc/Logger.html) as shown below,
|
41
|
-
or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
|
42
|
-
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)
|
43
|
-
and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
44
|
-
|
45
|
-
Configuring a Ruby stdlib logger:
|
46
|
-
|
47
|
-
```ruby
|
48
|
-
require "logger"
|
49
|
-
|
50
|
-
module MyLogger
|
51
|
-
LOGGER = Logger.new $stderr, level: Logger::WARN
|
52
|
-
def logger
|
53
|
-
LOGGER
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
# Define a gRPC module-level logger method before grpc/logconfig.rb loads.
|
58
|
-
module GRPC
|
59
|
-
extend MyLogger
|
60
|
-
end
|
61
|
-
```
|
62
|
-
|
63
37
|
## Supported Ruby Versions
|
64
38
|
|
65
39
|
This library is supported on Ruby 2.6+.
|
data/lib/google/cloud/run.rb
CHANGED
@@ -49,11 +49,13 @@ module Google
|
|
49
49
|
#
|
50
50
|
# By default, this returns an instance of
|
51
51
|
# [Google::Cloud::Run::V2::Executions::Client](https://googleapis.dev/ruby/google-cloud-run-v2/latest/Google/Cloud/Run/V2/Executions/Client.html)
|
52
|
-
# for version V2 of the API.
|
53
|
-
# However, you can specify
|
52
|
+
# for a gRPC client for version V2 of the API.
|
53
|
+
# However, you can specify a different API version by passing it in the
|
54
54
|
# `version` parameter. If the Executions 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 Executions
|
59
61
|
#
|
@@ -61,17 +63,19 @@ module Google
|
|
61
63
|
#
|
62
64
|
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
63
65
|
# Defaults to `:v2`.
|
64
|
-
# @
|
66
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
67
|
+
# @return [::Object] A client object for the specified version.
|
65
68
|
#
|
66
|
-
def self.executions version: :v2, &block
|
69
|
+
def self.executions version: :v2, transport: :grpc, &block
|
67
70
|
require "google/cloud/run/#{version.to_s.downcase}"
|
68
71
|
|
69
72
|
package_name = Google::Cloud::Run
|
70
73
|
.constants
|
71
74
|
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
72
75
|
.first
|
73
|
-
|
74
|
-
|
76
|
+
service_module = Google::Cloud::Run.const_get(package_name).const_get(:Executions)
|
77
|
+
service_module = service_module.const_get(:Rest) if transport == :rest
|
78
|
+
service_module.const_get(:Client).new(&block)
|
75
79
|
end
|
76
80
|
|
77
81
|
##
|
@@ -79,11 +83,13 @@ module Google
|
|
79
83
|
#
|
80
84
|
# By default, this returns an instance of
|
81
85
|
# [Google::Cloud::Run::V2::Jobs::Client](https://googleapis.dev/ruby/google-cloud-run-v2/latest/Google/Cloud/Run/V2/Jobs/Client.html)
|
82
|
-
# for version V2 of the API.
|
83
|
-
# However, you can specify
|
86
|
+
# for a gRPC client for version V2 of the API.
|
87
|
+
# However, you can specify a different API version by passing it in the
|
84
88
|
# `version` parameter. If the Jobs service is
|
85
89
|
# supported by that API version, and the corresponding gem is available, the
|
86
90
|
# appropriate versioned client will be returned.
|
91
|
+
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
92
|
+
# the `transport` parameter.
|
87
93
|
#
|
88
94
|
# ## About Jobs
|
89
95
|
#
|
@@ -91,17 +97,19 @@ module Google
|
|
91
97
|
#
|
92
98
|
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
93
99
|
# Defaults to `:v2`.
|
94
|
-
# @
|
100
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
101
|
+
# @return [::Object] A client object for the specified version.
|
95
102
|
#
|
96
|
-
def self.jobs version: :v2, &block
|
103
|
+
def self.jobs version: :v2, transport: :grpc, &block
|
97
104
|
require "google/cloud/run/#{version.to_s.downcase}"
|
98
105
|
|
99
106
|
package_name = Google::Cloud::Run
|
100
107
|
.constants
|
101
108
|
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
102
109
|
.first
|
103
|
-
|
104
|
-
|
110
|
+
service_module = Google::Cloud::Run.const_get(package_name).const_get(:Jobs)
|
111
|
+
service_module = service_module.const_get(:Rest) if transport == :rest
|
112
|
+
service_module.const_get(:Client).new(&block)
|
105
113
|
end
|
106
114
|
|
107
115
|
##
|
@@ -109,11 +117,13 @@ module Google
|
|
109
117
|
#
|
110
118
|
# By default, this returns an instance of
|
111
119
|
# [Google::Cloud::Run::V2::Revisions::Client](https://googleapis.dev/ruby/google-cloud-run-v2/latest/Google/Cloud/Run/V2/Revisions/Client.html)
|
112
|
-
# for version V2 of the API.
|
113
|
-
# However, you can specify
|
120
|
+
# for a gRPC client for version V2 of the API.
|
121
|
+
# However, you can specify a different API version by passing it in the
|
114
122
|
# `version` parameter. If the Revisions service is
|
115
123
|
# supported by that API version, and the corresponding gem is available, the
|
116
124
|
# appropriate versioned client will be returned.
|
125
|
+
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
126
|
+
# the `transport` parameter.
|
117
127
|
#
|
118
128
|
# ## About Revisions
|
119
129
|
#
|
@@ -121,17 +131,19 @@ module Google
|
|
121
131
|
#
|
122
132
|
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
123
133
|
# Defaults to `:v2`.
|
124
|
-
# @
|
134
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
135
|
+
# @return [::Object] A client object for the specified version.
|
125
136
|
#
|
126
|
-
def self.revisions version: :v2, &block
|
137
|
+
def self.revisions version: :v2, transport: :grpc, &block
|
127
138
|
require "google/cloud/run/#{version.to_s.downcase}"
|
128
139
|
|
129
140
|
package_name = Google::Cloud::Run
|
130
141
|
.constants
|
131
142
|
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
132
143
|
.first
|
133
|
-
|
134
|
-
|
144
|
+
service_module = Google::Cloud::Run.const_get(package_name).const_get(:Revisions)
|
145
|
+
service_module = service_module.const_get(:Rest) if transport == :rest
|
146
|
+
service_module.const_get(:Client).new(&block)
|
135
147
|
end
|
136
148
|
|
137
149
|
##
|
@@ -139,11 +151,13 @@ module Google
|
|
139
151
|
#
|
140
152
|
# By default, this returns an instance of
|
141
153
|
# [Google::Cloud::Run::V2::Services::Client](https://googleapis.dev/ruby/google-cloud-run-v2/latest/Google/Cloud/Run/V2/Services/Client.html)
|
142
|
-
# for version V2 of the API.
|
143
|
-
# However, you can specify
|
154
|
+
# for a gRPC client for version V2 of the API.
|
155
|
+
# However, you can specify a different API version by passing it in the
|
144
156
|
# `version` parameter. If the Services service is
|
145
157
|
# supported by that API version, and the corresponding gem is available, the
|
146
158
|
# appropriate versioned client will be returned.
|
159
|
+
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
160
|
+
# the `transport` parameter.
|
147
161
|
#
|
148
162
|
# ## About Services
|
149
163
|
#
|
@@ -151,17 +165,19 @@ module Google
|
|
151
165
|
#
|
152
166
|
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
153
167
|
# Defaults to `:v2`.
|
154
|
-
# @
|
168
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
169
|
+
# @return [::Object] A client object for the specified version.
|
155
170
|
#
|
156
|
-
def self.services version: :v2, &block
|
171
|
+
def self.services version: :v2, transport: :grpc, &block
|
157
172
|
require "google/cloud/run/#{version.to_s.downcase}"
|
158
173
|
|
159
174
|
package_name = Google::Cloud::Run
|
160
175
|
.constants
|
161
176
|
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
162
177
|
.first
|
163
|
-
|
164
|
-
|
178
|
+
service_module = Google::Cloud::Run.const_get(package_name).const_get(:Services)
|
179
|
+
service_module = service_module.const_get(:Rest) if transport == :rest
|
180
|
+
service_module.const_get(:Client).new(&block)
|
165
181
|
end
|
166
182
|
|
167
183
|
##
|
@@ -169,11 +185,13 @@ module Google
|
|
169
185
|
#
|
170
186
|
# By default, this returns an instance of
|
171
187
|
# [Google::Cloud::Run::V2::Tasks::Client](https://googleapis.dev/ruby/google-cloud-run-v2/latest/Google/Cloud/Run/V2/Tasks/Client.html)
|
172
|
-
# for version V2 of the API.
|
173
|
-
# However, you can specify
|
188
|
+
# for a gRPC client for version V2 of the API.
|
189
|
+
# However, you can specify a different API version by passing it in the
|
174
190
|
# `version` parameter. If the Tasks service is
|
175
191
|
# supported by that API version, and the corresponding gem is available, the
|
176
192
|
# appropriate versioned client will be returned.
|
193
|
+
# You can also specify a different transport by passing `:rest` or `:grpc` in
|
194
|
+
# the `transport` parameter.
|
177
195
|
#
|
178
196
|
# ## About Tasks
|
179
197
|
#
|
@@ -181,17 +199,19 @@ module Google
|
|
181
199
|
#
|
182
200
|
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
183
201
|
# Defaults to `:v2`.
|
184
|
-
# @
|
202
|
+
# @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
|
203
|
+
# @return [::Object] A client object for the specified version.
|
185
204
|
#
|
186
|
-
def self.tasks version: :v2, &block
|
205
|
+
def self.tasks version: :v2, transport: :grpc, &block
|
187
206
|
require "google/cloud/run/#{version.to_s.downcase}"
|
188
207
|
|
189
208
|
package_name = Google::Cloud::Run
|
190
209
|
.constants
|
191
210
|
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
192
211
|
.first
|
193
|
-
|
194
|
-
|
212
|
+
service_module = Google::Cloud::Run.const_get(package_name).const_get(:Tasks)
|
213
|
+
service_module = service_module.const_get(:Rest) if transport == :rest
|
214
|
+
service_module.const_get(:Client).new(&block)
|
195
215
|
end
|
196
216
|
|
197
217
|
##
|
@@ -211,7 +231,7 @@ module Google
|
|
211
231
|
# * `timeout` (*type:* `Numeric`) -
|
212
232
|
# Default timeout in seconds.
|
213
233
|
# * `metadata` (*type:* `Hash{Symbol=>String}`) -
|
214
|
-
# Additional
|
234
|
+
# Additional headers to be sent with the call.
|
215
235
|
# * `retry_policy` (*type:* `Hash`) -
|
216
236
|
# The retry policy. The value is a hash with the following keys:
|
217
237
|
# * `: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-run-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.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-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-cloud-core
|
@@ -30,7 +30,7 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0.
|
33
|
+
version: '0.7'
|
34
34
|
- - "<"
|
35
35
|
- !ruby/object:Gem::Version
|
36
36
|
version: 2.a
|
@@ -40,7 +40,7 @@ dependencies:
|
|
40
40
|
requirements:
|
41
41
|
- - ">="
|
42
42
|
- !ruby/object:Gem::Version
|
43
|
-
version: '0.
|
43
|
+
version: '0.7'
|
44
44
|
- - "<"
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: 2.a
|
@@ -189,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
189
189
|
- !ruby/object:Gem::Version
|
190
190
|
version: '0'
|
191
191
|
requirements: []
|
192
|
-
rubygems_version: 3.
|
192
|
+
rubygems_version: 3.4.2
|
193
193
|
signing_key:
|
194
194
|
specification_version: 4
|
195
195
|
summary: API Client library for the Cloud Run API
|