google-cloud-container 1.5.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0c374df41e31e289d655985998d017c3e0f29af9d3787e7d9ceed8f2acc42c8c
4
- data.tar.gz: 3857004e40e39fbbd4437fc96046d469d56f1221235017454d890d75eb7da2c0
3
+ metadata.gz: 8b3565c1e07fa325993515a83d6a251d2687ef4716ddab5c3c014f09d3de187f
4
+ data.tar.gz: cbc37c0a9e6c2931c0a100d610aa9ee6a9fea746781da1f42cf230b7d7310031
5
5
  SHA512:
6
- metadata.gz: 5e3489421afda038c428774e619d29b42947a140253b05ec9560ce00c5525d04b4f0c98b01d6277c257f02ceca4aa7425026829d812b630c8a90cddaa17553a4
7
- data.tar.gz: 8bc3332d0fde3b4820f7f91fea9ea6325dee13b9170eaa589ef745f6a75b589aa45c84cd5d4229e25b4f524888e760764343523597fe3b48b677b3311921ee1d
6
+ metadata.gz: 17225c73088aace638ca7982bdbf37ef3ae528fd24991a359e0a82dd9288b9132c157aeb3bb24b5c26b58e27b00239833a6ebefb9374582e6e8d5573061faa7c
7
+ data.tar.gz: 0a7d46f27ae8bb2f6767d8177db6a06649bb21c50a87a739dbe09e8b2c1da16caf7fd48dc8787ea90e364be99b48c04635c9cde68f2cc9d42675028dce6e724f
data/.yardopts CHANGED
@@ -8,5 +8,4 @@
8
8
  -
9
9
  README.md
10
10
  AUTHENTICATION.md
11
- MIGRATING.md
12
11
  LICENSE.md
