google-cloud-run-client 0.2.0 → 0.3.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 +6 -6
- data/lib/google/cloud/run/client/version.rb +1 -1
- data/lib/google/cloud/run.rb +90 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 581091773e0e9123c43393e0f4b9259b828a4874ab43b7cd2ffbee30a0271db7
|
4
|
+
data.tar.gz: e10520bd155244c51485ea6dc0446c0ddec74e19530301d418b888d169c52754
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f7de5d1739a8f31aca819ad1354fe76da273e878c9c78cf74cba7617cd8aeeed5ad3798b94afd62cd5c8ef10f6f2bef36a2240bdc2c98489c29e529faf9244de
|
7
|
+
data.tar.gz: c8b3b4951a832cab1238db54a95cc432a6f5d1dc2fc8a8b4fda11c22f5b1a43a871a04c3e0064034a294c7b9c12fb7400dbc7d9e08502abdaa598d09cc117d95
|
data/AUTHENTICATION.md
CHANGED
@@ -27,7 +27,7 @@ export GOOGLE_CLOUD_CREDENTIALS=path/to/keyfile.json
|
|
27
27
|
```ruby
|
28
28
|
require "google/cloud/run"
|
29
29
|
|
30
|
-
client = Google::Cloud::Run.
|
30
|
+
client = Google::Cloud::Run.executions
|
31
31
|
```
|
32
32
|
|
33
33
|
## Credential Lookup
|
@@ -64,7 +64,7 @@ containers where writing files is difficult or not encouraged.
|
|
64
64
|
|
65
65
|
The environment variables that google-cloud-run-client
|
66
66
|
checks for credentials are configured on the service Credentials class (such as
|
67
|
-
`::Google::Cloud::Run::V2::
|
67
|
+
`::Google::Cloud::Run::V2::Executions::Credentials`):
|
68
68
|
|
69
69
|
* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
|
70
70
|
* `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
|
@@ -75,7 +75,7 @@ require "google/cloud/run"
|
|
75
75
|
|
76
76
|
ENV["GOOGLE_CLOUD_CREDENTIALS"] = "path/to/keyfile.json"
|
77
77
|
|
78
|
-
client = Google::Cloud::Run.
|
78
|
+
client = Google::Cloud::Run.executions
|
79
79
|
```
|
80
80
|
|
81
81
|
### Configuration
|
@@ -86,7 +86,7 @@ it in an environment variable. Either on an individual client initialization:
|
|
86
86
|
```ruby
|
87
87
|
require "google/cloud/run"
|
88
88
|
|
89
|
-
client = Google::Cloud::Run.
|
89
|
+
client = Google::Cloud::Run.executions do |config|
|
90
90
|
config.credentials = "path/to/keyfile.json"
|
91
91
|
end
|
92
92
|
```
|
@@ -100,7 +100,7 @@ Google::Cloud::Run.configure do |config|
|
|
100
100
|
config.credentials = "path/to/keyfile.json"
|
101
101
|
end
|
102
102
|
|
103
|
-
client = Google::Cloud::Run.
|
103
|
+
client = Google::Cloud::Run.executions
|
104
104
|
```
|
105
105
|
|
106
106
|
### Cloud SDK
|
@@ -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/lib/google/cloud/run.rb
CHANGED
@@ -44,6 +44,66 @@ end
|
|
44
44
|
module Google
|
45
45
|
module Cloud
|
46
46
|
module Run
|
47
|
+
##
|
48
|
+
# Create a new client object for Executions.
|
49
|
+
#
|
50
|
+
# By default, this returns an instance of
|
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 specify a different API version by passing it in the
|
54
|
+
# `version` parameter. If the Executions service is
|
55
|
+
# supported by that API version, and the corresponding gem is available, the
|
56
|
+
# appropriate versioned client will be returned.
|
57
|
+
#
|
58
|
+
# ## About Executions
|
59
|
+
#
|
60
|
+
# Cloud Run Execution Control Plane API.
|
61
|
+
#
|
62
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
63
|
+
# Defaults to `:v2`.
|
64
|
+
# @return [Executions::Client] A client object for the specified version.
|
65
|
+
#
|
66
|
+
def self.executions version: :v2, &block
|
67
|
+
require "google/cloud/run/#{version.to_s.downcase}"
|
68
|
+
|
69
|
+
package_name = Google::Cloud::Run
|
70
|
+
.constants
|
71
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
72
|
+
.first
|
73
|
+
package_module = Google::Cloud::Run.const_get package_name
|
74
|
+
package_module.const_get(:Executions).const_get(:Client).new(&block)
|
75
|
+
end
|
76
|
+
|
77
|
+
##
|
78
|
+
# Create a new client object for Jobs.
|
79
|
+
#
|
80
|
+
# By default, this returns an instance of
|
81
|
+
# [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 specify a different API version by passing it in the
|
84
|
+
# `version` parameter. If the Jobs service is
|
85
|
+
# supported by that API version, and the corresponding gem is available, the
|
86
|
+
# appropriate versioned client will be returned.
|
87
|
+
#
|
88
|
+
# ## About Jobs
|
89
|
+
#
|
90
|
+
# Cloud Run Job Control Plane API.
|
91
|
+
#
|
92
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
93
|
+
# Defaults to `:v2`.
|
94
|
+
# @return [Jobs::Client] A client object for the specified version.
|
95
|
+
#
|
96
|
+
def self.jobs version: :v2, &block
|
97
|
+
require "google/cloud/run/#{version.to_s.downcase}"
|
98
|
+
|
99
|
+
package_name = Google::Cloud::Run
|
100
|
+
.constants
|
101
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
102
|
+
.first
|
103
|
+
package_module = Google::Cloud::Run.const_get package_name
|
104
|
+
package_module.const_get(:Jobs).const_get(:Client).new(&block)
|
105
|
+
end
|
106
|
+
|
47
107
|
##
|
48
108
|
# Create a new client object for Revisions.
|
49
109
|
#
|
@@ -104,6 +164,36 @@ module Google
|
|
104
164
|
package_module.const_get(:Services).const_get(:Client).new(&block)
|
105
165
|
end
|
106
166
|
|
167
|
+
##
|
168
|
+
# Create a new client object for Tasks.
|
169
|
+
#
|
170
|
+
# By default, this returns an instance of
|
171
|
+
# [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 specify a different API version by passing it in the
|
174
|
+
# `version` parameter. If the Tasks service is
|
175
|
+
# supported by that API version, and the corresponding gem is available, the
|
176
|
+
# appropriate versioned client will be returned.
|
177
|
+
#
|
178
|
+
# ## About Tasks
|
179
|
+
#
|
180
|
+
# Cloud Run Task Control Plane API.
|
181
|
+
#
|
182
|
+
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
183
|
+
# Defaults to `:v2`.
|
184
|
+
# @return [Tasks::Client] A client object for the specified version.
|
185
|
+
#
|
186
|
+
def self.tasks version: :v2, &block
|
187
|
+
require "google/cloud/run/#{version.to_s.downcase}"
|
188
|
+
|
189
|
+
package_name = Google::Cloud::Run
|
190
|
+
.constants
|
191
|
+
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
192
|
+
.first
|
193
|
+
package_module = Google::Cloud::Run.const_get package_name
|
194
|
+
package_module.const_get(:Tasks).const_get(:Client).new(&block)
|
195
|
+
end
|
196
|
+
|
107
197
|
##
|
108
198
|
# Configure the google-cloud-run-client library.
|
109
199
|
#
|
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.3.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: 2022-
|
11
|
+
date: 2022-11-11 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.5'
|
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.5'
|
44
44
|
- - "<"
|
45
45
|
- !ruby/object:Gem::Version
|
46
46
|
version: 2.a
|