google-cloud-gke_connect-gateway-v1 0.1.0 → 0.2.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 +4 -4
- data/README.md +1 -27
- data/lib/google/cloud/gke_connect/gateway/v1/gateway_control.rb +0 -7
- data/lib/google/cloud/gke_connect/gateway/v1/version.rb +1 -1
- data/lib/google/cloud/gke_connect/gateway/v1.rb +0 -5
- data/proto_docs/google/api/client.rb +20 -0
- metadata +3 -4
- data/lib/google/cloud/gke_connect/gateway/v1/gateway_control/client.rb +0 -450
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5bfa0b1d025932450f73fa9c2ffda0a56bf039af9c584c58238551ce056021c
|
4
|
+
data.tar.gz: cf6901daedf545821cc5d75d11d78a7227648425d06213d14a78705c49bc4883
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b2b680e9edba19669b396db848318f49e4191eb2503836721947a50a1460f8a64772544fb67b410aa61c39cc14101801831fb32ea4f89523ef56f93f30d9800
|
7
|
+
data.tar.gz: 37d7ed34d52c0d4484e99a549702b8e334d0c1691b475c9886dbde1b8d36fde5cb4b3a16aa255afd51b8b09eced7adbb5540f67e0ac50b2cd6d7b3286f3dd88e
|
data/AUTHENTICATION.md
CHANGED
@@ -56,7 +56,7 @@ To configure a credentials file for an individual client initialization:
|
|
56
56
|
```ruby
|
57
57
|
require "google/cloud/gke_connect/gateway/v1"
|
58
58
|
|
59
|
-
client = ::Google::Cloud::GkeConnect::Gateway::V1::GatewayControl::Client.new do |config|
|
59
|
+
client = ::Google::Cloud::GkeConnect::Gateway::V1::GatewayControl::Rest::Client.new do |config|
|
60
60
|
config.credentials = "path/to/credentialfile.json"
|
61
61
|
end
|
62
62
|
```
|
@@ -66,11 +66,11 @@ To configure a credentials file globally for all clients:
|
|
66
66
|
```ruby
|
67
67
|
require "google/cloud/gke_connect/gateway/v1"
|
68
68
|
|
69
|
-
::Google::Cloud::GkeConnect::Gateway::V1::GatewayControl::Client.configure do |config|
|
69
|
+
::Google::Cloud::GkeConnect::Gateway::V1::GatewayControl::Rest::Client.configure do |config|
|
70
70
|
config.credentials = "path/to/credentialfile.json"
|
71
71
|
end
|
72
72
|
|
73
|
-
client = ::Google::Cloud::GkeConnect::Gateway::V1::GatewayControl::Client.new
|
73
|
+
client = ::Google::Cloud::GkeConnect::Gateway::V1::GatewayControl::Rest::Client.new
|
74
74
|
```
|
75
75
|
|
76
76
|
### Environment Variables
|
@@ -100,7 +100,7 @@ require "google/cloud/gke_connect/gateway/v1"
|
|
100
100
|
|
101
101
|
ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json"
|
102
102
|
|
103
|
-
client = ::Google::Cloud::GkeConnect::Gateway::V1::GatewayControl::Client.new
|
103
|
+
client = ::Google::Cloud::GkeConnect::Gateway::V1::GatewayControl::Rest::Client.new
|
104
104
|
```
|
105
105
|
|
106
106
|
### Local ADC file
|
data/README.md
CHANGED
@@ -32,7 +32,7 @@ In order to use this library, you first need to go through the following steps:
|
|
32
32
|
```ruby
|
33
33
|
require "google/cloud/gke_connect/gateway/v1"
|
34
34
|
|
35
|
-
client = ::Google::Cloud::GkeConnect::Gateway::V1::GatewayControl::Client.new
|
35
|
+
client = ::Google::Cloud::GkeConnect::Gateway::V1::GatewayControl::Rest::Client.new
|
36
36
|
request = ::Google::Cloud::GkeConnect::Gateway::V1::GenerateCredentialsRequest.new # (request fields as keyword arguments...)
|
37
37
|
response = client.generate_credentials request
|
38
38
|
```
|
@@ -43,32 +43,6 @@ for class and method documentation.
|
|
43
43
|
See also the [Product Documentation](https://cloud.google.com/kubernetes-engine/enterprise/multicluster-management/gateway)
|
44
44
|
for general usage information.
|
45
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
|
-
```
|
71
|
-
|
72
46
|
|
73
47
|
## Google Cloud Samples
|
74
48
|
|
@@ -16,14 +16,12 @@
|
|
16
16
|
|
17
17
|
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
18
|
|
19
|
-
require "gapic/common"
|
20
19
|
require "gapic/config"
|
21
20
|
require "gapic/config/method"
|
22
21
|
|
23
22
|
require "google/cloud/gke_connect/gateway/v1/version"
|
24
23
|
|
25
24
|
require "google/cloud/gke_connect/gateway/v1/gateway_control/credentials"
|
26
|
-
require "google/cloud/gke_connect/gateway/v1/gateway_control/client"
|
27
25
|
require "google/cloud/gke_connect/gateway/v1/gateway_control/rest"
|
28
26
|
|
29
27
|
module Google
|
@@ -34,11 +32,6 @@ module Google
|
|
34
32
|
##
|
35
33
|
# GatewayControl is the control plane API for Connect Gateway.
|
36
34
|
#
|
37
|
-
# @example Load this service and instantiate a gRPC client
|
38
|
-
#
|
39
|
-
# require "google/cloud/gke_connect/gateway/v1/gateway_control"
|
40
|
-
# client = ::Google::Cloud::GkeConnect::Gateway::V1::GatewayControl::Client.new
|
41
|
-
#
|
42
35
|
# @example Load this service and instantiate a REST client
|
43
36
|
#
|
44
37
|
# require "google/cloud/gke_connect/gateway/v1/gateway_control/rest"
|
@@ -26,11 +26,6 @@ module Google
|
|
26
26
|
##
|
27
27
|
# API client module.
|
28
28
|
#
|
29
|
-
# @example Load this package, including all its services, and instantiate a gRPC client
|
30
|
-
#
|
31
|
-
# require "google/cloud/gke_connect/gateway/v1"
|
32
|
-
# client = ::Google::Cloud::GkeConnect::Gateway::V1::GatewayControl::Client.new
|
33
|
-
#
|
34
29
|
# @example Load this package, including all its services, and instantiate a REST client
|
35
30
|
#
|
36
31
|
# require "google/cloud/gke_connect/gateway/v1"
|
@@ -28,6 +28,9 @@ module Google
|
|
28
28
|
# @!attribute [rw] destinations
|
29
29
|
# @return [::Array<::Google::Api::ClientLibraryDestination>]
|
30
30
|
# The destination where API teams want this client library to be published.
|
31
|
+
# @!attribute [rw] selective_gapic_generation
|
32
|
+
# @return [::Google::Api::SelectiveGapicGeneration]
|
33
|
+
# Configuration for which RPCs should be generated in the GAPIC client.
|
31
34
|
class CommonLanguageSettings
|
32
35
|
include ::Google::Protobuf::MessageExts
|
33
36
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -212,6 +215,12 @@ module Google
|
|
212
215
|
# enabled. By default, asynchronous REST clients will not be generated.
|
213
216
|
# This feature will be enabled by default 1 month after launching the
|
214
217
|
# feature in preview packages.
|
218
|
+
# @!attribute [rw] protobuf_pythonic_types_enabled
|
219
|
+
# @return [::Boolean]
|
220
|
+
# Enables generation of protobuf code using new types that are more
|
221
|
+
# Pythonic which are included in `protobuf>=5.29.x`. This feature will be
|
222
|
+
# enabled by default 1 month after launching the feature in preview
|
223
|
+
# packages.
|
215
224
|
class ExperimentalFeatures
|
216
225
|
include ::Google::Protobuf::MessageExts
|
217
226
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -375,6 +384,17 @@ module Google
|
|
375
384
|
end
|
376
385
|
end
|
377
386
|
|
387
|
+
# This message is used to configure the generation of a subset of the RPCs in
|
388
|
+
# a service for client libraries.
|
389
|
+
# @!attribute [rw] methods
|
390
|
+
# @return [::Array<::String>]
|
391
|
+
# An allowlist of the fully qualified names of RPCs that should be included
|
392
|
+
# on public client surfaces.
|
393
|
+
class SelectiveGapicGeneration
|
394
|
+
include ::Google::Protobuf::MessageExts
|
395
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
396
|
+
end
|
397
|
+
|
378
398
|
# The organization for which the client libraries are being published.
|
379
399
|
# Affects the url where generated docs are published, etc.
|
380
400
|
module ClientLibraryOrganization
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-gke_connect-gateway-v1
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.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: 2024-
|
11
|
+
date: 2024-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gapic-common
|
@@ -61,7 +61,6 @@ files:
|
|
61
61
|
- lib/google-cloud-gke_connect-gateway-v1.rb
|
62
62
|
- lib/google/cloud/gke_connect/gateway/v1.rb
|
63
63
|
- lib/google/cloud/gke_connect/gateway/v1/gateway_control.rb
|
64
|
-
- lib/google/cloud/gke_connect/gateway/v1/gateway_control/client.rb
|
65
64
|
- lib/google/cloud/gke_connect/gateway/v1/gateway_control/credentials.rb
|
66
65
|
- lib/google/cloud/gke_connect/gateway/v1/gateway_control/rest.rb
|
67
66
|
- lib/google/cloud/gke_connect/gateway/v1/gateway_control/rest/client.rb
|
@@ -96,7 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
95
|
- !ruby/object:Gem::Version
|
97
96
|
version: '0'
|
98
97
|
requirements: []
|
99
|
-
rubygems_version: 3.5.
|
98
|
+
rubygems_version: 3.5.22
|
100
99
|
signing_key:
|
101
100
|
specification_version: 4
|
102
101
|
summary: The Connect Gateway service allows connectivity from external parties to
|
@@ -1,450 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Copyright 2024 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
|
-
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
-
|
19
|
-
require "google/cloud/errors"
|
20
|
-
require "google/cloud/gkeconnect/gateway/v1/control_pb"
|
21
|
-
|
22
|
-
module Google
|
23
|
-
module Cloud
|
24
|
-
module GkeConnect
|
25
|
-
module Gateway
|
26
|
-
module V1
|
27
|
-
module GatewayControl
|
28
|
-
##
|
29
|
-
# Client for the GatewayControl service.
|
30
|
-
#
|
31
|
-
# GatewayControl is the control plane API for Connect Gateway.
|
32
|
-
#
|
33
|
-
class Client
|
34
|
-
# @private
|
35
|
-
API_VERSION = ""
|
36
|
-
|
37
|
-
# @private
|
38
|
-
DEFAULT_ENDPOINT_TEMPLATE = "connectgateway.$UNIVERSE_DOMAIN$"
|
39
|
-
|
40
|
-
# @private
|
41
|
-
attr_reader :gateway_control_stub
|
42
|
-
|
43
|
-
##
|
44
|
-
# Configure the GatewayControl Client class.
|
45
|
-
#
|
46
|
-
# See {::Google::Cloud::GkeConnect::Gateway::V1::GatewayControl::Client::Configuration}
|
47
|
-
# for a description of the configuration fields.
|
48
|
-
#
|
49
|
-
# @example
|
50
|
-
#
|
51
|
-
# # Modify the configuration for all GatewayControl clients
|
52
|
-
# ::Google::Cloud::GkeConnect::Gateway::V1::GatewayControl::Client.configure do |config|
|
53
|
-
# config.timeout = 10.0
|
54
|
-
# end
|
55
|
-
#
|
56
|
-
# @yield [config] Configure the Client client.
|
57
|
-
# @yieldparam config [Client::Configuration]
|
58
|
-
#
|
59
|
-
# @return [Client::Configuration]
|
60
|
-
#
|
61
|
-
def self.configure
|
62
|
-
@configure ||= begin
|
63
|
-
namespace = ["Google", "Cloud", "GkeConnect", "Gateway", "V1"]
|
64
|
-
parent_config = while namespace.any?
|
65
|
-
parent_name = namespace.join "::"
|
66
|
-
parent_const = const_get parent_name
|
67
|
-
break parent_const.configure if parent_const.respond_to? :configure
|
68
|
-
namespace.pop
|
69
|
-
end
|
70
|
-
default_config = Client::Configuration.new parent_config
|
71
|
-
|
72
|
-
default_config.rpcs.generate_credentials.timeout = 60.0
|
73
|
-
default_config.rpcs.generate_credentials.retry_policy = {
|
74
|
-
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
75
|
-
}
|
76
|
-
|
77
|
-
default_config
|
78
|
-
end
|
79
|
-
yield @configure if block_given?
|
80
|
-
@configure
|
81
|
-
end
|
82
|
-
|
83
|
-
##
|
84
|
-
# Configure the GatewayControl Client instance.
|
85
|
-
#
|
86
|
-
# The configuration is set to the derived mode, meaning that values can be changed,
|
87
|
-
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
88
|
-
# should be made on {Client.configure}.
|
89
|
-
#
|
90
|
-
# See {::Google::Cloud::GkeConnect::Gateway::V1::GatewayControl::Client::Configuration}
|
91
|
-
# for a description of the configuration fields.
|
92
|
-
#
|
93
|
-
# @yield [config] Configure the Client client.
|
94
|
-
# @yieldparam config [Client::Configuration]
|
95
|
-
#
|
96
|
-
# @return [Client::Configuration]
|
97
|
-
#
|
98
|
-
def configure
|
99
|
-
yield @config if block_given?
|
100
|
-
@config
|
101
|
-
end
|
102
|
-
|
103
|
-
##
|
104
|
-
# The effective universe domain
|
105
|
-
#
|
106
|
-
# @return [String]
|
107
|
-
#
|
108
|
-
def universe_domain
|
109
|
-
@gateway_control_stub.universe_domain
|
110
|
-
end
|
111
|
-
|
112
|
-
##
|
113
|
-
# Create a new GatewayControl client object.
|
114
|
-
#
|
115
|
-
# @example
|
116
|
-
#
|
117
|
-
# # Create a client using the default configuration
|
118
|
-
# client = ::Google::Cloud::GkeConnect::Gateway::V1::GatewayControl::Client.new
|
119
|
-
#
|
120
|
-
# # Create a client using a custom configuration
|
121
|
-
# client = ::Google::Cloud::GkeConnect::Gateway::V1::GatewayControl::Client.new do |config|
|
122
|
-
# config.timeout = 10.0
|
123
|
-
# end
|
124
|
-
#
|
125
|
-
# @yield [config] Configure the GatewayControl client.
|
126
|
-
# @yieldparam config [Client::Configuration]
|
127
|
-
#
|
128
|
-
def initialize
|
129
|
-
# These require statements are intentionally placed here to initialize
|
130
|
-
# the gRPC module only when it's required.
|
131
|
-
# See https://github.com/googleapis/toolkit/issues/446
|
132
|
-
require "gapic/grpc"
|
133
|
-
require "google/cloud/gkeconnect/gateway/v1/control_services_pb"
|
134
|
-
|
135
|
-
# Create the configuration object
|
136
|
-
@config = Configuration.new Client.configure
|
137
|
-
|
138
|
-
# Yield the configuration if needed
|
139
|
-
yield @config if block_given?
|
140
|
-
|
141
|
-
# Create credentials
|
142
|
-
credentials = @config.credentials
|
143
|
-
# Use self-signed JWT if the endpoint is unchanged from default,
|
144
|
-
# but only if the default endpoint does not have a region prefix.
|
145
|
-
enable_self_signed_jwt = @config.endpoint.nil? ||
|
146
|
-
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
147
|
-
!@config.endpoint.split(".").first.include?("-"))
|
148
|
-
credentials ||= Credentials.default scope: @config.scope,
|
149
|
-
enable_self_signed_jwt: enable_self_signed_jwt
|
150
|
-
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
151
|
-
credentials = Credentials.new credentials, scope: @config.scope
|
152
|
-
end
|
153
|
-
@quota_project_id = @config.quota_project
|
154
|
-
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
155
|
-
|
156
|
-
@gateway_control_stub = ::Gapic::ServiceStub.new(
|
157
|
-
::Google::Cloud::GkeConnect::Gateway::V1::GatewayControl::Stub,
|
158
|
-
credentials: credentials,
|
159
|
-
endpoint: @config.endpoint,
|
160
|
-
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
161
|
-
universe_domain: @config.universe_domain,
|
162
|
-
channel_args: @config.channel_args,
|
163
|
-
interceptors: @config.interceptors,
|
164
|
-
channel_pool_config: @config.channel_pool
|
165
|
-
)
|
166
|
-
end
|
167
|
-
|
168
|
-
# Service calls
|
169
|
-
|
170
|
-
##
|
171
|
-
# GenerateCredentials provides connection information that allows a user to
|
172
|
-
# access the specified membership using Connect Gateway.
|
173
|
-
#
|
174
|
-
# @overload generate_credentials(request, options = nil)
|
175
|
-
# Pass arguments to `generate_credentials` via a request object, either of type
|
176
|
-
# {::Google::Cloud::GkeConnect::Gateway::V1::GenerateCredentialsRequest} or an equivalent Hash.
|
177
|
-
#
|
178
|
-
# @param request [::Google::Cloud::GkeConnect::Gateway::V1::GenerateCredentialsRequest, ::Hash]
|
179
|
-
# A request object representing the call parameters. Required. To specify no
|
180
|
-
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
181
|
-
# @param options [::Gapic::CallOptions, ::Hash]
|
182
|
-
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
183
|
-
#
|
184
|
-
# @overload generate_credentials(name: nil, force_use_agent: nil, version: nil, kubernetes_namespace: nil, operating_system: nil)
|
185
|
-
# Pass arguments to `generate_credentials` via keyword arguments. Note that at
|
186
|
-
# least one keyword argument is required. To specify no parameters, or to keep all
|
187
|
-
# the default parameter values, pass an empty Hash as a request object (see above).
|
188
|
-
#
|
189
|
-
# @param name [::String]
|
190
|
-
# Required. The Fleet membership resource.
|
191
|
-
# @param force_use_agent [::Boolean]
|
192
|
-
# Optional. Whether to force the use of Connect Agent-based transport.
|
193
|
-
#
|
194
|
-
# This will return a configuration that uses Connect Agent as the underlying
|
195
|
-
# transport mechanism for cluster types that would otherwise have used a
|
196
|
-
# different transport. Requires that Connect Agent be installed on the
|
197
|
-
# cluster. Setting this field to false is equivalent to not setting it.
|
198
|
-
# @param version [::String]
|
199
|
-
# Optional. The Connect Gateway version to be used in the resulting
|
200
|
-
# configuration.
|
201
|
-
#
|
202
|
-
# Leave this field blank to let the server choose the version (recommended).
|
203
|
-
# @param kubernetes_namespace [::String]
|
204
|
-
# Optional. The namespace to use in the kubeconfig context.
|
205
|
-
#
|
206
|
-
# If this field is specified, the server will set the `namespace` field in
|
207
|
-
# kubeconfig context. If not specified, the `namespace` field is omitted.
|
208
|
-
# @param operating_system [::Google::Cloud::GkeConnect::Gateway::V1::GenerateCredentialsRequest::OperatingSystem]
|
209
|
-
# Optional. The operating system where the kubeconfig will be used.
|
210
|
-
#
|
211
|
-
# @yield [response, operation] Access the result along with the RPC operation
|
212
|
-
# @yieldparam response [::Google::Cloud::GkeConnect::Gateway::V1::GenerateCredentialsResponse]
|
213
|
-
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
214
|
-
#
|
215
|
-
# @return [::Google::Cloud::GkeConnect::Gateway::V1::GenerateCredentialsResponse]
|
216
|
-
#
|
217
|
-
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
218
|
-
#
|
219
|
-
# @example Basic example
|
220
|
-
# require "google/cloud/gke_connect/gateway/v1"
|
221
|
-
#
|
222
|
-
# # Create a client object. The client can be reused for multiple calls.
|
223
|
-
# client = Google::Cloud::GkeConnect::Gateway::V1::GatewayControl::Client.new
|
224
|
-
#
|
225
|
-
# # Create a request. To set request fields, pass in keyword arguments.
|
226
|
-
# request = Google::Cloud::GkeConnect::Gateway::V1::GenerateCredentialsRequest.new
|
227
|
-
#
|
228
|
-
# # Call the generate_credentials method.
|
229
|
-
# result = client.generate_credentials request
|
230
|
-
#
|
231
|
-
# # The returned object is of type Google::Cloud::GkeConnect::Gateway::V1::GenerateCredentialsResponse.
|
232
|
-
# p result
|
233
|
-
#
|
234
|
-
def generate_credentials request, options = nil
|
235
|
-
raise ::ArgumentError, "request must be provided" if request.nil?
|
236
|
-
|
237
|
-
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeConnect::Gateway::V1::GenerateCredentialsRequest
|
238
|
-
|
239
|
-
# Converts hash and nil to an options object
|
240
|
-
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
241
|
-
|
242
|
-
# Customize the options with defaults
|
243
|
-
metadata = @config.rpcs.generate_credentials.metadata.to_h
|
244
|
-
|
245
|
-
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
246
|
-
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
247
|
-
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
248
|
-
gapic_version: ::Google::Cloud::GkeConnect::Gateway::V1::VERSION
|
249
|
-
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
250
|
-
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
251
|
-
|
252
|
-
header_params = {}
|
253
|
-
if request.name
|
254
|
-
header_params["name"] = request.name
|
255
|
-
end
|
256
|
-
|
257
|
-
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
258
|
-
metadata[:"x-goog-request-params"] ||= request_params_header
|
259
|
-
|
260
|
-
options.apply_defaults timeout: @config.rpcs.generate_credentials.timeout,
|
261
|
-
metadata: metadata,
|
262
|
-
retry_policy: @config.rpcs.generate_credentials.retry_policy
|
263
|
-
|
264
|
-
options.apply_defaults timeout: @config.timeout,
|
265
|
-
metadata: @config.metadata,
|
266
|
-
retry_policy: @config.retry_policy
|
267
|
-
|
268
|
-
@gateway_control_stub.call_rpc :generate_credentials, request, options: options do |response, operation|
|
269
|
-
yield response, operation if block_given?
|
270
|
-
return response
|
271
|
-
end
|
272
|
-
rescue ::GRPC::BadStatus => e
|
273
|
-
raise ::Google::Cloud::Error.from_error(e)
|
274
|
-
end
|
275
|
-
|
276
|
-
##
|
277
|
-
# Configuration class for the GatewayControl API.
|
278
|
-
#
|
279
|
-
# This class represents the configuration for GatewayControl,
|
280
|
-
# providing control over timeouts, retry behavior, logging, transport
|
281
|
-
# parameters, and other low-level controls. Certain parameters can also be
|
282
|
-
# applied individually to specific RPCs. See
|
283
|
-
# {::Google::Cloud::GkeConnect::Gateway::V1::GatewayControl::Client::Configuration::Rpcs}
|
284
|
-
# for a list of RPCs that can be configured independently.
|
285
|
-
#
|
286
|
-
# Configuration can be applied globally to all clients, or to a single client
|
287
|
-
# on construction.
|
288
|
-
#
|
289
|
-
# @example
|
290
|
-
#
|
291
|
-
# # Modify the global config, setting the timeout for
|
292
|
-
# # generate_credentials to 20 seconds,
|
293
|
-
# # and all remaining timeouts to 10 seconds.
|
294
|
-
# ::Google::Cloud::GkeConnect::Gateway::V1::GatewayControl::Client.configure do |config|
|
295
|
-
# config.timeout = 10.0
|
296
|
-
# config.rpcs.generate_credentials.timeout = 20.0
|
297
|
-
# end
|
298
|
-
#
|
299
|
-
# # Apply the above configuration only to a new client.
|
300
|
-
# client = ::Google::Cloud::GkeConnect::Gateway::V1::GatewayControl::Client.new do |config|
|
301
|
-
# config.timeout = 10.0
|
302
|
-
# config.rpcs.generate_credentials.timeout = 20.0
|
303
|
-
# end
|
304
|
-
#
|
305
|
-
# @!attribute [rw] endpoint
|
306
|
-
# A custom service endpoint, as a hostname or hostname:port. The default is
|
307
|
-
# nil, indicating to use the default endpoint in the current universe domain.
|
308
|
-
# @return [::String,nil]
|
309
|
-
# @!attribute [rw] credentials
|
310
|
-
# Credentials to send with calls. You may provide any of the following types:
|
311
|
-
# * (`String`) The path to a service account key file in JSON format
|
312
|
-
# * (`Hash`) A service account key as a Hash
|
313
|
-
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
314
|
-
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
315
|
-
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
316
|
-
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
317
|
-
# * (`GRPC::Core::Channel`) a gRPC channel with included credentials
|
318
|
-
# * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
|
319
|
-
# * (`nil`) indicating no credentials
|
320
|
-
# @return [::Object]
|
321
|
-
# @!attribute [rw] scope
|
322
|
-
# The OAuth scopes
|
323
|
-
# @return [::Array<::String>]
|
324
|
-
# @!attribute [rw] lib_name
|
325
|
-
# The library name as recorded in instrumentation and logging
|
326
|
-
# @return [::String]
|
327
|
-
# @!attribute [rw] lib_version
|
328
|
-
# The library version as recorded in instrumentation and logging
|
329
|
-
# @return [::String]
|
330
|
-
# @!attribute [rw] channel_args
|
331
|
-
# Extra parameters passed to the gRPC channel. Note: this is ignored if a
|
332
|
-
# `GRPC::Core::Channel` object is provided as the credential.
|
333
|
-
# @return [::Hash]
|
334
|
-
# @!attribute [rw] interceptors
|
335
|
-
# An array of interceptors that are run before calls are executed.
|
336
|
-
# @return [::Array<::GRPC::ClientInterceptor>]
|
337
|
-
# @!attribute [rw] timeout
|
338
|
-
# The call timeout in seconds.
|
339
|
-
# @return [::Numeric]
|
340
|
-
# @!attribute [rw] metadata
|
341
|
-
# Additional gRPC headers to be sent with the call.
|
342
|
-
# @return [::Hash{::Symbol=>::String}]
|
343
|
-
# @!attribute [rw] retry_policy
|
344
|
-
# The retry policy. The value is a hash with the following keys:
|
345
|
-
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
346
|
-
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
347
|
-
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
348
|
-
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
349
|
-
# trigger a retry.
|
350
|
-
# @return [::Hash]
|
351
|
-
# @!attribute [rw] quota_project
|
352
|
-
# A separate project against which to charge quota.
|
353
|
-
# @return [::String]
|
354
|
-
# @!attribute [rw] universe_domain
|
355
|
-
# The universe domain within which to make requests. This determines the
|
356
|
-
# default endpoint URL. The default value of nil uses the environment
|
357
|
-
# universe (usually the default "googleapis.com" universe).
|
358
|
-
# @return [::String,nil]
|
359
|
-
#
|
360
|
-
class Configuration
|
361
|
-
extend ::Gapic::Config
|
362
|
-
|
363
|
-
# @private
|
364
|
-
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
365
|
-
DEFAULT_ENDPOINT = "connectgateway.googleapis.com"
|
366
|
-
|
367
|
-
config_attr :endpoint, nil, ::String, nil
|
368
|
-
config_attr :credentials, nil do |value|
|
369
|
-
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
370
|
-
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
371
|
-
allowed.any? { |klass| klass === value }
|
372
|
-
end
|
373
|
-
config_attr :scope, nil, ::String, ::Array, nil
|
374
|
-
config_attr :lib_name, nil, ::String, nil
|
375
|
-
config_attr :lib_version, nil, ::String, nil
|
376
|
-
config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
|
377
|
-
config_attr :interceptors, nil, ::Array, nil
|
378
|
-
config_attr :timeout, nil, ::Numeric, nil
|
379
|
-
config_attr :metadata, nil, ::Hash, nil
|
380
|
-
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
381
|
-
config_attr :quota_project, nil, ::String, nil
|
382
|
-
config_attr :universe_domain, nil, ::String, nil
|
383
|
-
|
384
|
-
# @private
|
385
|
-
def initialize parent_config = nil
|
386
|
-
@parent_config = parent_config unless parent_config.nil?
|
387
|
-
|
388
|
-
yield self if block_given?
|
389
|
-
end
|
390
|
-
|
391
|
-
##
|
392
|
-
# Configurations for individual RPCs
|
393
|
-
# @return [Rpcs]
|
394
|
-
#
|
395
|
-
def rpcs
|
396
|
-
@rpcs ||= begin
|
397
|
-
parent_rpcs = nil
|
398
|
-
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
399
|
-
Rpcs.new parent_rpcs
|
400
|
-
end
|
401
|
-
end
|
402
|
-
|
403
|
-
##
|
404
|
-
# Configuration for the channel pool
|
405
|
-
# @return [::Gapic::ServiceStub::ChannelPool::Configuration]
|
406
|
-
#
|
407
|
-
def channel_pool
|
408
|
-
@channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
|
409
|
-
end
|
410
|
-
|
411
|
-
##
|
412
|
-
# Configuration RPC class for the GatewayControl API.
|
413
|
-
#
|
414
|
-
# Includes fields providing the configuration for each RPC in this service.
|
415
|
-
# Each configuration object is of type `Gapic::Config::Method` and includes
|
416
|
-
# the following configuration fields:
|
417
|
-
#
|
418
|
-
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
419
|
-
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
|
420
|
-
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
421
|
-
# include the following keys:
|
422
|
-
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
423
|
-
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
424
|
-
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
425
|
-
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
426
|
-
# trigger a retry.
|
427
|
-
#
|
428
|
-
class Rpcs
|
429
|
-
##
|
430
|
-
# RPC-specific configuration for `generate_credentials`
|
431
|
-
# @return [::Gapic::Config::Method]
|
432
|
-
#
|
433
|
-
attr_reader :generate_credentials
|
434
|
-
|
435
|
-
# @private
|
436
|
-
def initialize parent_rpcs = nil
|
437
|
-
generate_credentials_config = parent_rpcs.generate_credentials if parent_rpcs.respond_to? :generate_credentials
|
438
|
-
@generate_credentials = ::Gapic::Config::Method.new generate_credentials_config
|
439
|
-
|
440
|
-
yield self if block_given?
|
441
|
-
end
|
442
|
-
end
|
443
|
-
end
|
444
|
-
end
|
445
|
-
end
|
446
|
-
end
|
447
|
-
end
|
448
|
-
end
|
449
|
-
end
|
450
|
-
end
|