data/README.md CHANGED
@@ -16,8 +16,7 @@ for this library, google-cloud-container, 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-container-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-container-v1/latest),
20
- [google-cloud-container-v1beta1](https://cloud.google.com/ruby/docs/reference/google-cloud-container-v1beta1/latest).
19
+ [google-cloud-container-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-container-v1/latest).
21
20
 
22
21
  See also the [Product Documentation](https://cloud.google.com/kubernetes-engine)
23
22
  for more usage information.
@@ -35,43 +34,39 @@ In order to use this library, you first need to go through the following steps:
35
34
  1. [Enable the API.](https://console.cloud.google.com/apis/library/container.googleapis.com)
36
35
  1. {file:AUTHENTICATION.md Set up authentication.}
37
36
 
38
- ## Migrating from 0.x versions
39
-
40
- The 1.0 release of the google-cloud-container client is a significant upgrade
41
- based on a [next-gen code generator](https://github.com/googleapis/gapic-generator-ruby),
42
- and includes substantial interface changes. Existing code written for earlier
43
- versions of this library will likely require updates to use this version.
44
- See the {file:MIGRATING.md MIGRATING.md} document for more information.
45
-
46
- ## Enabling Logging
47
-
48
- To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
49
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
50
- or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
51
- 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)
52
- and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
53
-
54
- Configuring a Ruby stdlib logger:
55
-
56
- ```ruby
57
- require "logger"
58
-
59
- module MyLogger
60
- LOGGER = Logger.new $stderr, level: Logger::WARN
61
- def logger
62
- LOGGER
63
- end
64
- end
65
-
66
- # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
67
- module GRPC
68
- extend MyLogger
69
- end
70
- ```
37
+ ## Debug Logging
38
+
39
+ This library comes with opt-in Debug Logging that can help you troubleshoot
40
+ your application's integration with the API. When logging is activated, key
41
+ events such as requests and responses, along with data payloads and metadata
42
+ such as headers and client configuration, are logged to the standard error
43
+ stream.
44
+
45
+ **WARNING:** Client Library Debug Logging includes your data payloads in
46
+ plaintext, which could include sensitive data such as PII for yourself or your
47
+ customers, private keys, or other security data that could be compromising if
48
+ leaked. Always practice good data hygiene with your application logs, and follow
49
+ the principle of least access. Google also recommends that Client Library Debug
50
+ Logging be enabled only temporarily during active debugging, and not used
51
+ permanently in production.
52
+
53
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
54
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
55
+ list of client library gem names. This will select the default logging behavior,
56
+ which writes logs to the standard error stream. On a local workstation, this may
57
+ result in logs appearing on the console. When running on a Google Cloud hosting
58
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
59
+ results in logs appearing alongside your application logs in the
60
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
61
+
62
+ Debug logging also requires that the versioned clients for this service be
63
+ sufficiently recent, released after about Dec 10, 2024. If logging is not
64
+ working, try updating the versioned clients in your bundle or installed gems:
65
+ [google-cloud-container-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-container-v1/latest).
71
66
 
72
67
  ## Supported Ruby Versions
73
68
 
74
- This library is supported on Ruby 2.7+.
69
+ This library is supported on Ruby 3.0+.
75
70
 
76
71
  Google provides official support for Ruby versions that are actively supported
77
72
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
@@ -20,7 +20,7 @@
20
20
  module Google
21
21
  module Cloud
22
22
  module Container
23
- VERSION = "1.5.1"
23
+ VERSION = "2.0.0"
24
24
  end
25
25
  end
26
26
  end
@@ -56,6 +56,11 @@ module Google
56
56
  # supported by that API version, and the corresponding gem is available, the
57
57
  # appropriate versioned client will be returned.
58
58
  #
59
+ # Raises an exception if the currently installed versioned client gem for the
60
+ # given API version does not support the ClusterManager service.
61
+ # You can determine whether the method will succeed by calling
62
+ # {Google::Cloud::Container.cluster_manager_available?}.
63
+ #
59
64
  # ## About ClusterManager
60
65
  #
61
66
  # Google Kubernetes Engine Cluster Manager v1
@@ -75,6 +80,32 @@ module Google
75
80
  service_module.const_get(:Client).new(&block)
76
81
  end
77
82
 
83
+ ##
84
+ # Determines whether the ClusterManager service is supported by the current client.
85
+ # If true, you can retrieve a client object by calling {Google::Cloud::Container.cluster_manager}.
86
+ # If false, that method will raise an exception. This could happen if the given
87
+ # API version does not exist or does not support the ClusterManager service,
88
+ # or if the versioned client gem needs an update to support the ClusterManager service.
89
+ #
90
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
91
+ # Defaults to `:v1`.
92
+ # @return [boolean] Whether the service is available.
93
+ #
94
+ def self.cluster_manager_available? version: :v1
95
+ require "google/cloud/container/#{version.to_s.downcase}"
96
+ package_name = Google::Cloud::Container
97
+ .constants
98
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
99
+ .first
100
+ return false unless package_name
101
+ service_module = Google::Cloud::Container.const_get package_name
102
+ return false unless service_module.const_defined? :ClusterManager
103
+ service_module = service_module.const_get :ClusterManager
104
+ service_module.const_defined? :Client
105
+ rescue ::LoadError
106
+ false
107
+ end
108
+
78
109
  ##
79
110
  # Configure the google-cloud-container library.
80
111
  #
metadata CHANGED
@@ -1,55 +1,28 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-container
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-08-09 00:00:00.000000000 Z
10
+ date: 2025-02-13 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: google-cloud-container-v1
15
14
  requirement: !ruby/object:Gem::Requirement
16
15
  requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0.33'
20
- - - "<"
21
- - !ruby/object:Gem::Version
22
- version: 2.a
23
- type: :runtime
24
- prerelease: false
25
- version_requirements: !ruby/object:Gem::Requirement
26
- requirements:
27
- - - ">="
28
- - !ruby/object:Gem::Version
29
- version: '0.33'
30
- - - "<"
31
- - !ruby/object:Gem::Version
32
- version: 2.a
33
- - !ruby/object:Gem::Dependency
34
- name: google-cloud-container-v1beta1
35
- requirement: !ruby/object:Gem::Requirement
36
- requirements:
37
- - - ">="
38
- - !ruby/object:Gem::Version
39
- version: '0.34'
40
- - - "<"
16
+ - - "~>"
41
17
  - !ruby/object:Gem::Version
42
- version: 2.a
18
+ version: '1.6'
43
19
  type: :runtime
44
20
  prerelease: false
45
21
  version_requirements: !ruby/object:Gem::Requirement
46
22
  requirements:
47
- - - ">="
48
- - !ruby/object:Gem::Version
49
- version: '0.34'
50
- - - "<"
23
+ - - "~>"
51
24
  - !ruby/object:Gem::Version
52
- version: 2.a
25
+ version: '1.6'
53
26
  - !ruby/object:Gem::Dependency
54
27
  name: google-cloud-core
55
28
  requirement: !ruby/object:Gem::Requirement
@@ -74,7 +47,6 @@ files:
74
47
  - ".yardopts"
75
48
  - AUTHENTICATION.md
76
49
  - LICENSE.md
77
- - MIGRATING.md
78
50
  - README.md
79
51
  - lib/google-cloud-container.rb
80
52
  - lib/google/cloud/container.rb
@@ -83,7 +55,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
83
55
  licenses:
84
56
  - Apache-2.0
85
57
  metadata: {}
86
- post_install_message:
87
58
  rdoc_options: []
88
59
  require_paths:
89
60
  - lib
@@ -91,15 +62,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
91
62
  requirements:
92
63
  - - ">="
93
64
  - !ruby/object:Gem::Version
94
- version: '2.7'
65
+ version: '3.0'
95
66
  required_rubygems_version: !ruby/object:Gem::Requirement
96
67
  requirements:
97
68
  - - ">="
98
69
  - !ruby/object:Gem::Version
99
70
  version: '0'
100
71
  requirements: []
101
- rubygems_version: 3.5.6
102
- signing_key:
72
+ rubygems_version: 3.6.3
103
73
  specification_version: 4
104
74
  summary: API Client library for the Kubernetes Engine API
105
75
  test_files: []
data/MIGRATING.md DELETED
@@ -1,280 +0,0 @@
1
- ## Migrating to google-cloud-container 1.0
2
-
3
- The 1.0 release of the google-cloud-container client is a significant upgrade
4
- based on a [next-gen code generator](https://github.com/googleapis/gapic-generator-ruby),
5
- and includes substantial interface changes. Existing code written for earlier
6
- versions of this library will likely require updates to use this version.
7
- This document describes the changes that have been made, and what you need to
8
- do to update your usage.
9
-
10
- To summarize:
11
-
12
- * The library has been broken out into three libraries. The new gems
13
- `google-cloud-container-v1` and `google-cloud-container-v1beta1` contain the
14
- actual client classes for versions V1 and V1beta1 of the Kubernetes Engine
15
- service, and the gem `google-cloud-container` now simply provides a
16
- convenience wrapper. See [Library Structure](#library-structure) for more
17
- info.
18
- * The library uses a new configuration mechanism giving you closer control
19
- over endpoint address, network timeouts, and retry. See
20
- [Client Configuration](#client-configuration) for more info. Furthermore,
21
- when creating a client object, you can customize its configuration in a
22
- block rather than passing arguments to the constructor. See
23
- [Creating Clients](#creating-clients) for more info.
24
- * Previously, positional arguments were used to indicate required arguments.
25
- Now, all method arguments are keyword arguments, with documentation that
26
- specifies whether they are required or optional. Additionally, you can pass
27
- a proto request object instead of separate arguments. See
28
- [Passing Arguments](#passing-arguments) for more info.
29
- * Previously, clients reported RPC errors by raising instances of
30
- `Google::Gax::GaxError` and its subclasses. Now, RPC exceptions are of type
31
- `Google::Cloud::Error` and its subclasses. See
32
- [Handling Errors](#handling-errors) for more info.
33
- * Some classes have moved into different namespaces. See
34
- [Class Namespaces](#class-namespaces) for more info.
35
-
36
- ### Library Structure
37
-
38
- Older 0.x releases of the `google-cloud-container` gem were all-in-one gems that
39
- included potentially multiple clients for multiple versions of the Kubernetes
40
- Engine service. The `Google::Cloud::Container.new` factory method would
41
- return you an instance of a `Google::Cloud::Container::V1::ClusterManagerClient`
42
- object for the V1 version of the service, or a
43
- `Google::Cloud::Container::V1beta1::ClusterManagerClient` object for the
44
- V1beta1 version of the service. All these classes were defined in the same gem.
45
-
46
- With the 1.0 release, the `google-cloud-container` gem still provides factory
47
- methods for obtaining clients. (The method signatures will have changed. See
48
- [Creating Clients](#creating-clients) for details.) However, the actual client
49
- classes have been moved into separate gems, one per service version. The
50
- `Google::Cloud::Container::V1::ClusterManager::Client` class, along with its
51
- helpers and data types, is now part of the `google-cloud-container-v1` gem.
52
- Similarly, the `Google::Cloud::Container::V1beta1::ClusterManager::Client`
53
- class is part of the `google-cloud-container-v1beta1` gem.
54
-
55
- For normal usage, you can continue to install the `google-cloud-container` gem
56
- (which will bring in the versioned client gems as dependencies) and continue to
57
- use factory methods to create clients. However, you may alternatively choose to
58
- install only one of the versioned gems. For example, if you know you will only
59
- `V1` of the service, you can install `google-cloud-container-v1` by itself, and
60
- construct instances of the
61
- `Google::Cloud::Container::V1::ClusterManager::Client` client class directly.
62
-
63
- ### Client Configuration
64
-
65
- In older releases, if you wanted to customize performance parameters or
66
- low-level behavior of the client (such as credentials, timeouts, or
67
- instrumentation), you would pass a variety of keyword arguments to the client
68
- constructor. It was also extremely difficult to customize the default settings.
69
-
70
- With the 1.0 release, a configuration interface provides control over these
71
- parameters, including defaults for all instances of a client, and settings for
72
- each specific client instance. For example, to set default credentials and
73
- timeout for all Kubernetes Engine V1 ClusterManager clients:
74
-
75
- ```
76
- Google::Cloud::Container::V1::ClusterManager::Client.configure do |config|
77
- config.credentials = "/path/to/credentials.json"
78
- config.timeout = 10.0
79
- end
80
- ```
81
-
82
- Individual RPCs can also be configured independently. For example, to set the
83
- timeout for the `create_cluster` call:
84
-
85
- ```
86
- Google::Cloud::Container::V1::ClusterManager::Client.configure do |config|
87
- config.rpcs.create_cluster.timeout = 20.0
88
- end
89
- ```
90
-
91
- Defaults for certain configurations can be set for all Kubernetes Engine versions
92
- globally:
93
-
94
- ```
95
- Google::Cloud::Container.configure do |config|
96
- config.credentials = "/path/to/credentials.json"
97
- config.timeout = 10.0
98
- end
99
- ```
100
-
101
- Finally, you can override the configuration for each client instance. See the
102
- next section on [Creating Clients](#creating-clients) for details.
103
-
104
- ### Creating Clients
105
-
106
- In older releases, to create a client object, you would use the
107
- `Google::Cloud::Container.new` class method. Keyword arguments were available to
108
- select a service version and to configure parameters such as credentials and
109
- timeouts.
110
-
111
- With the 1.0 release, use the `Google::Cloud::Container.cluster_manager` class
112
- method to create a client object. You may select a service version using the
113
- `:version` keyword argument. However, other configuration parameters should be
114
- set in a configuration block when you create the client.
115
-
116
- Old:
117
- ```
118
- client = Google::Cloud::Container.new credentials: "/path/to/credentials.json"
119
- ```
120
-
121
- New:
122
- ```
123
- client = Google::Cloud::Container.cluster_manager do |config|
124
- config.credentials = "/path/to/credentials.json"
125
- end
126
- ```
127
-
128
- The configuration block is optional. If you do not provide it, or you do not
129
- set some configuration parameters, then the default configuration is used. See
130
- [Client Configuration](#client-configuration).
131
-
132
- ### Passing Arguments
133
-
134
- In older releases, the intent had been for required arguments to be passed as
135
- positional method arguments, and for optional arguments to be passed as keyword
136
- arguments. However, this rule didn't always hold cleanly because some arguments,
137
- including required arguments, were at one point deprecated and replaced, leading
138
- to a confusing mix of positional and keyword arguments, as well as some breaking
139
- changes.
140
-
141
- With the 1.0 release, all RPC arguments are passed as keyword arguments,
142
- regardless of whether they are required or optional. For example:
143
-
144
- Old:
145
- ```
146
- client = Google::Cloud::Container.new
147
-
148
- name = "projects/my-project/locations/-/clusters/my-cluster"
149
- logging_service = "logging.googleapis.com"
150
-
151
- # logging_service is a positional argument and name is a keyword argument,
152
- # although both are required.
153
- response = client.set_logging_service logging_service, name: name
154
- ```
155
-
156
- New:
157
- ```
158
- client = Google::Cloud::Container.cluster_manager
159
-
160
- name = "projects/my-project/locations/-/clusters/my-cluster"
161
- logging_service = "logging.googleapis.com"
162
-
163
- # Both name and logging_service are keyword arguments.
164
- response = client.set_logging_service name: name,
165
- logging_service: logging_service
166
- ```
167
-
168
- In the 1.0 release, it is also possible to pass a request object, either
169
- as a hash or as a protocol buffer.
170
-
171
- New:
172
- ```
173
- client = Google::Cloud::Container.cluster_manager
174
-
175
- request = Google::Cloud::Container::V1::SetLoggingServiceRequest.new(
176
- name: "projects/my-project/locations/-/clusters/my-cluster",
177
- logging_service: "logging.googleapis.com"
178
- )
179
-
180
- # Pass a request object as a positional argument:
181
- response = client.set_logging_service request
182
- ```
183
-
184
- Finally, in older releases, to provide call options, you would pass a
185
- `Google::Gax::CallOptions` object with the `:options` keyword argument. In the
186
- 1.0 release, pass call options using a _second set_ of keyword arguments.
187
-
188
- Old:
189
- ```
190
- client = Google::Cloud::Container.new
191
-
192
- name = "projects/my-project/locations/-/clusters/my-cluster"
193
- logging_service = "logging.googleapis.com"
194
-
195
- options = Google::Gax::CallOptions.new timeout: 10.0
196
-
197
- response = client.set_logging_service logging_service, name: name, options: options
198
- ```
199
-
200
- New:
201
- ```
202
- client = Google::Cloud::Container.cluster_manager
203
-
204
- name = "projects/my-project/locations/-/clusters/my-cluster"
205
- logging_service = "logging.googleapis.com"
206
-
207
- # Use a hash to wrap the normal call arguments (or pass a request object), and
208
- # then add further keyword arguments for the call options.
209
- response = client.set_logging_service(
210
- { name: name, logging_service: logging_service },
211
- timeout: 10.0
212
- )
213
- ```
214
-
215
- ### Handling Errors
216
-
217
- The client reports standard
218
- [gRPC error codes](https://github.com/grpc/grpc/blob/master/doc/statuscodes.md)
219
- by raising exceptions. In older releases, these exceptions were located in the
220
- `Google::Gax` namespace and were subclasses of the `Google::Gax::GaxError` base
221
- exception class, defined in the `google-gax` gem. However, these classes were
222
- different from the standard exceptions (subclasses of `Google::Cloud::Error`)
223
- thrown by other client libraries such as `google-cloud-storage`.
224
-
225
- The 1.0 client library now uses the `Google::Cloud::Error` exception hierarchy,
226
- for consistency across all the Google Cloud client libraries. In general, these
227
- exceptions have the same name as their counterparts from older releases, but
228
- are located in the `Google::Cloud` namespace rather than the `Google::Gax`
229
- namespace.
230
-
231
- Old:
232
- ```
233
- client = Google::Cloud::Container.new
234
-
235
- name = "projects/my-project/locations/-/clusters/my-cluster"
236
- logging_service = "logging.googleapis.com"
237
-
238
- begin
239
- response = client.set_logging_service logging_service, name: name
240
- rescue Google::Gax::Error => e
241
- # Handle exceptions that subclass Google::Gax::Error
242
- end
243
- ```
244
-
245
- New:
246
- ```
247
- client = Google::Cloud::Container.cluster_manager
248
-
249
- name = "projects/my-project/locations/-/clusters/my-cluster"
250
- logging_service = "logging.googleapis.com"
251
-
252
- begin
253
- response = client.set_logging_service name: name,
254
- logging_service: logging_service
255
- rescue Google::Cloud::Error => e
256
- # Handle exceptions that subclass Google::Cloud::Error
257
- end
258
- ```
259
-
260
- ### Class Namespaces
261
-
262
- In older releases, some data type (protobuf) classes were located under the module
263
- `Google::Container`. In the 1.0 release, these classes have been moved into the
264
- same `Google::Cloud::Container` module by the client object, for consistency.
265
-
266
- In older releases, the client object was of class
267
- `Google::Cloud::Container::V1::ClusterManagerClient`.
268
- In the 1.0 release, the client object is of class
269
- `Google::Cloud::Container::V1::ClusterManager::Client`.
270
- Note that most users will use the `Google::Cloud::Container.cluster_manager`
271
- factory method to create instances of the client object, so you may not need to
272
- reference the actual class directly.
273
- See [Creating Clients](#creating-clients).
274
-
275
- In older releases, the credentials object was of class
276
- `Google::Cloud::Container::V1::Credentials`.
277
- In the 1.0 release, the credentials object is of class
278
- `Google::Cloud::Container::V1::ClusterManager::Credentials`.
279
- Again, most users will not need to reference this class directly.
280
- See [Client Configuration](#client-configuration).