google-cloud-gke_connect-gateway 1.1.0 → 2.1.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: 2dc7fa6f11328119ad1f01bcdbae77d749575c95ddc98a9e1956836e15f0c481
4
- data.tar.gz: 88a5ac151595839a6671e7adc39dd936d2938d642820aa12741d310f17212328
3
+ metadata.gz: 42720d23559ea509477c71e52721045aed1eee0390268c278a0626ac4ebe394b
4
+ data.tar.gz: '095829014be3c9effd0a79a3c5e5fdfaeb2b04086745502310708ac0077e7d6e'
5
5
  SHA512:
6
- metadata.gz: df4709afe7a639e205d7633d5fcb332f71caf20019474300a05a663511a2e9bb051d7e24a54a15b6f0ec7cefd4ba53045bf2c2367fca1991a2ac6a8ac898a108
7
- data.tar.gz: d996382ff1edd8fed089185107f9ed0669b1ca1f046a9ef42aad0f0207d791c543a9c8bbfab324d0481c5451a2c4b28a180e59e354726ac3d38e062217c04d35
6
+ metadata.gz: 8a9ccb409c29bc5c9314ec8095dfff7c572f549bbb38da3290db0fbd1e27c1f5cc902fa2ebd76afa1eb1fabb87a09e2ae747cd77c2cea9d49ae76e3fe2ea6e95
7
+ data.tar.gz: 4cd4605acc92a180324bb7f8ee51fe1455c728ae876a5086729f323de5df2da5c6d0fe5b83f891fae4538df9d15f2e2d06be9cf6e50834145594816a2308a515
data/README.md CHANGED
@@ -16,7 +16,7 @@ for this library, google-cloud-gke_connect-gateway, to see the convenience metho
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_connect-gateway-v1beta1](https://cloud.google.com/ruby/docs/reference/google-cloud-gke_connect-gateway-v1beta1/latest).
19
+ [google-cloud-gke_connect-gateway-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-gke_connect-gateway-v1/latest).
20
20
 
21
21
  See also the [Product Documentation](https://cloud.google.com/anthos/multicluster-management/gateway/)
22
22
  for more usage information.
@@ -34,35 +34,39 @@ 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/connectgateway.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/current/stdlibs/logger/Logger.html) as shown below,
41
- or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/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
- ```
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-gke_connect-gateway-v1](https://cloud.google.com/ruby/docs/reference/google-cloud-gke_connect-gateway-v1/latest).
62
66
 
63
67
  ## Supported Ruby Versions
64
68
 
65
- This library is supported on Ruby 2.7+.
69
+ This library is supported on Ruby 3.0+.
66
70
 
67
71
  Google provides official support for Ruby versions that are actively supported
68
72
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
@@ -76,7 +80,7 @@ support schedule.
76
80
  Most modern Ruby client libraries for Google APIs come in two flavors: the main
77
81
  client library with a name such as `google-cloud-gke_connect-gateway`,
78
82
  and lower-level _versioned_ client libraries with names such as
79
- `google-cloud-gke_connect-gateway-v1beta1`.
83
+ `google-cloud-gke_connect-gateway-v1`.
80
84
  _In most cases, you should install the main client._
81
85
 
82
86
  ### What's the difference between the main client and a versioned client?
@@ -114,7 +118,7 @@ You can use a versioned client if you are content with a possibly lower-level
114
118
  class interface, you explicitly want to avoid features provided by the main
115
119
  client, or you want to access a specific service version not be covered by the
116
120
  main client. You can identify versioned client gems because the service version
117
- is part of the name, e.g. `google-cloud-gke_connect-gateway-v1beta1`.
121
+ is part of the name, e.g. `google-cloud-gke_connect-gateway-v1`.
118
122
 
119
123
  ### What about the google-apis-<name> clients?
120
124
 
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module GkeConnect
23
23
  module Gateway
24
- VERSION = "1.1.0"
24
+ VERSION = "2.1.0"
25
25
  end
26
26
  end
27
27
  end
@@ -34,7 +34,6 @@ require "google/cloud/config"
34
34
  config.add_field! :scope, nil, match: [::Array, ::String]
35
35
  config.add_field! :lib_name, nil, match: ::String
36
36
  config.add_field! :lib_version, nil, match: ::String
37
- config.add_field! :interceptors, nil, match: ::Array
38
37
  config.add_field! :timeout, nil, match: ::Numeric
39
38
  config.add_field! :metadata, nil, match: ::Hash
40
39
  config.add_field! :retry_policy, nil, match: [::Hash, ::Proc]
@@ -50,22 +49,27 @@ module Google
50
49
  # Create a new client object for GatewayControl.
51
50
  #
52
51
  # By default, this returns an instance of
53
- # [Google::Cloud::GkeConnect::Gateway::V1beta1::GatewayControl::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-gke_connect-gateway-v1beta1/latest/Google-Cloud-GkeConnect-Gateway-V1beta1-GatewayControl-Client)
54
- # for a gRPC client for version V1beta1 of the API.
52
+ # [Google::Cloud::GkeConnect::Gateway::V1::GatewayControl::Rest::Client](https://cloud.google.com/ruby/docs/reference/google-cloud-gke_connect-gateway-v1/latest/Google-Cloud-GkeConnect-Gateway-V1-GatewayControl-Rest-Client)
53
+ # for a REST client for version V1 of the API.
55
54
  # However, you can specify a different API version by passing it in the
56
55
  # `version` parameter. If the GatewayControl service is
57
56
  # supported by that API version, and the corresponding gem is available, the
58
57
  # appropriate versioned client will be returned.
59
58
  #
59
+ # Raises an exception if the currently installed versioned client gem for the
60
+ # given API version does not support the GatewayControl service.
61
+ # You can determine whether the method will succeed by calling
62
+ # {Google::Cloud::GkeConnect::Gateway.gateway_control_available?}.
63
+ #
60
64
  # ## About GatewayControl
61
65
  #
62
66
  # GatewayControl is the control plane API for Connect Gateway.
63
67
  #
64
68
  # @param version [::String, ::Symbol] The API version to connect to. Optional.
65
- # Defaults to `:v1beta1`.
69
+ # Defaults to `:v1`.
66
70
  # @return [::Object] A client object for the specified version.
67
71
  #
68
- def self.gateway_control version: :v1beta1, &block
72
+ def self.gateway_control version: :v1, &block
69
73
  require "google/cloud/gke_connect/gateway/#{version.to_s.downcase}"
70
74
 
71
75
  package_name = Google::Cloud::GkeConnect::Gateway
@@ -73,7 +77,35 @@ module Google
73
77
  .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
74
78
  .first
75
79
  service_module = Google::Cloud::GkeConnect::Gateway.const_get(package_name).const_get(:GatewayControl)
76
- service_module.const_get(:Client).new(&block)
80
+ service_module.const_get(:Rest).const_get(:Client).new(&block)
81
+ end
82
+
83
+ ##
84
+ # Determines whether the GatewayControl service is supported by the current client.
85
+ # If true, you can retrieve a client object by calling {Google::Cloud::GkeConnect::Gateway.gateway_control}.
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 GatewayControl service,
88
+ # or if the versioned client gem needs an update to support the GatewayControl 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.gateway_control_available? version: :v1
95
+ require "google/cloud/gke_connect/gateway/#{version.to_s.downcase}"
96
+ package_name = Google::Cloud::GkeConnect::Gateway
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::GkeConnect::Gateway.const_get package_name
102
+ return false unless service_module.const_defined? :GatewayControl
103
+ service_module = service_module.const_get :GatewayControl
104
+ return false unless service_module.const_defined? :Rest
105
+ service_module = service_module.const_get :Rest
106
+ service_module.const_defined? :Client
107
+ rescue ::LoadError
108
+ false
77
109
  end
78
110
 
79
111
  ##
@@ -88,8 +120,6 @@ module Google
88
120
  # The library name as recorded in instrumentation and logging.
89
121
  # * `lib_version` (*type:* `String`) -
90
122
  # The library version as recorded in instrumentation and logging.
91
- # * `interceptors` (*type:* `Array<GRPC::ClientInterceptor>`) -
92
- # An array of interceptors that are run before calls are executed.
93
123
  # * `timeout` (*type:* `Numeric`) -
94
124
  # Default timeout in seconds.
95
125
  # * `metadata` (*type:* `Hash{Symbol=>String}`) -
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-gke_connect-gateway
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 2.1.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-27 00:00:00.000000000 Z
10
+ date: 2025-01-29 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: google-cloud-core
@@ -25,12 +24,12 @@ dependencies:
25
24
  - !ruby/object:Gem::Version
26
25
  version: '1.6'
27
26
  - !ruby/object:Gem::Dependency
28
- name: google-cloud-gke_connect-gateway-v1beta1
27
+ name: google-cloud-gke_connect-gateway-v1
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
30
  - - ">="
32
31
  - !ruby/object:Gem::Version
33
- version: '0.5'
32
+ version: '0.2'
34
33
  - - "<"
35
34
  - !ruby/object:Gem::Version
36
35
  version: 2.a
@@ -40,7 +39,7 @@ dependencies:
40
39
  requirements:
41
40
  - - ">="
42
41
  - !ruby/object:Gem::Version
43
- version: '0.5'
42
+ version: '0.2'
44
43
  - - "<"
45
44
  - !ruby/object:Gem::Version
46
45
  version: 2.a
@@ -65,7 +64,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
65
64
  licenses:
66
65
  - Apache-2.0
67
66
  metadata: {}
68
- post_install_message:
69
67
  rdoc_options: []
70
68
  require_paths:
71
69
  - lib
@@ -73,15 +71,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
73
71
  requirements:
74
72
  - - ">="
75
73
  - !ruby/object:Gem::Version
76
- version: '2.7'
74
+ version: '3.0'
77
75
  required_rubygems_version: !ruby/object:Gem::Requirement
78
76
  requirements:
79
77
  - - ">="
80
78
  - !ruby/object:Gem::Version
81
79
  version: '0'
82
80
  requirements: []
83
- rubygems_version: 3.5.6
84
- signing_key:
81
+ rubygems_version: 3.6.2
85
82
  specification_version: 4
86
83
  summary: API Client library for the Connect Gateway API
87
84
  test_files: []