Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [gke-multi-cloud] added proxy support for Attached Clusters #10161

Merged
merged 2 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion java-gke-multi-cloud/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ Java is a registered trademark of Oracle and/or its affiliates.
[kokoro-badge-link-5]: http://storage.googleapis.com/cloud-devrel-public/java/badges/google-cloud-java/java11.html
[stability-image]: https://img.shields.io/badge/stability-preview-yellow
[maven-version-image]: https://img.shields.io/maven-central/v/com.google.cloud/google-cloud-gke-multi-cloud.svg
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-gke-multi-cloud/0.29.0
[maven-version-link]: https://central.sonatype.com/artifact/com.google.cloud/google-cloud-gke-multi-cloud/0.31.0
[authentication]: https://github.com/googleapis/google-cloud-java#authentication
[auth-scopes]: https://developers.google.com/identity/protocols/oauth2/scopes
[predefined-iam-roles]: https://cloud.google.com/iam/docs/understanding-roles#predefined_roles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,9 +453,11 @@ public final OperationFuture<AttachedCluster, OperationMetadata> createAttachedC
* @param updateMask Required. Mask of fields to update. At least one path must be supplied in
* this field. The elements of the repeated paths field can only include these fields from
* [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster]:
* <p>&#42; `description`. &#42; `annotations`. &#42; `platform_version`. &#42;
* `authorization.admin_users`. &#42; `logging_config.component_config.enable_components`.
* &#42; `monitoring_config.managed_prometheus_config.enabled`.
* <p>&#42; `annotations`. &#42; `authorization.admin_groups`. &#42;
* `authorization.admin_users`. &#42; `binary_authorization.evaluation_mode`. &#42;
* `description`. &#42; `logging_config.component_config.enable_components`. &#42;
* `monitoring_config.managed_prometheus_config.enabled`. &#42; `platform_version`. &#42;
* `proxy_config.kubernetes_secret.name`. &#42; `proxy_config.kubernetes_secret.namespace`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture<AttachedCluster, OperationMetadata> updateAttachedClusterAsync(
Expand Down Expand Up @@ -681,6 +683,7 @@ public final OperationFuture<AttachedCluster, OperationMetadata> importAttachedC
* .setFleetMembership("fleetMembership-665479228")
* .setPlatformVersion("platformVersion1848800485")
* .setDistribution("distribution-1580708220")
* .setProxyConfig(AttachedProxyConfig.newBuilder().build())
* .build();
* AttachedCluster response = attachedClustersClient.importAttachedClusterAsync(request).get();
* }
Expand Down Expand Up @@ -722,6 +725,7 @@ public final OperationFuture<AttachedCluster, OperationMetadata> importAttachedC
* .setFleetMembership("fleetMembership-665479228")
* .setPlatformVersion("platformVersion1848800485")
* .setDistribution("distribution-1580708220")
* .setProxyConfig(AttachedProxyConfig.newBuilder().build())
* .build();
* OperationFuture<AttachedCluster, OperationMetadata> future =
* attachedClustersClient.importAttachedClusterOperationCallable().futureCall(request);
Expand Down Expand Up @@ -763,6 +767,7 @@ public final OperationFuture<AttachedCluster, OperationMetadata> importAttachedC
* .setFleetMembership("fleetMembership-665479228")
* .setPlatformVersion("platformVersion1848800485")
* .setDistribution("distribution-1580708220")
* .setProxyConfig(AttachedProxyConfig.newBuilder().build())
* .build();
* ApiFuture<Operation> future =
* attachedClustersClient.importAttachedClusterCallable().futureCall(request);
Expand Down Expand Up @@ -1519,6 +1524,7 @@ public final AttachedServerConfig getAttachedServerConfig(
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setAttachedClusterId("attachedClusterId865943409")
* .setPlatformVersion("platformVersion1848800485")
* .setProxyConfig(AttachedProxyConfig.newBuilder().build())
* .build();
* GenerateAttachedClusterInstallManifestResponse response =
* attachedClustersClient.generateAttachedClusterInstallManifest(request);
Expand Down Expand Up @@ -1552,6 +1558,7 @@ public final AttachedServerConfig getAttachedServerConfig(
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setAttachedClusterId("attachedClusterId865943409")
* .setPlatformVersion("platformVersion1848800485")
* .setProxyConfig(AttachedProxyConfig.newBuilder().build())
* .build();
* ApiFuture<GenerateAttachedClusterInstallManifestResponse> future =
* attachedClustersClient
Expand All @@ -1569,6 +1576,86 @@ public final AttachedServerConfig getAttachedServerConfig(
return stub.generateAttachedClusterInstallManifestCallable();
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Generates an access token for a cluster agent.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (AttachedClustersClient attachedClustersClient = AttachedClustersClient.create()) {
* GenerateAttachedClusterAgentTokenRequest request =
* GenerateAttachedClusterAgentTokenRequest.newBuilder()
* .setAttachedCluster(
* AttachedClusterName.of("[PROJECT]", "[LOCATION]", "[ATTACHED_CLUSTER]")
* .toString())
* .setSubjectToken("subjectToken-1519661011")
* .setSubjectTokenType("subjectTokenType1839592711")
* .setVersion("version351608024")
* .setGrantType("grantType-1219832202")
* .setAudience("audience975628804")
* .setScope("scope109264468")
* .setRequestedTokenType("requestedTokenType1733106949")
* .setOptions("options-1249474914")
* .build();
* GenerateAttachedClusterAgentTokenResponse response =
* attachedClustersClient.generateAttachedClusterAgentToken(request);
* }
* }</pre>
*
* @param request The request object containing all of the parameters for the API call.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final GenerateAttachedClusterAgentTokenResponse generateAttachedClusterAgentToken(
GenerateAttachedClusterAgentTokenRequest request) {
return generateAttachedClusterAgentTokenCallable().call(request);
}

// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Generates an access token for a cluster agent.
*
* <p>Sample code:
*
* <pre>{@code
* // This snippet has been automatically generated and should be regarded as a code template only.
* // It will require modifications to work:
* // - It may require correct/in-range values for request initialization.
* // - It may require specifying regional endpoints when creating the service client as shown in
* // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
* try (AttachedClustersClient attachedClustersClient = AttachedClustersClient.create()) {
* GenerateAttachedClusterAgentTokenRequest request =
* GenerateAttachedClusterAgentTokenRequest.newBuilder()
* .setAttachedCluster(
* AttachedClusterName.of("[PROJECT]", "[LOCATION]", "[ATTACHED_CLUSTER]")
* .toString())
* .setSubjectToken("subjectToken-1519661011")
* .setSubjectTokenType("subjectTokenType1839592711")
* .setVersion("version351608024")
* .setGrantType("grantType-1219832202")
* .setAudience("audience975628804")
* .setScope("scope109264468")
* .setRequestedTokenType("requestedTokenType1733106949")
* .setOptions("options-1249474914")
* .build();
* ApiFuture<GenerateAttachedClusterAgentTokenResponse> future =
* attachedClustersClient.generateAttachedClusterAgentTokenCallable().futureCall(request);
* // Do something.
* GenerateAttachedClusterAgentTokenResponse response = future.get();
* }
* }</pre>
*/
public final UnaryCallable<
GenerateAttachedClusterAgentTokenRequest, GenerateAttachedClusterAgentTokenResponse>
generateAttachedClusterAgentTokenCallable() {
return stub.generateAttachedClusterAgentTokenCallable();
}

@Override
public final void close() {
stub.close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,14 @@ public class AttachedClustersSettings extends ClientSettings<AttachedClustersSet
.generateAttachedClusterInstallManifestSettings();
}

/** Returns the object with the settings used for calls to generateAttachedClusterAgentToken. */
public UnaryCallSettings<
GenerateAttachedClusterAgentTokenRequest, GenerateAttachedClusterAgentTokenResponse>
generateAttachedClusterAgentTokenSettings() {
return ((AttachedClustersStubSettings) getStubSettings())
.generateAttachedClusterAgentTokenSettings();
}

public static final AttachedClustersSettings create(AttachedClustersStubSettings stub)
throws IOException {
return new AttachedClustersSettings.Builder(stub.toBuilder()).build();
Expand Down Expand Up @@ -360,6 +368,13 @@ public Builder applyToAllUnaryMethods(
return getStubSettingsBuilder().generateAttachedClusterInstallManifestSettings();
}

/** Returns the builder for the settings used for calls to generateAttachedClusterAgentToken. */
public UnaryCallSettings.Builder<
GenerateAttachedClusterAgentTokenRequest, GenerateAttachedClusterAgentTokenResponse>
generateAttachedClusterAgentTokenSettings() {
return getStubSettingsBuilder().generateAttachedClusterAgentTokenSettings();
}

@Override
public AttachedClustersSettings build() throws IOException {
return new AttachedClustersSettings(this);
Expand Down
Loading
Loading