google-cloud-gke_hub 0.1.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 +13 -13
- data/README.md +3 -2
- data/lib/google/cloud/gke_hub/helpers.rb +26 -0
- data/lib/google/cloud/gke_hub/version.rb +1 -1
- data/lib/google/cloud/gke_hub.rb +23 -11
- metadata +34 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8dcc06be6ebf1ae5dce2a3079d5d9acc8b2990e90ca1364d733c766f294af3a4
|
4
|
+
data.tar.gz: d12ab1973fde22d3b0ebb43377bfcfc5cc4ddbead23b6f6552e739f59a9b1961
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca8b94a956f0173b1291cd77f3a73fb5fb0fc5d04a778e3d0cf1670d84727c34442f1c42cdd9fb4e2567d85559600713328c661c6c8a67b74e495ac2a9e23d6b
|
7
|
+
data.tar.gz: 563662c4a3b98491f363e9ab97c3d276230948651689c897f73ae816ea61428c27b709da9811d51b0b2df71815ee7df5d230aff9b4f1068e459499d7a4105018
|
data/AUTHENTICATION.md
CHANGED
@@ -27,7 +27,7 @@ export GKE_HUB_CREDENTIALS=path/to/keyfile.json
|
|
27
27
|
```ruby
|
28
28
|
require "google/cloud/gke_hub"
|
29
29
|
|
30
|
-
client = Google::Cloud::GkeHub.
|
30
|
+
client = Google::Cloud::GkeHub.gke_hub
|
31
31
|
```
|
32
32
|
|
33
33
|
## Credential Lookup
|
@@ -64,36 +64,36 @@ containers where writing files is difficult or not encouraged.
|
|
64
64
|
|
65
65
|
The environment variables that google-cloud-gke_hub
|
66
66
|
checks for credentials are configured on the service Credentials class (such as
|
67
|
-
`::Google::Cloud::GkeHub::
|
67
|
+
`::Google::Cloud::GkeHub::V1::GkeHub::Credentials`):
|
68
68
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
69
|
+
* `GKE_HUB_CREDENTIALS` - Path to JSON file, or JSON contents
|
70
|
+
* `GKE_HUB_KEYFILE` - Path to JSON file, or JSON contents
|
71
|
+
* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
|
72
|
+
* `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
|
73
|
+
* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
|
74
74
|
|
75
75
|
```ruby
|
76
76
|
require "google/cloud/gke_hub"
|
77
77
|
|
78
78
|
ENV["GKE_HUB_CREDENTIALS"] = "path/to/keyfile.json"
|
79
79
|
|
80
|
-
client = Google::Cloud::GkeHub.
|
80
|
+
client = Google::Cloud::GkeHub.gke_hub
|
81
81
|
```
|
82
82
|
|
83
83
|
### Configuration
|
84
84
|
|
85
|
-
The **Credentials JSON** can be configured instead of
|
86
|
-
environment
|
85
|
+
The path to the **Credentials JSON** file can be configured instead of storing
|
86
|
+
it in an environment variable. Either on an individual client initialization:
|
87
87
|
|
88
88
|
```ruby
|
89
89
|
require "google/cloud/gke_hub"
|
90
90
|
|
91
|
-
client = Google::Cloud::GkeHub.
|
91
|
+
client = Google::Cloud::GkeHub.gke_hub do |config|
|
92
92
|
config.credentials = "path/to/keyfile.json"
|
93
93
|
end
|
94
94
|
```
|
95
95
|
|
96
|
-
Or
|
96
|
+
Or globally for all clients:
|
97
97
|
|
98
98
|
```ruby
|
99
99
|
require "google/cloud/gke_hub"
|
@@ -102,7 +102,7 @@ Google::Cloud::GkeHub.configure do |config|
|
|
102
102
|
config.credentials = "path/to/keyfile.json"
|
103
103
|
end
|
104
104
|
|
105
|
-
client = Google::Cloud::GkeHub.
|
105
|
+
client = Google::Cloud::GkeHub.gke_hub
|
106
106
|
```
|
107
107
|
|
108
108
|
### Cloud SDK
|
data/README.md
CHANGED
@@ -16,6 +16,7 @@ for this library, google-cloud-gke_hub, 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-gke_hub-v1](https://googleapis.dev/ruby/google-cloud-gke_hub-v1/latest),
|
19
20
|
[google-cloud-gke_hub-v1beta1](https://googleapis.dev/ruby/google-cloud-gke_hub-v1beta1/latest).
|
20
21
|
|
21
22
|
See also the [Product Documentation](https://cloud.google.com/anthos/clusters/docs)
|
@@ -76,7 +77,7 @@ about the Ruby support schedule.
|
|
76
77
|
Most modern Ruby client libraries for Google APIs come in two flavors: the main
|
77
78
|
client library with a name such as `google-cloud-gke_hub`,
|
78
79
|
and lower-level _versioned_ client libraries with names such as
|
79
|
-
`google-cloud-gke_hub-
|
80
|
+
`google-cloud-gke_hub-v1`.
|
80
81
|
_In most cases, you should install the main client._
|
81
82
|
|
82
83
|
### What's the difference between the main client and a versioned client?
|
@@ -114,7 +115,7 @@ You can use a versioned client if you are content with a possibly lower-level
|
|
114
115
|
class interface, you explicitly want to avoid features provided by the main
|
115
116
|
client, or you want to access a specific service version not be covered by the
|
116
117
|
main client. You can identify versioned client gems because the service version
|
117
|
-
is part of the name, e.g. `google-cloud-gke_hub-
|
118
|
+
is part of the name, e.g. `google-cloud-gke_hub-v1`.
|
118
119
|
|
119
120
|
### What about the google-apis-<name> clients?
|
120
121
|
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2021 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
|
18
|
+
module Google
|
19
|
+
module Cloud
|
20
|
+
module GkeHub
|
21
|
+
class << self
|
22
|
+
alias gke_hub_membership_service gke_hub
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/lib/google/cloud/gke_hub.rb
CHANGED
@@ -45,26 +45,38 @@ module Google
|
|
45
45
|
module Cloud
|
46
46
|
module GkeHub
|
47
47
|
##
|
48
|
-
# Create a new client object for
|
48
|
+
# Create a new client object for GkeHub.
|
49
49
|
#
|
50
50
|
# By default, this returns an instance of
|
51
|
-
# [Google::Cloud::GkeHub::
|
52
|
-
# for version
|
51
|
+
# [Google::Cloud::GkeHub::V1::GkeHub::Client](https://googleapis.dev/ruby/google-cloud-gke_hub-v1/latest/Google/Cloud/GkeHub/V1/GkeHub/Client.html)
|
52
|
+
# for version V1 of the API.
|
53
53
|
# However, you can specify specify a different API version by passing it in the
|
54
|
-
# `version` parameter. If the
|
54
|
+
# `version` parameter. If the GkeHub 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
57
|
#
|
58
|
-
# ## About
|
58
|
+
# ## About GkeHub
|
59
59
|
#
|
60
|
-
# GKE Hub
|
61
|
-
#
|
60
|
+
# The GKE Hub service handles the registration of many Kubernetes clusters to
|
61
|
+
# Google Cloud, and the management of multi-cluster features over those
|
62
|
+
# clusters.
|
63
|
+
#
|
64
|
+
# The GKE Hub service operates on the following resources:
|
65
|
+
#
|
66
|
+
# * Membership
|
67
|
+
# * Feature
|
68
|
+
#
|
69
|
+
# GKE Hub is currently only available in the global region.
|
70
|
+
#
|
71
|
+
# **Membership management may be non-trivial:** it is recommended to use one
|
72
|
+
# of the Google-provided client libraries or tools where possible when working
|
73
|
+
# with Membership resources.
|
62
74
|
#
|
63
75
|
# @param version [::String, ::Symbol] The API version to connect to. Optional.
|
64
|
-
# Defaults to `:
|
65
|
-
# @return [
|
76
|
+
# Defaults to `:v1`.
|
77
|
+
# @return [GkeHub::Client] A client object for the specified version.
|
66
78
|
#
|
67
|
-
def self.
|
79
|
+
def self.gke_hub version: :v1, &block
|
68
80
|
require "google/cloud/gke_hub/#{version.to_s.downcase}"
|
69
81
|
|
70
82
|
package_name = Google::Cloud::GkeHub
|
@@ -72,7 +84,7 @@ module Google
|
|
72
84
|
.select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
|
73
85
|
.first
|
74
86
|
package_module = Google::Cloud::GkeHub.const_get package_name
|
75
|
-
package_module.const_get(:
|
87
|
+
package_module.const_get(:GkeHub).const_get(:Client).new(&block)
|
76
88
|
end
|
77
89
|
|
78
90
|
##
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-gke_hub
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
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: 2021-
|
11
|
+
date: 2021-09-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-cloud-core
|
@@ -16,28 +16,54 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.6'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1.
|
26
|
+
version: '1.6'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: google-cloud-gke_hub-v1
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.0'
|
34
|
+
- - "<"
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: 2.a
|
37
|
+
type: :runtime
|
38
|
+
prerelease: false
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0.0'
|
44
|
+
- - "<"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 2.a
|
27
47
|
- !ruby/object:Gem::Dependency
|
28
48
|
name: google-cloud-gke_hub-v1beta1
|
29
49
|
requirement: !ruby/object:Gem::Requirement
|
30
50
|
requirements:
|
31
|
-
- - "
|
51
|
+
- - ">="
|
32
52
|
- !ruby/object:Gem::Version
|
33
53
|
version: '0.0'
|
54
|
+
- - "<"
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: 2.a
|
34
57
|
type: :runtime
|
35
58
|
prerelease: false
|
36
59
|
version_requirements: !ruby/object:Gem::Requirement
|
37
60
|
requirements:
|
38
|
-
- - "
|
61
|
+
- - ">="
|
39
62
|
- !ruby/object:Gem::Version
|
40
63
|
version: '0.0'
|
64
|
+
- - "<"
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: 2.a
|
41
67
|
- !ruby/object:Gem::Dependency
|
42
68
|
name: google-style
|
43
69
|
requirement: !ruby/object:Gem::Requirement
|
@@ -164,6 +190,7 @@ files:
|
|
164
190
|
- README.md
|
165
191
|
- lib/google-cloud-gke_hub.rb
|
166
192
|
- lib/google/cloud/gke_hub.rb
|
193
|
+
- lib/google/cloud/gke_hub/helpers.rb
|
167
194
|
- lib/google/cloud/gke_hub/version.rb
|
168
195
|
homepage: https://github.com/googleapis/google-cloud-ruby
|
169
196
|
licenses:
|
@@ -184,7 +211,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
184
211
|
- !ruby/object:Gem::Version
|
185
212
|
version: '0'
|
186
213
|
requirements: []
|
187
|
-
rubygems_version: 3.2.
|
214
|
+
rubygems_version: 3.2.17
|
188
215
|
signing_key:
|
189
216
|
specification_version: 4
|
190
217
|
summary: API Client library for the GKE Hub API
|