com.google.cloud.gkemulticloud.v1.AttachedClustersClient Maven / Gradle / Ivy
Show all versions of google-cloud-gke-multi-cloud Show documentation
/*
* Copyright 2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.cloud.gkemulticloud.v1;
import com.google.api.core.ApiFuture;
import com.google.api.core.ApiFutures;
import com.google.api.core.BetaApi;
import com.google.api.gax.core.BackgroundResource;
import com.google.api.gax.httpjson.longrunning.OperationsClient;
import com.google.api.gax.longrunning.OperationFuture;
import com.google.api.gax.paging.AbstractFixedSizeCollection;
import com.google.api.gax.paging.AbstractPage;
import com.google.api.gax.paging.AbstractPagedListResponse;
import com.google.api.gax.rpc.OperationCallable;
import com.google.api.gax.rpc.PageContext;
import com.google.api.gax.rpc.UnaryCallable;
import com.google.cloud.gkemulticloud.v1.stub.AttachedClustersStub;
import com.google.cloud.gkemulticloud.v1.stub.AttachedClustersStubSettings;
import com.google.common.util.concurrent.MoreExecutors;
import com.google.longrunning.Operation;
import com.google.protobuf.Empty;
import com.google.protobuf.FieldMask;
import java.io.IOException;
import java.util.List;
import java.util.concurrent.TimeUnit;
import javax.annotation.Generated;
// AUTO-GENERATED DOCUMENTATION AND CLASS.
/**
* Service Description: The AttachedClusters API provides a single centrally managed service to
* register and manage Anthos attached clusters that run on customer's owned infrastructure.
*
* This class provides the ability to make remote calls to the backing service through method
* calls that map to API methods. Sample code to get started:
*
*
{@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()) {
* AttachedClusterName name =
* AttachedClusterName.of("[PROJECT]", "[LOCATION]", "[ATTACHED_CLUSTER]");
* AttachedCluster response = attachedClustersClient.getAttachedCluster(name);
* }
* }
*
* Note: close() needs to be called on the AttachedClustersClient object to clean up resources
* such as threads. In the example above, try-with-resources is used, which automatically calls
* close().
*
*
* Methods
*
* Method
* Description
* Method Variants
*
*
* CreateAttachedCluster
* Creates a new [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource on a given Google Cloud Platform project and region.
*
If successful, the response contains a newly created [Operation][google.longrunning.Operation] resource that can be described to track the status of the operation.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* createAttachedClusterAsync(CreateAttachedClusterRequest request)
*
* Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
*
* createAttachedClusterAsync(LocationName parent, AttachedCluster attachedCluster, String attachedClusterId)
*
createAttachedClusterAsync(String parent, AttachedCluster attachedCluster, String attachedClusterId)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* createAttachedClusterOperationCallable()
*
createAttachedClusterCallable()
*
*
*
*
* UpdateAttachedCluster
* Updates an [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster].
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* updateAttachedClusterAsync(UpdateAttachedClusterRequest request)
*
* Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
*
* updateAttachedClusterAsync(AttachedCluster attachedCluster, FieldMask updateMask)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* updateAttachedClusterOperationCallable()
*
updateAttachedClusterCallable()
*
*
*
*
* ImportAttachedCluster
* Imports creates a new [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource by importing an existing Fleet Membership resource.
*
Attached Clusters created before the introduction of the Anthos Multi-Cloud API can be imported through this method.
*
If successful, the response contains a newly created [Operation][google.longrunning.Operation] resource that can be described to track the status of the operation.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* importAttachedClusterAsync(ImportAttachedClusterRequest request)
*
* Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
*
* importAttachedClusterAsync(LocationName parent, String fleetMembership)
*
importAttachedClusterAsync(String parent, String fleetMembership)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* importAttachedClusterOperationCallable()
*
importAttachedClusterCallable()
*
*
*
*
* GetAttachedCluster
* Describes a specific [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* getAttachedCluster(GetAttachedClusterRequest request)
*
* "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
*
* getAttachedCluster(AttachedClusterName name)
*
getAttachedCluster(String name)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* getAttachedClusterCallable()
*
*
*
*
* ListAttachedClusters
* Lists all [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resources on a given Google Cloud project and region.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* listAttachedClusters(ListAttachedClustersRequest request)
*
* "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
*
* listAttachedClusters(LocationName parent)
*
listAttachedClusters(String parent)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* listAttachedClustersPagedCallable()
*
listAttachedClustersCallable()
*
*
*
*
* DeleteAttachedCluster
* Deletes a specific [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource.
*
If successful, the response contains a newly created [Operation][google.longrunning.Operation] resource that can be described to track the status of the operation.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* deleteAttachedClusterAsync(DeleteAttachedClusterRequest request)
*
* Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
*
* deleteAttachedClusterAsync(AttachedClusterName name)
*
deleteAttachedClusterAsync(String name)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* deleteAttachedClusterOperationCallable()
*
deleteAttachedClusterCallable()
*
*
*
*
* GetAttachedServerConfig
* Returns information, such as supported Kubernetes versions, on a given Google Cloud location.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* getAttachedServerConfig(GetAttachedServerConfigRequest request)
*
* "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
*
* getAttachedServerConfig(AttachedServerConfigName name)
*
getAttachedServerConfig(String name)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* getAttachedServerConfigCallable()
*
*
*
*
* GenerateAttachedClusterInstallManifest
* Generates the install manifest to be installed on the target cluster.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* generateAttachedClusterInstallManifest(GenerateAttachedClusterInstallManifestRequest request)
*
* "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
*
* generateAttachedClusterInstallManifest(LocationName parent, String attachedClusterId)
*
generateAttachedClusterInstallManifest(String parent, String attachedClusterId)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* generateAttachedClusterInstallManifestCallable()
*
*
*
*
* GenerateAttachedClusterAgentToken
* Generates an access token for a cluster agent.
*
* Request object method variants only take one parameter, a request object, which must be constructed before the call.
*
* generateAttachedClusterAgentToken(GenerateAttachedClusterAgentTokenRequest request)
*
* Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
*
* generateAttachedClusterAgentTokenCallable()
*
*
*
*
*
* See the individual methods for example code.
*
*
Many parameters require resource names to be formatted in a particular way. To assist with
* these names, this class includes a format method for each type of name, and additionally a parse
* method to extract the individual identifiers contained within names that are returned.
*
*
This class can be customized by passing in a custom instance of AttachedClustersSettings to
* create(). For example:
*
*
To customize credentials:
*
*
{@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
* AttachedClustersSettings attachedClustersSettings =
* AttachedClustersSettings.newBuilder()
* .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
* .build();
* AttachedClustersClient attachedClustersClient =
* AttachedClustersClient.create(attachedClustersSettings);
* }
*
* To customize the endpoint:
*
*
{@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
* AttachedClustersSettings attachedClustersSettings =
* AttachedClustersSettings.newBuilder().setEndpoint(myEndpoint).build();
* AttachedClustersClient attachedClustersClient =
* AttachedClustersClient.create(attachedClustersSettings);
* }
*
* To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over
* the wire:
*
*
{@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
* AttachedClustersSettings attachedClustersSettings =
* AttachedClustersSettings.newHttpJsonBuilder().build();
* AttachedClustersClient attachedClustersClient =
* AttachedClustersClient.create(attachedClustersSettings);
* }
*
* Please refer to the GitHub repository's samples for more quickstart code snippets.
*/
@Generated("by gapic-generator-java")
public class AttachedClustersClient implements BackgroundResource {
private final AttachedClustersSettings settings;
private final AttachedClustersStub stub;
private final OperationsClient httpJsonOperationsClient;
private final com.google.longrunning.OperationsClient operationsClient;
/** Constructs an instance of AttachedClustersClient with default settings. */
public static final AttachedClustersClient create() throws IOException {
return create(AttachedClustersSettings.newBuilder().build());
}
/**
* Constructs an instance of AttachedClustersClient, using the given settings. The channels are
* created based on the settings passed in, or defaults for any settings that are not set.
*/
public static final AttachedClustersClient create(AttachedClustersSettings settings)
throws IOException {
return new AttachedClustersClient(settings);
}
/**
* Constructs an instance of AttachedClustersClient, using the given stub for making calls. This
* is for advanced usage - prefer using create(AttachedClustersSettings).
*/
public static final AttachedClustersClient create(AttachedClustersStub stub) {
return new AttachedClustersClient(stub);
}
/**
* Constructs an instance of AttachedClustersClient, using the given settings. This is protected
* so that it is easy to make a subclass, but otherwise, the static factory methods should be
* preferred.
*/
protected AttachedClustersClient(AttachedClustersSettings settings) throws IOException {
this.settings = settings;
this.stub = ((AttachedClustersStubSettings) settings.getStubSettings()).createStub();
this.operationsClient =
com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
}
protected AttachedClustersClient(AttachedClustersStub stub) {
this.settings = null;
this.stub = stub;
this.operationsClient =
com.google.longrunning.OperationsClient.create(this.stub.getOperationsStub());
this.httpJsonOperationsClient = OperationsClient.create(this.stub.getHttpJsonOperationsStub());
}
public final AttachedClustersSettings getSettings() {
return settings;
}
public AttachedClustersStub getStub() {
return stub;
}
/**
* Returns the OperationsClient that can be used to query the status of a long-running operation
* returned by another API method call.
*/
public final com.google.longrunning.OperationsClient getOperationsClient() {
return operationsClient;
}
/**
* Returns the OperationsClient that can be used to query the status of a long-running operation
* returned by another API method call.
*/
@BetaApi
public final OperationsClient getHttpJsonOperationsClient() {
return httpJsonOperationsClient;
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a new [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource on a
* given Google Cloud Platform project and region.
*
*
If successful, the response contains a newly created
* [Operation][google.longrunning.Operation] resource that can be described to track the status of
* the operation.
*
*
Sample code:
*
*
{@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()) {
* LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
* AttachedCluster attachedCluster = AttachedCluster.newBuilder().build();
* String attachedClusterId = "attachedClusterId865943409";
* AttachedCluster response =
* attachedClustersClient
* .createAttachedClusterAsync(parent, attachedCluster, attachedClusterId)
* .get();
* }
* }
*
* @param parent Required. The parent location where this
* [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource will be created.
* Location names are formatted as `projects/<project-id>/locations/<region>`.
*
See [Resource Names](https://cloud.google.com/apis/design/resource_names) for more
* details on Google Cloud resource names.
* @param attachedCluster Required. The specification of the
* [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] to create.
* @param attachedClusterId Required. A client provided ID the resource. Must be unique within the
* parent resource.
*
The provided ID will be part of the
* [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource name formatted as
* `projects/<project-id>/locations/<region>/attachedClusters/<cluster-id>`.
*
Valid characters are `/[a-z][0-9]-/`. Cannot be longer than 63 characters.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture createAttachedClusterAsync(
LocationName parent, AttachedCluster attachedCluster, String attachedClusterId) {
CreateAttachedClusterRequest request =
CreateAttachedClusterRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.setAttachedCluster(attachedCluster)
.setAttachedClusterId(attachedClusterId)
.build();
return createAttachedClusterAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a new [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource on a
* given Google Cloud Platform project and region.
*
* If successful, the response contains a newly created
* [Operation][google.longrunning.Operation] resource that can be described to track the status of
* the operation.
*
*
Sample code:
*
*
{@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()) {
* String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
* AttachedCluster attachedCluster = AttachedCluster.newBuilder().build();
* String attachedClusterId = "attachedClusterId865943409";
* AttachedCluster response =
* attachedClustersClient
* .createAttachedClusterAsync(parent, attachedCluster, attachedClusterId)
* .get();
* }
* }
*
* @param parent Required. The parent location where this
* [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource will be created.
* Location names are formatted as `projects/<project-id>/locations/<region>`.
*
See [Resource Names](https://cloud.google.com/apis/design/resource_names) for more
* details on Google Cloud resource names.
* @param attachedCluster Required. The specification of the
* [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] to create.
* @param attachedClusterId Required. A client provided ID the resource. Must be unique within the
* parent resource.
*
The provided ID will be part of the
* [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource name formatted as
* `projects/<project-id>/locations/<region>/attachedClusters/<cluster-id>`.
*
Valid characters are `/[a-z][0-9]-/`. Cannot be longer than 63 characters.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture createAttachedClusterAsync(
String parent, AttachedCluster attachedCluster, String attachedClusterId) {
CreateAttachedClusterRequest request =
CreateAttachedClusterRequest.newBuilder()
.setParent(parent)
.setAttachedCluster(attachedCluster)
.setAttachedClusterId(attachedClusterId)
.build();
return createAttachedClusterAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a new [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource on a
* given Google Cloud Platform project and region.
*
* If successful, the response contains a newly created
* [Operation][google.longrunning.Operation] resource that can be described to track the status of
* the operation.
*
*
Sample code:
*
*
{@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()) {
* CreateAttachedClusterRequest request =
* CreateAttachedClusterRequest.newBuilder()
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setAttachedCluster(AttachedCluster.newBuilder().build())
* .setAttachedClusterId("attachedClusterId865943409")
* .setValidateOnly(true)
* .build();
* AttachedCluster response = attachedClustersClient.createAttachedClusterAsync(request).get();
* }
* }
*
* @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 OperationFuture createAttachedClusterAsync(
CreateAttachedClusterRequest request) {
return createAttachedClusterOperationCallable().futureCall(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a new [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource on a
* given Google Cloud Platform project and region.
*
* If successful, the response contains a newly created
* [Operation][google.longrunning.Operation] resource that can be described to track the status of
* the operation.
*
*
Sample code:
*
*
{@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()) {
* CreateAttachedClusterRequest request =
* CreateAttachedClusterRequest.newBuilder()
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setAttachedCluster(AttachedCluster.newBuilder().build())
* .setAttachedClusterId("attachedClusterId865943409")
* .setValidateOnly(true)
* .build();
* OperationFuture future =
* attachedClustersClient.createAttachedClusterOperationCallable().futureCall(request);
* // Do something.
* AttachedCluster response = future.get();
* }
* }
*/
public final OperationCallable
createAttachedClusterOperationCallable() {
return stub.createAttachedClusterOperationCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Creates a new [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource on a
* given Google Cloud Platform project and region.
*
* If successful, the response contains a newly created
* [Operation][google.longrunning.Operation] resource that can be described to track the status of
* the operation.
*
*
Sample code:
*
*
{@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()) {
* CreateAttachedClusterRequest request =
* CreateAttachedClusterRequest.newBuilder()
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setAttachedCluster(AttachedCluster.newBuilder().build())
* .setAttachedClusterId("attachedClusterId865943409")
* .setValidateOnly(true)
* .build();
* ApiFuture future =
* attachedClustersClient.createAttachedClusterCallable().futureCall(request);
* // Do something.
* Operation response = future.get();
* }
* }
*/
public final UnaryCallable
createAttachedClusterCallable() {
return stub.createAttachedClusterCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates an [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster].
*
* Sample code:
*
*
{@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()) {
* AttachedCluster attachedCluster = AttachedCluster.newBuilder().build();
* FieldMask updateMask = FieldMask.newBuilder().build();
* AttachedCluster response =
* attachedClustersClient.updateAttachedClusterAsync(attachedCluster, updateMask).get();
* }
* }
*
* @param attachedCluster Required. The
* [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource to update.
* @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]:
* * `annotations`. * `authorization.admin_groups`. *
* `authorization.admin_users`. * `binary_authorization.evaluation_mode`. *
* `description`. * `logging_config.component_config.enable_components`. *
* `monitoring_config.managed_prometheus_config.enabled`. * `platform_version`. *
* `proxy_config.kubernetes_secret.name`. * `proxy_config.kubernetes_secret.namespace`.
* * `security_posture_config.vulnerability_mode`
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture updateAttachedClusterAsync(
AttachedCluster attachedCluster, FieldMask updateMask) {
UpdateAttachedClusterRequest request =
UpdateAttachedClusterRequest.newBuilder()
.setAttachedCluster(attachedCluster)
.setUpdateMask(updateMask)
.build();
return updateAttachedClusterAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates an [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster].
*
* Sample code:
*
*
{@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()) {
* UpdateAttachedClusterRequest request =
* UpdateAttachedClusterRequest.newBuilder()
* .setAttachedCluster(AttachedCluster.newBuilder().build())
* .setValidateOnly(true)
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
* AttachedCluster response = attachedClustersClient.updateAttachedClusterAsync(request).get();
* }
* }
*
* @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 OperationFuture updateAttachedClusterAsync(
UpdateAttachedClusterRequest request) {
return updateAttachedClusterOperationCallable().futureCall(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates an [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster].
*
* Sample code:
*
*
{@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()) {
* UpdateAttachedClusterRequest request =
* UpdateAttachedClusterRequest.newBuilder()
* .setAttachedCluster(AttachedCluster.newBuilder().build())
* .setValidateOnly(true)
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
* OperationFuture future =
* attachedClustersClient.updateAttachedClusterOperationCallable().futureCall(request);
* // Do something.
* AttachedCluster response = future.get();
* }
* }
*/
public final OperationCallable
updateAttachedClusterOperationCallable() {
return stub.updateAttachedClusterOperationCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Updates an [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster].
*
* Sample code:
*
*
{@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()) {
* UpdateAttachedClusterRequest request =
* UpdateAttachedClusterRequest.newBuilder()
* .setAttachedCluster(AttachedCluster.newBuilder().build())
* .setValidateOnly(true)
* .setUpdateMask(FieldMask.newBuilder().build())
* .build();
* ApiFuture future =
* attachedClustersClient.updateAttachedClusterCallable().futureCall(request);
* // Do something.
* Operation response = future.get();
* }
* }
*/
public final UnaryCallable
updateAttachedClusterCallable() {
return stub.updateAttachedClusterCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Imports creates a new [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource
* by importing an existing Fleet Membership resource.
*
* Attached Clusters created before the introduction of the Anthos Multi-Cloud API can be
* imported through this method.
*
*
If successful, the response contains a newly created
* [Operation][google.longrunning.Operation] resource that can be described to track the status of
* the operation.
*
*
Sample code:
*
*
{@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()) {
* LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
* String fleetMembership = "fleetMembership-665479228";
* AttachedCluster response =
* attachedClustersClient.importAttachedClusterAsync(parent, fleetMembership).get();
* }
* }
*
* @param parent Required. The parent location where this
* [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource will be created.
* Location names are formatted as `projects/<project-id>/locations/<region>`.
*
See [Resource Names](https://cloud.google.com/apis/design/resource_names) for more
* details on Google Cloud resource names.
* @param fleetMembership Required. The name of the fleet membership resource to import.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture importAttachedClusterAsync(
LocationName parent, String fleetMembership) {
ImportAttachedClusterRequest request =
ImportAttachedClusterRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.setFleetMembership(fleetMembership)
.build();
return importAttachedClusterAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Imports creates a new [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource
* by importing an existing Fleet Membership resource.
*
* Attached Clusters created before the introduction of the Anthos Multi-Cloud API can be
* imported through this method.
*
*
If successful, the response contains a newly created
* [Operation][google.longrunning.Operation] resource that can be described to track the status of
* the operation.
*
*
Sample code:
*
*
{@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()) {
* String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
* String fleetMembership = "fleetMembership-665479228";
* AttachedCluster response =
* attachedClustersClient.importAttachedClusterAsync(parent, fleetMembership).get();
* }
* }
*
* @param parent Required. The parent location where this
* [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource will be created.
* Location names are formatted as `projects/<project-id>/locations/<region>`.
*
See [Resource Names](https://cloud.google.com/apis/design/resource_names) for more
* details on Google Cloud resource names.
* @param fleetMembership Required. The name of the fleet membership resource to import.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture importAttachedClusterAsync(
String parent, String fleetMembership) {
ImportAttachedClusterRequest request =
ImportAttachedClusterRequest.newBuilder()
.setParent(parent)
.setFleetMembership(fleetMembership)
.build();
return importAttachedClusterAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Imports creates a new [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource
* by importing an existing Fleet Membership resource.
*
* Attached Clusters created before the introduction of the Anthos Multi-Cloud API can be
* imported through this method.
*
*
If successful, the response contains a newly created
* [Operation][google.longrunning.Operation] resource that can be described to track the status of
* the operation.
*
*
Sample code:
*
*
{@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()) {
* ImportAttachedClusterRequest request =
* ImportAttachedClusterRequest.newBuilder()
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setValidateOnly(true)
* .setFleetMembership("fleetMembership-665479228")
* .setPlatformVersion("platformVersion1848800485")
* .setDistribution("distribution-1580708220")
* .setProxyConfig(AttachedProxyConfig.newBuilder().build())
* .build();
* AttachedCluster response = attachedClustersClient.importAttachedClusterAsync(request).get();
* }
* }
*
* @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 OperationFuture importAttachedClusterAsync(
ImportAttachedClusterRequest request) {
return importAttachedClusterOperationCallable().futureCall(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Imports creates a new [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource
* by importing an existing Fleet Membership resource.
*
* Attached Clusters created before the introduction of the Anthos Multi-Cloud API can be
* imported through this method.
*
*
If successful, the response contains a newly created
* [Operation][google.longrunning.Operation] resource that can be described to track the status of
* the operation.
*
*
Sample code:
*
*
{@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()) {
* ImportAttachedClusterRequest request =
* ImportAttachedClusterRequest.newBuilder()
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setValidateOnly(true)
* .setFleetMembership("fleetMembership-665479228")
* .setPlatformVersion("platformVersion1848800485")
* .setDistribution("distribution-1580708220")
* .setProxyConfig(AttachedProxyConfig.newBuilder().build())
* .build();
* OperationFuture future =
* attachedClustersClient.importAttachedClusterOperationCallable().futureCall(request);
* // Do something.
* AttachedCluster response = future.get();
* }
* }
*/
public final OperationCallable
importAttachedClusterOperationCallable() {
return stub.importAttachedClusterOperationCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Imports creates a new [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource
* by importing an existing Fleet Membership resource.
*
* Attached Clusters created before the introduction of the Anthos Multi-Cloud API can be
* imported through this method.
*
*
If successful, the response contains a newly created
* [Operation][google.longrunning.Operation] resource that can be described to track the status of
* the operation.
*
*
Sample code:
*
*
{@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()) {
* ImportAttachedClusterRequest request =
* ImportAttachedClusterRequest.newBuilder()
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setValidateOnly(true)
* .setFleetMembership("fleetMembership-665479228")
* .setPlatformVersion("platformVersion1848800485")
* .setDistribution("distribution-1580708220")
* .setProxyConfig(AttachedProxyConfig.newBuilder().build())
* .build();
* ApiFuture future =
* attachedClustersClient.importAttachedClusterCallable().futureCall(request);
* // Do something.
* Operation response = future.get();
* }
* }
*/
public final UnaryCallable
importAttachedClusterCallable() {
return stub.importAttachedClusterCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Describes a specific [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource.
*
* Sample code:
*
*
{@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()) {
* AttachedClusterName name =
* AttachedClusterName.of("[PROJECT]", "[LOCATION]", "[ATTACHED_CLUSTER]");
* AttachedCluster response = attachedClustersClient.getAttachedCluster(name);
* }
* }
*
* @param name Required. The name of the
* [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource to describe.
* `AttachedCluster` names are formatted as
* `projects/<project-id>/locations/<region>/attachedClusters/<cluster-id>`.
*
See [Resource Names](https://cloud.google.com/apis/design/resource_names) for more
* details on Google Cloud Platform resource names.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final AttachedCluster getAttachedCluster(AttachedClusterName name) {
GetAttachedClusterRequest request =
GetAttachedClusterRequest.newBuilder()
.setName(name == null ? null : name.toString())
.build();
return getAttachedCluster(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Describes a specific [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource.
*
*
Sample code:
*
*
{@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()) {
* String name =
* AttachedClusterName.of("[PROJECT]", "[LOCATION]", "[ATTACHED_CLUSTER]").toString();
* AttachedCluster response = attachedClustersClient.getAttachedCluster(name);
* }
* }
*
* @param name Required. The name of the
* [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource to describe.
* `AttachedCluster` names are formatted as
* `projects/<project-id>/locations/<region>/attachedClusters/<cluster-id>`.
*
See [Resource Names](https://cloud.google.com/apis/design/resource_names) for more
* details on Google Cloud Platform resource names.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final AttachedCluster getAttachedCluster(String name) {
GetAttachedClusterRequest request =
GetAttachedClusterRequest.newBuilder().setName(name).build();
return getAttachedCluster(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Describes a specific [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource.
*
*
Sample code:
*
*
{@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()) {
* GetAttachedClusterRequest request =
* GetAttachedClusterRequest.newBuilder()
* .setName(
* AttachedClusterName.of("[PROJECT]", "[LOCATION]", "[ATTACHED_CLUSTER]")
* .toString())
* .build();
* AttachedCluster response = attachedClustersClient.getAttachedCluster(request);
* }
* }
*
* @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 AttachedCluster getAttachedCluster(GetAttachedClusterRequest request) {
return getAttachedClusterCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Describes a specific [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource.
*
* Sample code:
*
*
{@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()) {
* GetAttachedClusterRequest request =
* GetAttachedClusterRequest.newBuilder()
* .setName(
* AttachedClusterName.of("[PROJECT]", "[LOCATION]", "[ATTACHED_CLUSTER]")
* .toString())
* .build();
* ApiFuture future =
* attachedClustersClient.getAttachedClusterCallable().futureCall(request);
* // Do something.
* AttachedCluster response = future.get();
* }
* }
*/
public final UnaryCallable
getAttachedClusterCallable() {
return stub.getAttachedClusterCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists all [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resources on a given
* Google Cloud project and region.
*
* Sample code:
*
*
{@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()) {
* LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
* for (AttachedCluster element :
* attachedClustersClient.listAttachedClusters(parent).iterateAll()) {
* // doThingsWith(element);
* }
* }
* }
*
* @param parent Required. The parent location which owns this collection of
* [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resources.
* Location names are formatted as `projects/<project-id>/locations/<region>`.
*
See [Resource Names](https://cloud.google.com/apis/design/resource_names) for more
* details on Google Cloud Platform resource names.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListAttachedClustersPagedResponse listAttachedClusters(LocationName parent) {
ListAttachedClustersRequest request =
ListAttachedClustersRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.build();
return listAttachedClusters(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists all [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resources on a given
* Google Cloud project and region.
*
*
Sample code:
*
*
{@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()) {
* String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
* for (AttachedCluster element :
* attachedClustersClient.listAttachedClusters(parent).iterateAll()) {
* // doThingsWith(element);
* }
* }
* }
*
* @param parent Required. The parent location which owns this collection of
* [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resources.
* Location names are formatted as `projects/<project-id>/locations/<region>`.
*
See [Resource Names](https://cloud.google.com/apis/design/resource_names) for more
* details on Google Cloud Platform resource names.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final ListAttachedClustersPagedResponse listAttachedClusters(String parent) {
ListAttachedClustersRequest request =
ListAttachedClustersRequest.newBuilder().setParent(parent).build();
return listAttachedClusters(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists all [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resources on a given
* Google Cloud project and region.
*
*
Sample code:
*
*
{@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()) {
* ListAttachedClustersRequest request =
* ListAttachedClustersRequest.newBuilder()
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
* for (AttachedCluster element :
* attachedClustersClient.listAttachedClusters(request).iterateAll()) {
* // doThingsWith(element);
* }
* }
* }
*
* @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 ListAttachedClustersPagedResponse listAttachedClusters(
ListAttachedClustersRequest request) {
return listAttachedClustersPagedCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists all [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resources on a given
* Google Cloud project and region.
*
* Sample code:
*
*
{@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()) {
* ListAttachedClustersRequest request =
* ListAttachedClustersRequest.newBuilder()
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
* ApiFuture future =
* attachedClustersClient.listAttachedClustersPagedCallable().futureCall(request);
* // Do something.
* for (AttachedCluster element : future.get().iterateAll()) {
* // doThingsWith(element);
* }
* }
* }
*/
public final UnaryCallable
listAttachedClustersPagedCallable() {
return stub.listAttachedClustersPagedCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Lists all [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resources on a given
* Google Cloud project and region.
*
* Sample code:
*
*
{@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()) {
* ListAttachedClustersRequest request =
* ListAttachedClustersRequest.newBuilder()
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setPageSize(883849137)
* .setPageToken("pageToken873572522")
* .build();
* while (true) {
* ListAttachedClustersResponse response =
* attachedClustersClient.listAttachedClustersCallable().call(request);
* for (AttachedCluster element : response.getAttachedClustersList()) {
* // doThingsWith(element);
* }
* String nextPageToken = response.getNextPageToken();
* if (!Strings.isNullOrEmpty(nextPageToken)) {
* request = request.toBuilder().setPageToken(nextPageToken).build();
* } else {
* break;
* }
* }
* }
* }
*/
public final UnaryCallable
listAttachedClustersCallable() {
return stub.listAttachedClustersCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a specific [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource.
*
* If successful, the response contains a newly created
* [Operation][google.longrunning.Operation] resource that can be described to track the status of
* the operation.
*
*
Sample code:
*
*
{@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()) {
* AttachedClusterName name =
* AttachedClusterName.of("[PROJECT]", "[LOCATION]", "[ATTACHED_CLUSTER]");
* attachedClustersClient.deleteAttachedClusterAsync(name).get();
* }
* }
*
* @param name Required. The resource name the
* [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] to delete.
* `AttachedCluster` names are formatted as
* `projects/<project-id>/locations/<region>/attachedClusters/<cluster-id>`.
*
See [Resource Names](https://cloud.google.com/apis/design/resource_names) for more
* details on Google Cloud Platform resource names.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture deleteAttachedClusterAsync(
AttachedClusterName name) {
DeleteAttachedClusterRequest request =
DeleteAttachedClusterRequest.newBuilder()
.setName(name == null ? null : name.toString())
.build();
return deleteAttachedClusterAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a specific [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource.
*
* If successful, the response contains a newly created
* [Operation][google.longrunning.Operation] resource that can be described to track the status of
* the operation.
*
*
Sample code:
*
*
{@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()) {
* String name =
* AttachedClusterName.of("[PROJECT]", "[LOCATION]", "[ATTACHED_CLUSTER]").toString();
* attachedClustersClient.deleteAttachedClusterAsync(name).get();
* }
* }
*
* @param name Required. The resource name the
* [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] to delete.
* `AttachedCluster` names are formatted as
* `projects/<project-id>/locations/<region>/attachedClusters/<cluster-id>`.
*
See [Resource Names](https://cloud.google.com/apis/design/resource_names) for more
* details on Google Cloud Platform resource names.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final OperationFuture deleteAttachedClusterAsync(String name) {
DeleteAttachedClusterRequest request =
DeleteAttachedClusterRequest.newBuilder().setName(name).build();
return deleteAttachedClusterAsync(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a specific [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource.
*
* If successful, the response contains a newly created
* [Operation][google.longrunning.Operation] resource that can be described to track the status of
* the operation.
*
*
Sample code:
*
*
{@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()) {
* DeleteAttachedClusterRequest request =
* DeleteAttachedClusterRequest.newBuilder()
* .setName(
* AttachedClusterName.of("[PROJECT]", "[LOCATION]", "[ATTACHED_CLUSTER]")
* .toString())
* .setValidateOnly(true)
* .setAllowMissing(true)
* .setIgnoreErrors(true)
* .setEtag("etag3123477")
* .build();
* attachedClustersClient.deleteAttachedClusterAsync(request).get();
* }
* }
*
* @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 OperationFuture deleteAttachedClusterAsync(
DeleteAttachedClusterRequest request) {
return deleteAttachedClusterOperationCallable().futureCall(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a specific [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource.
*
* If successful, the response contains a newly created
* [Operation][google.longrunning.Operation] resource that can be described to track the status of
* the operation.
*
*
Sample code:
*
*
{@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()) {
* DeleteAttachedClusterRequest request =
* DeleteAttachedClusterRequest.newBuilder()
* .setName(
* AttachedClusterName.of("[PROJECT]", "[LOCATION]", "[ATTACHED_CLUSTER]")
* .toString())
* .setValidateOnly(true)
* .setAllowMissing(true)
* .setIgnoreErrors(true)
* .setEtag("etag3123477")
* .build();
* OperationFuture future =
* attachedClustersClient.deleteAttachedClusterOperationCallable().futureCall(request);
* // Do something.
* future.get();
* }
* }
*/
public final OperationCallable
deleteAttachedClusterOperationCallable() {
return stub.deleteAttachedClusterOperationCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Deletes a specific [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource.
*
* If successful, the response contains a newly created
* [Operation][google.longrunning.Operation] resource that can be described to track the status of
* the operation.
*
*
Sample code:
*
*
{@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()) {
* DeleteAttachedClusterRequest request =
* DeleteAttachedClusterRequest.newBuilder()
* .setName(
* AttachedClusterName.of("[PROJECT]", "[LOCATION]", "[ATTACHED_CLUSTER]")
* .toString())
* .setValidateOnly(true)
* .setAllowMissing(true)
* .setIgnoreErrors(true)
* .setEtag("etag3123477")
* .build();
* ApiFuture future =
* attachedClustersClient.deleteAttachedClusterCallable().futureCall(request);
* // Do something.
* future.get();
* }
* }
*/
public final UnaryCallable
deleteAttachedClusterCallable() {
return stub.deleteAttachedClusterCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns information, such as supported Kubernetes versions, on a given Google Cloud location.
*
* Sample code:
*
*
{@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()) {
* AttachedServerConfigName name = AttachedServerConfigName.of("[PROJECT]", "[LOCATION]");
* AttachedServerConfig response = attachedClustersClient.getAttachedServerConfig(name);
* }
* }
*
* @param name Required. The name of the
* [AttachedServerConfig][google.cloud.gkemulticloud.v1.AttachedServerConfig] resource to
* describe.
* `AttachedServerConfig` names are formatted as
* `projects/<project-id>/locations/<region>/attachedServerConfig`.
*
See [Resource Names](https://cloud.google.com/apis/design/resource_names) for more
* details on Google Cloud resource names.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final AttachedServerConfig getAttachedServerConfig(AttachedServerConfigName name) {
GetAttachedServerConfigRequest request =
GetAttachedServerConfigRequest.newBuilder()
.setName(name == null ? null : name.toString())
.build();
return getAttachedServerConfig(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns information, such as supported Kubernetes versions, on a given Google Cloud location.
*
*
Sample code:
*
*
{@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()) {
* String name = AttachedServerConfigName.of("[PROJECT]", "[LOCATION]").toString();
* AttachedServerConfig response = attachedClustersClient.getAttachedServerConfig(name);
* }
* }
*
* @param name Required. The name of the
* [AttachedServerConfig][google.cloud.gkemulticloud.v1.AttachedServerConfig] resource to
* describe.
* `AttachedServerConfig` names are formatted as
* `projects/<project-id>/locations/<region>/attachedServerConfig`.
*
See [Resource Names](https://cloud.google.com/apis/design/resource_names) for more
* details on Google Cloud resource names.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final AttachedServerConfig getAttachedServerConfig(String name) {
GetAttachedServerConfigRequest request =
GetAttachedServerConfigRequest.newBuilder().setName(name).build();
return getAttachedServerConfig(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns information, such as supported Kubernetes versions, on a given Google Cloud location.
*
*
Sample code:
*
*
{@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()) {
* GetAttachedServerConfigRequest request =
* GetAttachedServerConfigRequest.newBuilder()
* .setName(AttachedServerConfigName.of("[PROJECT]", "[LOCATION]").toString())
* .build();
* AttachedServerConfig response = attachedClustersClient.getAttachedServerConfig(request);
* }
* }
*
* @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 AttachedServerConfig getAttachedServerConfig(
GetAttachedServerConfigRequest request) {
return getAttachedServerConfigCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Returns information, such as supported Kubernetes versions, on a given Google Cloud location.
*
* Sample code:
*
*
{@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()) {
* GetAttachedServerConfigRequest request =
* GetAttachedServerConfigRequest.newBuilder()
* .setName(AttachedServerConfigName.of("[PROJECT]", "[LOCATION]").toString())
* .build();
* ApiFuture future =
* attachedClustersClient.getAttachedServerConfigCallable().futureCall(request);
* // Do something.
* AttachedServerConfig response = future.get();
* }
* }
*/
public final UnaryCallable
getAttachedServerConfigCallable() {
return stub.getAttachedServerConfigCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Generates the install manifest to be installed on the target cluster.
*
* Sample code:
*
*
{@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()) {
* LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
* String attachedClusterId = "attachedClusterId865943409";
* GenerateAttachedClusterInstallManifestResponse response =
* attachedClustersClient.generateAttachedClusterInstallManifest(parent, attachedClusterId);
* }
* }
*
* @param parent Required. The parent location where this
* [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource will be created.
* Location names are formatted as `projects/<project-id>/locations/<region>`.
*
See [Resource Names](https://cloud.google.com/apis/design/resource_names) for more
* details on Google Cloud resource names.
* @param attachedClusterId Required. A client provided ID of the resource. Must be unique within
* the parent resource.
*
The provided ID will be part of the
* [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource name formatted as
* `projects/<project-id>/locations/<region>/attachedClusters/<cluster-id>`.
*
Valid characters are `/[a-z][0-9]-/`. Cannot be longer than 63 characters.
*
When generating an install manifest for importing an existing Membership resource, the
* attached_cluster_id field must be the Membership id.
*
Membership names are formatted as
* `projects/<project-id>/locations/<region>/memberships/<membership-id>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final GenerateAttachedClusterInstallManifestResponse
generateAttachedClusterInstallManifest(LocationName parent, String attachedClusterId) {
GenerateAttachedClusterInstallManifestRequest request =
GenerateAttachedClusterInstallManifestRequest.newBuilder()
.setParent(parent == null ? null : parent.toString())
.setAttachedClusterId(attachedClusterId)
.build();
return generateAttachedClusterInstallManifest(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Generates the install manifest to be installed on the target cluster.
*
*
Sample code:
*
*
{@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()) {
* String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
* String attachedClusterId = "attachedClusterId865943409";
* GenerateAttachedClusterInstallManifestResponse response =
* attachedClustersClient.generateAttachedClusterInstallManifest(parent, attachedClusterId);
* }
* }
*
* @param parent Required. The parent location where this
* [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource will be created.
* Location names are formatted as `projects/<project-id>/locations/<region>`.
*
See [Resource Names](https://cloud.google.com/apis/design/resource_names) for more
* details on Google Cloud resource names.
* @param attachedClusterId Required. A client provided ID of the resource. Must be unique within
* the parent resource.
*
The provided ID will be part of the
* [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource name formatted as
* `projects/<project-id>/locations/<region>/attachedClusters/<cluster-id>`.
*
Valid characters are `/[a-z][0-9]-/`. Cannot be longer than 63 characters.
*
When generating an install manifest for importing an existing Membership resource, the
* attached_cluster_id field must be the Membership id.
*
Membership names are formatted as
* `projects/<project-id>/locations/<region>/memberships/<membership-id>`.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
public final GenerateAttachedClusterInstallManifestResponse
generateAttachedClusterInstallManifest(String parent, String attachedClusterId) {
GenerateAttachedClusterInstallManifestRequest request =
GenerateAttachedClusterInstallManifestRequest.newBuilder()
.setParent(parent)
.setAttachedClusterId(attachedClusterId)
.build();
return generateAttachedClusterInstallManifest(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Generates the install manifest to be installed on the target cluster.
*
*
Sample code:
*
*
{@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()) {
* GenerateAttachedClusterInstallManifestRequest request =
* GenerateAttachedClusterInstallManifestRequest.newBuilder()
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setAttachedClusterId("attachedClusterId865943409")
* .setPlatformVersion("platformVersion1848800485")
* .setProxyConfig(AttachedProxyConfig.newBuilder().build())
* .build();
* GenerateAttachedClusterInstallManifestResponse response =
* attachedClustersClient.generateAttachedClusterInstallManifest(request);
* }
* }
*
* @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 GenerateAttachedClusterInstallManifestResponse
generateAttachedClusterInstallManifest(
GenerateAttachedClusterInstallManifestRequest request) {
return generateAttachedClusterInstallManifestCallable().call(request);
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Generates the install manifest to be installed on the target cluster.
*
* Sample code:
*
*
{@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()) {
* GenerateAttachedClusterInstallManifestRequest request =
* GenerateAttachedClusterInstallManifestRequest.newBuilder()
* .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
* .setAttachedClusterId("attachedClusterId865943409")
* .setPlatformVersion("platformVersion1848800485")
* .setProxyConfig(AttachedProxyConfig.newBuilder().build())
* .build();
* ApiFuture future =
* attachedClustersClient
* .generateAttachedClusterInstallManifestCallable()
* .futureCall(request);
* // Do something.
* GenerateAttachedClusterInstallManifestResponse response = future.get();
* }
* }
*/
public final UnaryCallable<
GenerateAttachedClusterInstallManifestRequest,
GenerateAttachedClusterInstallManifestResponse>
generateAttachedClusterInstallManifestCallable() {
return stub.generateAttachedClusterInstallManifestCallable();
}
// AUTO-GENERATED DOCUMENTATION AND METHOD.
/**
* Generates an access token for a cluster agent.
*
* Sample code:
*
*
{@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);
* }
* }
*
* @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.
*
* Sample code:
*
*
{@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 future =
* attachedClustersClient.generateAttachedClusterAgentTokenCallable().futureCall(request);
* // Do something.
* GenerateAttachedClusterAgentTokenResponse response = future.get();
* }
* }
*/
public final UnaryCallable<
GenerateAttachedClusterAgentTokenRequest, GenerateAttachedClusterAgentTokenResponse>
generateAttachedClusterAgentTokenCallable() {
return stub.generateAttachedClusterAgentTokenCallable();
}
@Override
public final void close() {
stub.close();
}
@Override
public void shutdown() {
stub.shutdown();
}
@Override
public boolean isShutdown() {
return stub.isShutdown();
}
@Override
public boolean isTerminated() {
return stub.isTerminated();
}
@Override
public void shutdownNow() {
stub.shutdownNow();
}
@Override
public boolean awaitTermination(long duration, TimeUnit unit) throws InterruptedException {
return stub.awaitTermination(duration, unit);
}
public static class ListAttachedClustersPagedResponse
extends AbstractPagedListResponse<
ListAttachedClustersRequest,
ListAttachedClustersResponse,
AttachedCluster,
ListAttachedClustersPage,
ListAttachedClustersFixedSizeCollection> {
public static ApiFuture createAsync(
PageContext
context,
ApiFuture futureResponse) {
ApiFuture futurePage =
ListAttachedClustersPage.createEmptyPage().createPageAsync(context, futureResponse);
return ApiFutures.transform(
futurePage,
input -> new ListAttachedClustersPagedResponse(input),
MoreExecutors.directExecutor());
}
private ListAttachedClustersPagedResponse(ListAttachedClustersPage page) {
super(page, ListAttachedClustersFixedSizeCollection.createEmptyCollection());
}
}
public static class ListAttachedClustersPage
extends AbstractPage<
ListAttachedClustersRequest,
ListAttachedClustersResponse,
AttachedCluster,
ListAttachedClustersPage> {
private ListAttachedClustersPage(
PageContext
context,
ListAttachedClustersResponse response) {
super(context, response);
}
private static ListAttachedClustersPage createEmptyPage() {
return new ListAttachedClustersPage(null, null);
}
@Override
protected ListAttachedClustersPage createPage(
PageContext
context,
ListAttachedClustersResponse response) {
return new ListAttachedClustersPage(context, response);
}
@Override
public ApiFuture createPageAsync(
PageContext
context,
ApiFuture futureResponse) {
return super.createPageAsync(context, futureResponse);
}
}
public static class ListAttachedClustersFixedSizeCollection
extends AbstractFixedSizeCollection<
ListAttachedClustersRequest,
ListAttachedClustersResponse,
AttachedCluster,
ListAttachedClustersPage,
ListAttachedClustersFixedSizeCollection> {
private ListAttachedClustersFixedSizeCollection(
List pages, int collectionSize) {
super(pages, collectionSize);
}
private static ListAttachedClustersFixedSizeCollection createEmptyCollection() {
return new ListAttachedClustersFixedSizeCollection(null, 0);
}
@Override
protected ListAttachedClustersFixedSizeCollection createCollection(
List pages, int collectionSize) {
return new ListAttachedClustersFixedSizeCollection(pages, collectionSize);
}
}
}