google-cloud-gke_multi_cloud-v1 0.6.0 → 0.8.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 +72 -99
- data/lib/google/cloud/gke_multi_cloud/v1/attached_clusters/client.rb +157 -12
- data/lib/google/cloud/gke_multi_cloud/v1/attached_clusters/operations.rb +28 -6
- data/lib/google/cloud/gke_multi_cloud/v1/attached_clusters/rest/client.rb +1354 -0
- data/lib/google/cloud/gke_multi_cloud/v1/attached_clusters/rest/operations.rb +895 -0
- data/lib/google/cloud/gke_multi_cloud/v1/attached_clusters/rest/service_stub.rb +595 -0
- data/lib/google/cloud/gke_multi_cloud/v1/attached_clusters/rest.rb +55 -0
- data/lib/google/cloud/gke_multi_cloud/v1/attached_clusters.rb +6 -0
- data/lib/google/cloud/gke_multi_cloud/v1/aws_clusters/client.rb +492 -10
- data/lib/google/cloud/gke_multi_cloud/v1/aws_clusters/operations.rb +28 -6
- data/lib/google/cloud/gke_multi_cloud/v1/aws_clusters/rest/client.rb +2122 -0
- data/lib/google/cloud/gke_multi_cloud/v1/aws_clusters/rest/operations.rb +895 -0
- data/lib/google/cloud/gke_multi_cloud/v1/aws_clusters/rest/service_stub.rb +1010 -0
- data/lib/google/cloud/gke_multi_cloud/v1/aws_clusters/rest.rb +54 -0
- data/lib/google/cloud/gke_multi_cloud/v1/aws_clusters.rb +6 -0
- data/lib/google/cloud/gke_multi_cloud/v1/azure_clusters/client.rb +356 -10
- data/lib/google/cloud/gke_multi_cloud/v1/azure_clusters/operations.rb +28 -6
- data/lib/google/cloud/gke_multi_cloud/v1/azure_clusters/rest/client.rb +2430 -0
- data/lib/google/cloud/gke_multi_cloud/v1/azure_clusters/rest/operations.rb +895 -0
- data/lib/google/cloud/gke_multi_cloud/v1/azure_clusters/rest/service_stub.rb +1187 -0
- data/lib/google/cloud/gke_multi_cloud/v1/azure_clusters/rest.rb +54 -0
- data/lib/google/cloud/gke_multi_cloud/v1/azure_clusters.rb +6 -0
- data/lib/google/cloud/gke_multi_cloud/v1/rest.rb +39 -0
- data/lib/google/cloud/gke_multi_cloud/v1/version.rb +1 -1
- data/lib/google/cloud/gke_multi_cloud/v1.rb +5 -0
- data/lib/google/cloud/gkemulticloud/v1/attached_resources_pb.rb +4 -1
- data/lib/google/cloud/gkemulticloud/v1/attached_service_pb.rb +6 -2
- data/lib/google/cloud/gkemulticloud/v1/attached_service_services_pb.rb +2 -0
- data/lib/google/cloud/gkemulticloud/v1/aws_resources_pb.rb +10 -1
- data/lib/google/cloud/gkemulticloud/v1/aws_service_pb.rb +8 -1
- data/lib/google/cloud/gkemulticloud/v1/aws_service_services_pb.rb +18 -0
- data/lib/google/cloud/gkemulticloud/v1/azure_resources_pb.rb +7 -1
- data/lib/google/cloud/gkemulticloud/v1/azure_service_pb.rb +7 -1
- data/lib/google/cloud/gkemulticloud/v1/azure_service_services_pb.rb +11 -0
- data/lib/google/cloud/gkemulticloud/v1/common_resources_pb.rb +4 -1
- data/proto_docs/google/api/client.rb +14 -0
- data/proto_docs/google/cloud/gkemulticloud/v1/attached_resources.rb +48 -2
- data/proto_docs/google/cloud/gkemulticloud/v1/attached_service.rb +55 -2
- data/proto_docs/google/cloud/gkemulticloud/v1/aws_resources.rb +181 -6
- data/proto_docs/google/cloud/gkemulticloud/v1/aws_service.rb +117 -0
- data/proto_docs/google/cloud/gkemulticloud/v1/azure_resources.rb +103 -6
- data/proto_docs/google/cloud/gkemulticloud/v1/azure_service.rb +80 -4
- data/proto_docs/google/cloud/gkemulticloud/v1/common_resources.rb +56 -0
- data/proto_docs/google/type/date.rb +53 -0
- metadata +19 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 782e4c122c49a845c185c1e49ccc466e8569f87fde4eec9dd5c082ad8aa9ce17
|
4
|
+
data.tar.gz: 6abe39678674ce39f11d093c32873297e474d50d783e52b07f97ecd76d95fb5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b4a6ec7c4cc6ff271e595c2495a7a216bca9a6aa4229c48102255e324aa6551c43c12b87c3cdfef2a13f59752ca541dac12abdd1336760701cf55729e25f08f
|
7
|
+
data.tar.gz: 971f38f021000a6bc5534c30b37f30fdf107114ac485ecee4c3b61dca6506d19e6849964aa3db6be0c3fa5daa01b79037876dcfa3376bb3be3b6901019cc1202
|
data/AUTHENTICATION.md
CHANGED
@@ -1,149 +1,122 @@
|
|
1
1
|
# Authentication
|
2
2
|
|
3
|
-
|
4
|
-
[
|
5
|
-
|
6
|
-
[Google Cloud Platform environments](#google-cloud-platform-environments) the
|
7
|
-
credentials will be discovered automatically. When running on other
|
8
|
-
environments, the Service Account credentials can be specified by providing the
|
9
|
-
path to the
|
10
|
-
[JSON keyfile](https://cloud.google.com/iam/docs/managing-service-account-keys)
|
11
|
-
for the account (or the JSON itself) in
|
12
|
-
[environment variables](#environment-variables). Additionally, Cloud SDK
|
13
|
-
credentials can also be discovered automatically, but this is only recommended
|
14
|
-
during development.
|
3
|
+
The recommended way to authenticate to the google-cloud-gke_multi_cloud-v1 library is to use
|
4
|
+
[Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials).
|
5
|
+
To review all of your authentication options, see [Credentials lookup](#credential-lookup).
|
15
6
|
|
16
7
|
## Quickstart
|
17
8
|
|
18
|
-
|
19
|
-
|
9
|
+
The following example shows how to set up authentication for a local development
|
10
|
+
environment with your user credentials.
|
20
11
|
|
21
|
-
|
22
|
-
|
23
|
-
```
|
24
|
-
|
25
|
-
3. Initialize the client.
|
12
|
+
**NOTE:** This method is _not_ recommended for running in production. User credentials
|
13
|
+
should be used only during development.
|
26
14
|
|
27
|
-
|
28
|
-
|
15
|
+
1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk).
|
16
|
+
2. Set up a local ADC file with your user credentials:
|
29
17
|
|
30
|
-
|
18
|
+
```sh
|
19
|
+
gcloud auth application-default login
|
31
20
|
```
|
32
21
|
|
33
|
-
|
34
|
-
|
35
|
-
The google-cloud-gke_multi_cloud-v1 library aims to make authentication
|
36
|
-
as simple as possible, and provides several mechanisms to configure your system
|
37
|
-
without requiring **Service Account Credentials** directly in code.
|
38
|
-
|
39
|
-
**Credentials** are discovered in the following order:
|
40
|
-
|
41
|
-
1. Specify credentials in method arguments
|
42
|
-
2. Specify credentials in configuration
|
43
|
-
3. Discover credentials path in environment variables
|
44
|
-
4. Discover credentials JSON in environment variables
|
45
|
-
5. Discover credentials file in the Cloud SDK's path
|
46
|
-
6. Discover GCP credentials
|
47
|
-
|
48
|
-
### Google Cloud Platform environments
|
22
|
+
3. Write code as if already authenticated.
|
49
23
|
|
50
|
-
|
51
|
-
|
52
|
-
Functions (GCF) and Cloud Run, **Credentials** are discovered automatically.
|
53
|
-
Code should be written as if already authenticated.
|
24
|
+
For more information about setting up authentication for a local development environment, see
|
25
|
+
[Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev).
|
54
26
|
|
55
|
-
|
27
|
+
## Credential Lookup
|
56
28
|
|
57
|
-
The
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
**Credentials JSON** file can be stored in the environment variable, or the
|
62
|
-
**Credentials JSON** itself can be stored for environments such as Docker
|
63
|
-
containers where writing files is difficult or not encouraged.
|
29
|
+
The google-cloud-gke_multi_cloud-v1 library provides several mechanisms to configure your system.
|
30
|
+
Generally, using Application Default Credentials to facilitate automatic
|
31
|
+
credentials discovery is the easist method. But if you need to explicitly specify
|
32
|
+
credentials, there are several methods available to you.
|
64
33
|
|
65
|
-
|
66
|
-
checks for credentials are configured on the service Credentials class (such as
|
67
|
-
{::Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Credentials}):
|
34
|
+
Credentials are accepted in the following ways, in the following order or precedence:
|
68
35
|
|
69
|
-
|
70
|
-
|
71
|
-
|
36
|
+
1. Credentials specified in method arguments
|
37
|
+
2. Credentials specified in configuration
|
38
|
+
3. Credentials pointed to or included in environment variables
|
39
|
+
4. Credentials found in local ADC file
|
40
|
+
5. Credentials returned by the metadata server for the attached service account (GCP)
|
72
41
|
|
73
|
-
|
74
|
-
require "google/cloud/gke_multi_cloud/v1"
|
75
|
-
|
76
|
-
ENV["GOOGLE_CLOUD_CREDENTIALS"] = "path/to/keyfile.json"
|
42
|
+
### Configuration
|
77
43
|
|
78
|
-
client
|
79
|
-
|
44
|
+
You can configure a path to a JSON credentials file, either for an individual client object or
|
45
|
+
globally, for all client objects. The JSON file can contain credentials created for
|
46
|
+
[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation),
|
47
|
+
[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a
|
48
|
+
[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key).
|
80
49
|
|
81
|
-
|
50
|
+
Note: Service account keys are a security risk if not managed correctly. You should
|
51
|
+
[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree)
|
52
|
+
whenever possible.
|
82
53
|
|
83
|
-
|
84
|
-
it in an environment variable. Either on an individual client initialization:
|
54
|
+
To configure a credentials file for an individual client initialization:
|
85
55
|
|
86
56
|
```ruby
|
87
57
|
require "google/cloud/gke_multi_cloud/v1"
|
88
58
|
|
89
59
|
client = ::Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Client.new do |config|
|
90
|
-
config.credentials = "path/to/
|
60
|
+
config.credentials = "path/to/credentialfile.json"
|
91
61
|
end
|
92
62
|
```
|
93
63
|
|
94
|
-
|
64
|
+
To configure a credentials file globally for all clients:
|
95
65
|
|
96
66
|
```ruby
|
97
67
|
require "google/cloud/gke_multi_cloud/v1"
|
98
68
|
|
99
69
|
::Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Client.configure do |config|
|
100
|
-
config.credentials = "path/to/
|
70
|
+
config.credentials = "path/to/credentialfile.json"
|
101
71
|
end
|
102
72
|
|
103
73
|
client = ::Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Client.new
|
104
74
|
```
|
105
75
|
|
106
|
-
###
|
76
|
+
### Environment Variables
|
107
77
|
|
108
|
-
|
109
|
-
|
110
|
-
|
78
|
+
You can also use an environment variable to provide a JSON credentials file.
|
79
|
+
The environment variable can contain a path to the credentials file or, for
|
80
|
+
environments such as Docker containers where writing files is not encouraged,
|
81
|
+
you can include the credentials file itself.
|
111
82
|
|
112
|
-
|
83
|
+
The JSON file can contain credentials created for
|
84
|
+
[workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation),
|
85
|
+
[workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a
|
86
|
+
[service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key).
|
113
87
|
|
114
|
-
|
115
|
-
|
116
|
-
|
88
|
+
Note: Service account keys are a security risk if not managed correctly. You should
|
89
|
+
[choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree)
|
90
|
+
whenever possible.
|
91
|
+
|
92
|
+
The environment variables that google-cloud-gke_multi_cloud-v1
|
93
|
+
checks for credentials are:
|
117
94
|
|
118
|
-
|
119
|
-
*
|
95
|
+
* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
|
96
|
+
* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
|
120
97
|
|
121
|
-
|
98
|
+
```ruby
|
99
|
+
require "google/cloud/gke_multi_cloud/v1"
|
122
100
|
|
123
|
-
|
124
|
-
connect to the APIs. You will use the **JSON key file** to
|
125
|
-
connect to most services with google-cloud-gke_multi_cloud-v1.
|
101
|
+
ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json"
|
126
102
|
|
127
|
-
|
128
|
-
|
129
|
-
need a Google Developers service account.
|
103
|
+
client = ::Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Client.new
|
104
|
+
```
|
130
105
|
|
131
|
-
|
132
|
-
2. Create a new project or click on an existing project.
|
133
|
-
3. Activate the menu in the upper left and select **APIs & Services**. From
|
134
|
-
here, you will enable the APIs that your application requires.
|
106
|
+
### Local ADC file
|
135
107
|
|
136
|
-
|
108
|
+
You can set up a local ADC file with your user credentials for authentication during
|
109
|
+
development. If credentials are not provided in code or in environment variables,
|
110
|
+
then the local ADC credentials are discovered.
|
137
111
|
|
138
|
-
|
112
|
+
Follow the steps in [Quickstart](#quickstart) to set up a local ADC file.
|
139
113
|
|
140
|
-
|
141
|
-
"Service account" to be guided through downloading a new JSON key file.
|
114
|
+
### Google Cloud Platform environments
|
142
115
|
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
116
|
+
When running on Google Cloud Platform (GCP), including Google Compute Engine
|
117
|
+
(GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud
|
118
|
+
Functions (GCF) and Cloud Run, credentials are retrieved from the attached
|
119
|
+
service account automatically. Code should be written as if already authenticated.
|
147
120
|
|
148
|
-
|
149
|
-
|
121
|
+
For more information, see
|
122
|
+
[Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa).
|
@@ -32,6 +32,9 @@ module Google
|
|
32
32
|
# infrastructure.
|
33
33
|
#
|
34
34
|
class Client
|
35
|
+
# @private
|
36
|
+
DEFAULT_ENDPOINT_TEMPLATE = "gkemulticloud.$UNIVERSE_DOMAIN$"
|
37
|
+
|
35
38
|
include Paths
|
36
39
|
|
37
40
|
# @private
|
@@ -94,6 +97,11 @@ module Google
|
|
94
97
|
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
95
98
|
}
|
96
99
|
|
100
|
+
default_config.rpcs.generate_attached_cluster_agent_token.timeout = 60.0
|
101
|
+
default_config.rpcs.generate_attached_cluster_agent_token.retry_policy = {
|
102
|
+
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
103
|
+
}
|
104
|
+
|
97
105
|
default_config
|
98
106
|
end
|
99
107
|
yield @configure if block_given?
|
@@ -120,6 +128,15 @@ module Google
|
|
120
128
|
@config
|
121
129
|
end
|
122
130
|
|
131
|
+
##
|
132
|
+
# The effective universe domain
|
133
|
+
#
|
134
|
+
# @return [String]
|
135
|
+
#
|
136
|
+
def universe_domain
|
137
|
+
@attached_clusters_stub.universe_domain
|
138
|
+
end
|
139
|
+
|
123
140
|
##
|
124
141
|
# Create a new AttachedClusters client object.
|
125
142
|
#
|
@@ -153,8 +170,9 @@ module Google
|
|
153
170
|
credentials = @config.credentials
|
154
171
|
# Use self-signed JWT if the endpoint is unchanged from default,
|
155
172
|
# but only if the default endpoint does not have a region prefix.
|
156
|
-
enable_self_signed_jwt = @config.endpoint
|
157
|
-
|
173
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
174
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
175
|
+
!@config.endpoint.split(".").first.include?("-"))
|
158
176
|
credentials ||= Credentials.default scope: @config.scope,
|
159
177
|
enable_self_signed_jwt: enable_self_signed_jwt
|
160
178
|
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
@@ -167,12 +185,15 @@ module Google
|
|
167
185
|
config.credentials = credentials
|
168
186
|
config.quota_project = @quota_project_id
|
169
187
|
config.endpoint = @config.endpoint
|
188
|
+
config.universe_domain = @config.universe_domain
|
170
189
|
end
|
171
190
|
|
172
191
|
@attached_clusters_stub = ::Gapic::ServiceStub.new(
|
173
192
|
::Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Stub,
|
174
|
-
credentials:
|
175
|
-
endpoint:
|
193
|
+
credentials: credentials,
|
194
|
+
endpoint: @config.endpoint,
|
195
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
196
|
+
universe_domain: @config.universe_domain,
|
176
197
|
channel_args: @config.channel_args,
|
177
198
|
interceptors: @config.interceptors,
|
178
199
|
channel_pool_config: @config.channel_pool
|
@@ -340,12 +361,16 @@ module Google
|
|
340
361
|
# fields from
|
341
362
|
# {::Google::Cloud::GkeMultiCloud::V1::AttachedCluster AttachedCluster}:
|
342
363
|
#
|
343
|
-
# * `description`.
|
344
364
|
# * `annotations`.
|
345
|
-
# * `
|
365
|
+
# * `authorization.admin_groups`.
|
346
366
|
# * `authorization.admin_users`.
|
367
|
+
# * `binary_authorization.evaluation_mode`.
|
368
|
+
# * `description`.
|
347
369
|
# * `logging_config.component_config.enable_components`.
|
348
370
|
# * `monitoring_config.managed_prometheus_config.enabled`.
|
371
|
+
# * `platform_version`.
|
372
|
+
# * `proxy_config.kubernetes_secret.name`.
|
373
|
+
# * `proxy_config.kubernetes_secret.namespace`.
|
349
374
|
#
|
350
375
|
# @yield [response, operation] Access the result along with the RPC operation
|
351
376
|
# @yieldparam response [::Gapic::Operation]
|
@@ -441,7 +466,7 @@ module Google
|
|
441
466
|
# @param options [::Gapic::CallOptions, ::Hash]
|
442
467
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
443
468
|
#
|
444
|
-
# @overload import_attached_cluster(parent: nil, validate_only: nil, fleet_membership: nil, platform_version: nil, distribution: nil)
|
469
|
+
# @overload import_attached_cluster(parent: nil, validate_only: nil, fleet_membership: nil, platform_version: nil, distribution: nil, proxy_config: nil)
|
445
470
|
# Pass arguments to `import_attached_cluster` via keyword arguments. Note that at
|
446
471
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
447
472
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
@@ -469,6 +494,8 @@ module Google
|
|
469
494
|
# Required. The Kubernetes distribution of the underlying attached cluster.
|
470
495
|
#
|
471
496
|
# Supported values: ["eks", "aks"].
|
497
|
+
# @param proxy_config [::Google::Cloud::GkeMultiCloud::V1::AttachedProxyConfig, ::Hash]
|
498
|
+
# Optional. Proxy configuration for outbound HTTP(S) traffic.
|
472
499
|
#
|
473
500
|
# @yield [response, operation] Access the result along with the RPC operation
|
474
501
|
# @yieldparam response [::Gapic::Operation]
|
@@ -980,7 +1007,7 @@ module Google
|
|
980
1007
|
# @param options [::Gapic::CallOptions, ::Hash]
|
981
1008
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
982
1009
|
#
|
983
|
-
# @overload generate_attached_cluster_install_manifest(parent: nil, attached_cluster_id: nil, platform_version: nil)
|
1010
|
+
# @overload generate_attached_cluster_install_manifest(parent: nil, attached_cluster_id: nil, platform_version: nil, proxy_config: nil)
|
984
1011
|
# Pass arguments to `generate_attached_cluster_install_manifest` via keyword arguments. Note that at
|
985
1012
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
986
1013
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
@@ -1016,6 +1043,8 @@ module Google
|
|
1016
1043
|
# You can list all supported versions on a given Google Cloud region by
|
1017
1044
|
# calling
|
1018
1045
|
# {::Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Client#get_attached_server_config GetAttachedServerConfig}.
|
1046
|
+
# @param proxy_config [::Google::Cloud::GkeMultiCloud::V1::AttachedProxyConfig, ::Hash]
|
1047
|
+
# Optional. Proxy configuration for outbound HTTP(S) traffic.
|
1019
1048
|
#
|
1020
1049
|
# @yield [response, operation] Access the result along with the RPC operation
|
1021
1050
|
# @yieldparam response [::Google::Cloud::GkeMultiCloud::V1::GenerateAttachedClusterInstallManifestResponse]
|
@@ -1081,6 +1110,107 @@ module Google
|
|
1081
1110
|
raise ::Google::Cloud::Error.from_error(e)
|
1082
1111
|
end
|
1083
1112
|
|
1113
|
+
##
|
1114
|
+
# Generates an access token for a cluster agent.
|
1115
|
+
#
|
1116
|
+
# @overload generate_attached_cluster_agent_token(request, options = nil)
|
1117
|
+
# Pass arguments to `generate_attached_cluster_agent_token` via a request object, either of type
|
1118
|
+
# {::Google::Cloud::GkeMultiCloud::V1::GenerateAttachedClusterAgentTokenRequest} or an equivalent Hash.
|
1119
|
+
#
|
1120
|
+
# @param request [::Google::Cloud::GkeMultiCloud::V1::GenerateAttachedClusterAgentTokenRequest, ::Hash]
|
1121
|
+
# A request object representing the call parameters. Required. To specify no
|
1122
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1123
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1124
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1125
|
+
#
|
1126
|
+
# @overload generate_attached_cluster_agent_token(attached_cluster: nil, subject_token: nil, subject_token_type: nil, version: nil, grant_type: nil, audience: nil, scope: nil, requested_token_type: nil, options: nil)
|
1127
|
+
# Pass arguments to `generate_attached_cluster_agent_token` via keyword arguments. Note that at
|
1128
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1129
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1130
|
+
#
|
1131
|
+
# @param attached_cluster [::String]
|
1132
|
+
# Required.
|
1133
|
+
# @param subject_token [::String]
|
1134
|
+
# Required.
|
1135
|
+
# @param subject_token_type [::String]
|
1136
|
+
# Required.
|
1137
|
+
# @param version [::String]
|
1138
|
+
# Required.
|
1139
|
+
# @param grant_type [::String]
|
1140
|
+
# Optional.
|
1141
|
+
# @param audience [::String]
|
1142
|
+
# Optional.
|
1143
|
+
# @param scope [::String]
|
1144
|
+
# Optional.
|
1145
|
+
# @param requested_token_type [::String]
|
1146
|
+
# Optional.
|
1147
|
+
# @param options [::String]
|
1148
|
+
# Optional.
|
1149
|
+
#
|
1150
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1151
|
+
# @yieldparam response [::Google::Cloud::GkeMultiCloud::V1::GenerateAttachedClusterAgentTokenResponse]
|
1152
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1153
|
+
#
|
1154
|
+
# @return [::Google::Cloud::GkeMultiCloud::V1::GenerateAttachedClusterAgentTokenResponse]
|
1155
|
+
#
|
1156
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1157
|
+
#
|
1158
|
+
# @example Basic example
|
1159
|
+
# require "google/cloud/gke_multi_cloud/v1"
|
1160
|
+
#
|
1161
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1162
|
+
# client = Google::Cloud::GkeMultiCloud::V1::AttachedClusters::Client.new
|
1163
|
+
#
|
1164
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1165
|
+
# request = Google::Cloud::GkeMultiCloud::V1::GenerateAttachedClusterAgentTokenRequest.new
|
1166
|
+
#
|
1167
|
+
# # Call the generate_attached_cluster_agent_token method.
|
1168
|
+
# result = client.generate_attached_cluster_agent_token request
|
1169
|
+
#
|
1170
|
+
# # The returned object is of type Google::Cloud::GkeMultiCloud::V1::GenerateAttachedClusterAgentTokenResponse.
|
1171
|
+
# p result
|
1172
|
+
#
|
1173
|
+
def generate_attached_cluster_agent_token request, options = nil
|
1174
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1175
|
+
|
1176
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GkeMultiCloud::V1::GenerateAttachedClusterAgentTokenRequest
|
1177
|
+
|
1178
|
+
# Converts hash and nil to an options object
|
1179
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1180
|
+
|
1181
|
+
# Customize the options with defaults
|
1182
|
+
metadata = @config.rpcs.generate_attached_cluster_agent_token.metadata.to_h
|
1183
|
+
|
1184
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
1185
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1186
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1187
|
+
gapic_version: ::Google::Cloud::GkeMultiCloud::V1::VERSION
|
1188
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1189
|
+
|
1190
|
+
header_params = {}
|
1191
|
+
if request.attached_cluster
|
1192
|
+
header_params["attached_cluster"] = request.attached_cluster
|
1193
|
+
end
|
1194
|
+
|
1195
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1196
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1197
|
+
|
1198
|
+
options.apply_defaults timeout: @config.rpcs.generate_attached_cluster_agent_token.timeout,
|
1199
|
+
metadata: metadata,
|
1200
|
+
retry_policy: @config.rpcs.generate_attached_cluster_agent_token.retry_policy
|
1201
|
+
|
1202
|
+
options.apply_defaults timeout: @config.timeout,
|
1203
|
+
metadata: @config.metadata,
|
1204
|
+
retry_policy: @config.retry_policy
|
1205
|
+
|
1206
|
+
@attached_clusters_stub.call_rpc :generate_attached_cluster_agent_token, request, options: options do |response, operation|
|
1207
|
+
yield response, operation if block_given?
|
1208
|
+
return response
|
1209
|
+
end
|
1210
|
+
rescue ::GRPC::BadStatus => e
|
1211
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1212
|
+
end
|
1213
|
+
|
1084
1214
|
##
|
1085
1215
|
# Configuration class for the AttachedClusters API.
|
1086
1216
|
#
|
@@ -1111,9 +1241,9 @@ module Google
|
|
1111
1241
|
# end
|
1112
1242
|
#
|
1113
1243
|
# @!attribute [rw] endpoint
|
1114
|
-
#
|
1115
|
-
#
|
1116
|
-
# @return [::String]
|
1244
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
1245
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
1246
|
+
# @return [::String,nil]
|
1117
1247
|
# @!attribute [rw] credentials
|
1118
1248
|
# Credentials to send with calls. You may provide any of the following types:
|
1119
1249
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -1159,13 +1289,20 @@ module Google
|
|
1159
1289
|
# @!attribute [rw] quota_project
|
1160
1290
|
# A separate project against which to charge quota.
|
1161
1291
|
# @return [::String]
|
1292
|
+
# @!attribute [rw] universe_domain
|
1293
|
+
# The universe domain within which to make requests. This determines the
|
1294
|
+
# default endpoint URL. The default value of nil uses the environment
|
1295
|
+
# universe (usually the default "googleapis.com" universe).
|
1296
|
+
# @return [::String,nil]
|
1162
1297
|
#
|
1163
1298
|
class Configuration
|
1164
1299
|
extend ::Gapic::Config
|
1165
1300
|
|
1301
|
+
# @private
|
1302
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
1166
1303
|
DEFAULT_ENDPOINT = "gkemulticloud.googleapis.com"
|
1167
1304
|
|
1168
|
-
config_attr :endpoint,
|
1305
|
+
config_attr :endpoint, nil, ::String, nil
|
1169
1306
|
config_attr :credentials, nil do |value|
|
1170
1307
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
1171
1308
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
@@ -1180,6 +1317,7 @@ module Google
|
|
1180
1317
|
config_attr :metadata, nil, ::Hash, nil
|
1181
1318
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1182
1319
|
config_attr :quota_project, nil, ::String, nil
|
1320
|
+
config_attr :universe_domain, nil, ::String, nil
|
1183
1321
|
|
1184
1322
|
# @private
|
1185
1323
|
def initialize parent_config = nil
|
@@ -1266,6 +1404,11 @@ module Google
|
|
1266
1404
|
# @return [::Gapic::Config::Method]
|
1267
1405
|
#
|
1268
1406
|
attr_reader :generate_attached_cluster_install_manifest
|
1407
|
+
##
|
1408
|
+
# RPC-specific configuration for `generate_attached_cluster_agent_token`
|
1409
|
+
# @return [::Gapic::Config::Method]
|
1410
|
+
#
|
1411
|
+
attr_reader :generate_attached_cluster_agent_token
|
1269
1412
|
|
1270
1413
|
# @private
|
1271
1414
|
def initialize parent_rpcs = nil
|
@@ -1285,6 +1428,8 @@ module Google
|
|
1285
1428
|
@get_attached_server_config = ::Gapic::Config::Method.new get_attached_server_config_config
|
1286
1429
|
generate_attached_cluster_install_manifest_config = parent_rpcs.generate_attached_cluster_install_manifest if parent_rpcs.respond_to? :generate_attached_cluster_install_manifest
|
1287
1430
|
@generate_attached_cluster_install_manifest = ::Gapic::Config::Method.new generate_attached_cluster_install_manifest_config
|
1431
|
+
generate_attached_cluster_agent_token_config = parent_rpcs.generate_attached_cluster_agent_token if parent_rpcs.respond_to? :generate_attached_cluster_agent_token
|
1432
|
+
@generate_attached_cluster_agent_token = ::Gapic::Config::Method.new generate_attached_cluster_agent_token_config
|
1288
1433
|
|
1289
1434
|
yield self if block_given?
|
1290
1435
|
end
|
@@ -26,6 +26,9 @@ module Google
|
|
26
26
|
module AttachedClusters
|
27
27
|
# Service that implements Longrunning Operations API.
|
28
28
|
class Operations
|
29
|
+
# @private
|
30
|
+
DEFAULT_ENDPOINT_TEMPLATE = "gkemulticloud.$UNIVERSE_DOMAIN$"
|
31
|
+
|
29
32
|
# @private
|
30
33
|
attr_reader :operations_stub
|
31
34
|
|
@@ -60,6 +63,15 @@ module Google
|
|
60
63
|
@config
|
61
64
|
end
|
62
65
|
|
66
|
+
##
|
67
|
+
# The effective universe domain
|
68
|
+
#
|
69
|
+
# @return [String]
|
70
|
+
#
|
71
|
+
def universe_domain
|
72
|
+
@operations_stub.universe_domain
|
73
|
+
end
|
74
|
+
|
63
75
|
##
|
64
76
|
# Create a new Operations client object.
|
65
77
|
#
|
@@ -90,8 +102,10 @@ module Google
|
|
90
102
|
|
91
103
|
@operations_stub = ::Gapic::ServiceStub.new(
|
92
104
|
::Google::Longrunning::Operations::Stub,
|
93
|
-
credentials:
|
94
|
-
endpoint:
|
105
|
+
credentials: credentials,
|
106
|
+
endpoint: @config.endpoint,
|
107
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
108
|
+
universe_domain: @config.universe_domain,
|
95
109
|
channel_args: @config.channel_args,
|
96
110
|
interceptors: @config.interceptors,
|
97
111
|
channel_pool_config: @config.channel_pool
|
@@ -613,9 +627,9 @@ module Google
|
|
613
627
|
# end
|
614
628
|
#
|
615
629
|
# @!attribute [rw] endpoint
|
616
|
-
#
|
617
|
-
#
|
618
|
-
# @return [::String]
|
630
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
631
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
632
|
+
# @return [::String,nil]
|
619
633
|
# @!attribute [rw] credentials
|
620
634
|
# Credentials to send with calls. You may provide any of the following types:
|
621
635
|
# * (`String`) The path to a service account key file in JSON format
|
@@ -661,13 +675,20 @@ module Google
|
|
661
675
|
# @!attribute [rw] quota_project
|
662
676
|
# A separate project against which to charge quota.
|
663
677
|
# @return [::String]
|
678
|
+
# @!attribute [rw] universe_domain
|
679
|
+
# The universe domain within which to make requests. This determines the
|
680
|
+
# default endpoint URL. The default value of nil uses the environment
|
681
|
+
# universe (usually the default "googleapis.com" universe).
|
682
|
+
# @return [::String,nil]
|
664
683
|
#
|
665
684
|
class Configuration
|
666
685
|
extend ::Gapic::Config
|
667
686
|
|
687
|
+
# @private
|
688
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
668
689
|
DEFAULT_ENDPOINT = "gkemulticloud.googleapis.com"
|
669
690
|
|
670
|
-
config_attr :endpoint,
|
691
|
+
config_attr :endpoint, nil, ::String, nil
|
671
692
|
config_attr :credentials, nil do |value|
|
672
693
|
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
673
694
|
allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
|
@@ -682,6 +703,7 @@ module Google
|
|
682
703
|
config_attr :metadata, nil, ::Hash, nil
|
683
704
|
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
684
705
|
config_attr :quota_project, nil, ::String, nil
|
706
|
+
config_attr :universe_domain, nil, ::String, nil
|
685
707
|
|
686
708
|
# @private
|
687
709
|
def initialize parent_config = nil
|