Class AttachedClustersClient
- All Implemented Interfaces:
BackgroundResource,AutoCloseable
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:
// 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().
| 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.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
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:
// 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:
// 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:
// 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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructs an instance of AttachedClustersClient, using the given settings.protected -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(long duration, TimeUnit unit) final voidclose()static final AttachedClustersClientcreate()Constructs an instance of AttachedClustersClient with default settings.static final AttachedClustersClientcreate(AttachedClustersSettings settings) Constructs an instance of AttachedClustersClient, using the given settings.static final AttachedClustersClientcreate(AttachedClustersStub stub) Constructs an instance of AttachedClustersClient, using the given stub for making calls.Creates a new [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource on a given Google Cloud Platform project and region.createAttachedClusterAsync(LocationName parent, AttachedCluster attachedCluster, String attachedClusterId) Creates a new [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource on a given Google Cloud Platform project and region.createAttachedClusterAsync(String parent, AttachedCluster attachedCluster, String attachedClusterId) Creates a new [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource on a given Google Cloud Platform project and region.Creates a new [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource on a given Google Cloud Platform project and region.Creates a new [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource on a given Google Cloud Platform project and region.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a specific [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a specific [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a specific [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource.Deletes a specific [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource.final OperationCallable<DeleteAttachedClusterRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a specific [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource.Generates an access token for a cluster agent.final UnaryCallable<GenerateAttachedClusterAgentTokenRequest,GenerateAttachedClusterAgentTokenResponse> Generates an access token for a cluster agent.Generates the install manifest to be installed on the target cluster.generateAttachedClusterInstallManifest(LocationName parent, String attachedClusterId) Generates the install manifest to be installed on the target cluster.generateAttachedClusterInstallManifest(String parent, String attachedClusterId) Generates the install manifest to be installed on the target cluster.final UnaryCallable<GenerateAttachedClusterInstallManifestRequest,GenerateAttachedClusterInstallManifestResponse> Generates the install manifest to be installed on the target cluster.final AttachedClusterDescribes a specific [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource.final AttachedClusterDescribes a specific [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource.final AttachedClustergetAttachedCluster(String name) Describes a specific [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource.Describes a specific [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource.final AttachedServerConfigReturns information, such as supported Kubernetes versions, on a given Google Cloud location.final AttachedServerConfigReturns information, such as supported Kubernetes versions, on a given Google Cloud location.final AttachedServerConfigReturns information, such as supported Kubernetes versions, on a given Google Cloud location.Returns information, such as supported Kubernetes versions, on a given Google Cloud location.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final AttachedClustersSettingsgetStub()Imports creates a new [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource by importing an existing Fleet Membership resource.importAttachedClusterAsync(LocationName parent, String fleetMembership) Imports creates a new [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource by importing an existing Fleet Membership resource.importAttachedClusterAsync(String parent, String fleetMembership) Imports creates a new [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource by importing an existing Fleet Membership resource.Imports creates a new [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource by importing an existing Fleet Membership resource.Imports creates a new [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource by importing an existing Fleet Membership resource.booleanbooleanLists all [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resources on a given Google Cloud project and region.listAttachedClusters(LocationName parent) Lists all [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resources on a given Google Cloud project and region.listAttachedClusters(String parent) Lists all [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resources on a given Google Cloud project and region.Lists all [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resources on a given Google Cloud project and region.final UnaryCallable<ListAttachedClustersRequest,AttachedClustersClient.ListAttachedClustersPagedResponse> Lists all [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resources on a given Google Cloud project and region.voidshutdown()voidupdateAttachedClusterAsync(AttachedCluster attachedCluster, com.google.protobuf.FieldMask updateMask) Updates an [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster].Updates an [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster].Updates an [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster].Updates an [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster].
-
Constructor Details
-
AttachedClustersClient
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.- Throws:
IOException
-
AttachedClustersClient
-
-
Method Details
-
create
Constructs an instance of AttachedClustersClient with default settings.- Throws:
IOException
-
create
public static final AttachedClustersClient create(AttachedClustersSettings settings) throws IOException 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.- Throws:
IOException
-
create
Constructs an instance of AttachedClustersClient, using the given stub for making calls. This is for advanced usage - prefer using create(AttachedClustersSettings). -
getSettings
-
getStub
-
getOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
getHttpJsonOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
createAttachedClusterAsync
public final OperationFuture<AttachedCluster,OperationMetadata> createAttachedClusterAsync(LocationName parent, AttachedCluster attachedCluster, String attachedClusterId) 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:
// 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(); }- Parameters:
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.
attachedCluster- Required. The specification of the [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] to create.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:
ApiException- if the remote call fails
-
createAttachedClusterAsync
public final OperationFuture<AttachedCluster,OperationMetadata> createAttachedClusterAsync(String parent, AttachedCluster attachedCluster, String attachedClusterId) 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:
// 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(); }- Parameters:
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.
attachedCluster- Required. The specification of the [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] to create.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:
ApiException- if the remote call fails
-
createAttachedClusterAsync
public final OperationFuture<AttachedCluster,OperationMetadata> createAttachedClusterAsync(CreateAttachedClusterRequest request) 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:
// 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(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createAttachedClusterOperationCallable
public final OperationCallable<CreateAttachedClusterRequest,AttachedCluster, createAttachedClusterOperationCallable()OperationMetadata> 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:
// 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<AttachedCluster, OperationMetadata> future = attachedClustersClient.createAttachedClusterOperationCallable().futureCall(request); // Do something. AttachedCluster response = future.get(); } -
createAttachedClusterCallable
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:
// 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<Operation> future = attachedClustersClient.createAttachedClusterCallable().futureCall(request); // Do something. Operation response = future.get(); } -
updateAttachedClusterAsync
public final OperationFuture<AttachedCluster,OperationMetadata> updateAttachedClusterAsync(AttachedCluster attachedCluster, com.google.protobuf.FieldMask updateMask) Updates an [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster].Sample 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(); }- Parameters:
attachedCluster- Required. The [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource to update.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` * `monitoring_config.cloud_monitoring_config.enabled`
- Throws:
ApiException- if the remote call fails
-
updateAttachedClusterAsync
public final OperationFuture<AttachedCluster,OperationMetadata> updateAttachedClusterAsync(UpdateAttachedClusterRequest request) Updates an [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster].Sample 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(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateAttachedClusterOperationCallable
public final OperationCallable<UpdateAttachedClusterRequest,AttachedCluster, updateAttachedClusterOperationCallable()OperationMetadata> Updates an [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster].Sample 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<AttachedCluster, OperationMetadata> future = attachedClustersClient.updateAttachedClusterOperationCallable().futureCall(request); // Do something. AttachedCluster response = future.get(); } -
updateAttachedClusterCallable
Updates an [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster].Sample 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<Operation> future = attachedClustersClient.updateAttachedClusterCallable().futureCall(request); // Do something. Operation response = future.get(); } -
importAttachedClusterAsync
public final OperationFuture<AttachedCluster,OperationMetadata> importAttachedClusterAsync(LocationName parent, String fleetMembership) 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:
// 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(); }- Parameters:
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.
fleetMembership- Required. The name of the fleet membership resource to import.- Throws:
ApiException- if the remote call fails
-
importAttachedClusterAsync
public final OperationFuture<AttachedCluster,OperationMetadata> importAttachedClusterAsync(String parent, String fleetMembership) 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:
// 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(); }- Parameters:
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.
fleetMembership- Required. The name of the fleet membership resource to import.- Throws:
ApiException- if the remote call fails
-
importAttachedClusterAsync
public final OperationFuture<AttachedCluster,OperationMetadata> importAttachedClusterAsync(ImportAttachedClusterRequest request) 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:
// 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(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
importAttachedClusterOperationCallable
public final OperationCallable<ImportAttachedClusterRequest,AttachedCluster, importAttachedClusterOperationCallable()OperationMetadata> 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:
// 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<AttachedCluster, OperationMetadata> future = attachedClustersClient.importAttachedClusterOperationCallable().futureCall(request); // Do something. AttachedCluster response = future.get(); } -
importAttachedClusterCallable
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:
// 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<Operation> future = attachedClustersClient.importAttachedClusterCallable().futureCall(request); // Do something. Operation response = future.get(); } -
getAttachedCluster
Describes a specific [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource.Sample 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); }- Parameters:
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:
ApiException- if the remote call fails
-
getAttachedCluster
Describes a specific [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource.Sample 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); }- Parameters:
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:
ApiException- if the remote call fails
-
getAttachedCluster
Describes a specific [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource.Sample 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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getAttachedClusterCallable
Describes a specific [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resource.Sample 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<AttachedCluster> future = attachedClustersClient.getAttachedClusterCallable().futureCall(request); // Do something. AttachedCluster response = future.get(); } -
listAttachedClusters
public final AttachedClustersClient.ListAttachedClustersPagedResponse listAttachedClusters(LocationName parent) Lists all [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resources on a given Google Cloud project and region.Sample 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); } }- Parameters:
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:
ApiException- if the remote call fails
-
listAttachedClusters
public final AttachedClustersClient.ListAttachedClustersPagedResponse listAttachedClusters(String parent) Lists all [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resources on a given Google Cloud project and region.Sample 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); } }- Parameters:
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:
ApiException- if the remote call fails
-
listAttachedClusters
public final AttachedClustersClient.ListAttachedClustersPagedResponse listAttachedClusters(ListAttachedClustersRequest request) Lists all [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resources on a given Google Cloud project and region.Sample 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); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listAttachedClustersPagedCallable
public final UnaryCallable<ListAttachedClustersRequest,AttachedClustersClient.ListAttachedClustersPagedResponse> listAttachedClustersPagedCallable()Lists all [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resources on a given Google Cloud project and region.Sample 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<AttachedCluster> future = attachedClustersClient.listAttachedClustersPagedCallable().futureCall(request); // Do something. for (AttachedCluster element : future.get().iterateAll()) { // doThingsWith(element); } } -
listAttachedClustersCallable
public final UnaryCallable<ListAttachedClustersRequest,ListAttachedClustersResponse> listAttachedClustersCallable()Lists all [AttachedCluster][google.cloud.gkemulticloud.v1.AttachedCluster] resources on a given Google Cloud project and region.Sample 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; } } } -
deleteAttachedClusterAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteAttachedClusterAsync(AttachedClusterName name) 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:
// 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(); }- Parameters:
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:
ApiException- if the remote call fails
-
deleteAttachedClusterAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteAttachedClusterAsync(String name) 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:
// 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(); }- Parameters:
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:
ApiException- if the remote call fails
-
deleteAttachedClusterAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteAttachedClusterAsync(DeleteAttachedClusterRequest request) 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:
// 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(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteAttachedClusterOperationCallable
public final OperationCallable<DeleteAttachedClusterRequest,com.google.protobuf.Empty, deleteAttachedClusterOperationCallable()OperationMetadata> 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:
// 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<Empty, OperationMetadata> future = attachedClustersClient.deleteAttachedClusterOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteAttachedClusterCallable
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:
// 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<Operation> future = attachedClustersClient.deleteAttachedClusterCallable().futureCall(request); // Do something. future.get(); } -
getAttachedServerConfig
Returns information, such as supported Kubernetes versions, on a given Google Cloud location.Sample 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); }- Parameters:
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:
ApiException- if the remote call fails
-
getAttachedServerConfig
Returns information, such as supported Kubernetes versions, on a given Google Cloud location.Sample 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); }- Parameters:
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:
ApiException- if the remote call fails
-
getAttachedServerConfig
Returns information, such as supported Kubernetes versions, on a given Google Cloud location.Sample 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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getAttachedServerConfigCallable
public final UnaryCallable<GetAttachedServerConfigRequest,AttachedServerConfig> getAttachedServerConfigCallable()Returns information, such as supported Kubernetes versions, on a given Google Cloud location.Sample 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<AttachedServerConfig> future = attachedClustersClient.getAttachedServerConfigCallable().futureCall(request); // Do something. AttachedServerConfig response = future.get(); } -
generateAttachedClusterInstallManifest
public final GenerateAttachedClusterInstallManifestResponse generateAttachedClusterInstallManifest(LocationName parent, String attachedClusterId) Generates the install manifest to be installed on the target cluster.Sample 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); }- Parameters:
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.
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:
ApiException- if the remote call fails
-
generateAttachedClusterInstallManifest
public final GenerateAttachedClusterInstallManifestResponse generateAttachedClusterInstallManifest(String parent, String attachedClusterId) Generates the install manifest to be installed on the target cluster.Sample 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); }- Parameters:
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.
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:
ApiException- if the remote call fails
-
generateAttachedClusterInstallManifest
public final GenerateAttachedClusterInstallManifestResponse generateAttachedClusterInstallManifest(GenerateAttachedClusterInstallManifestRequest request) Generates the install manifest to be installed on the target cluster.Sample 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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
generateAttachedClusterInstallManifestCallable
public final UnaryCallable<GenerateAttachedClusterInstallManifestRequest,GenerateAttachedClusterInstallManifestResponse> generateAttachedClusterInstallManifestCallable()Generates the install manifest to be installed on the target cluster.Sample 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<GenerateAttachedClusterInstallManifestResponse> future = attachedClustersClient .generateAttachedClusterInstallManifestCallable() .futureCall(request); // Do something. GenerateAttachedClusterInstallManifestResponse response = future.get(); } -
generateAttachedClusterAgentToken
public final GenerateAttachedClusterAgentTokenResponse generateAttachedClusterAgentToken(GenerateAttachedClusterAgentTokenRequest request) Generates an access token for a cluster agent.Sample 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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
generateAttachedClusterAgentTokenCallable
public final UnaryCallable<GenerateAttachedClusterAgentTokenRequest,GenerateAttachedClusterAgentTokenResponse> generateAttachedClusterAgentTokenCallable()Generates an access token for a cluster agent.Sample 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(); } -
close
public final void close()- Specified by:
closein interfaceAutoCloseable
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceBackgroundResource
-
isShutdown
public boolean isShutdown()- Specified by:
isShutdownin interfaceBackgroundResource
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceBackgroundResource
-
shutdownNow
public void shutdownNow()- Specified by:
shutdownNowin interfaceBackgroundResource
-
awaitTermination
- Specified by:
awaitTerminationin interfaceBackgroundResource- Throws:
InterruptedException
-