Class HypercomputeClusterClient
- 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 (HypercomputeClusterClient hypercomputeClusterClient = HypercomputeClusterClient.create()) {
ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]");
Cluster response = hypercomputeClusterClient.getCluster(name);
}
Note: close() needs to be called on the HypercomputeClusterClient 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 |
|---|---|---|
ListClusters |
Lists Clusters in a given project and 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.
|
GetCluster |
Gets details of a single 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.
|
CreateCluster |
Creates a new Cluster in a given project and location. |
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.
|
UpdateCluster |
Updates the parameters of a single Cluster. |
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.
|
DeleteCluster |
Deletes a single Cluster. |
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.
|
ListLocations |
Lists information about the supported locations for this service. |
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.
|
GetLocation |
Gets information about a location. |
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 HypercomputeClusterSettings 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
HypercomputeClusterSettings hypercomputeClusterSettings =
HypercomputeClusterSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
HypercomputeClusterClient hypercomputeClusterClient =
HypercomputeClusterClient.create(hypercomputeClusterSettings);
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
HypercomputeClusterSettings hypercomputeClusterSettings =
HypercomputeClusterSettings.newBuilder().setEndpoint(myEndpoint).build();
HypercomputeClusterClient hypercomputeClusterClient =
HypercomputeClusterClient.create(hypercomputeClusterSettings);
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
HypercomputeClusterSettings hypercomputeClusterSettings =
HypercomputeClusterSettings.newHttpJsonBuilder().build();
HypercomputeClusterClient hypercomputeClusterClient =
HypercomputeClusterClient.create(hypercomputeClusterSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructs an instance of HypercomputeClusterClient, using the given settings.protected -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(long duration, TimeUnit unit) final voidclose()static final HypercomputeClusterClientcreate()Constructs an instance of HypercomputeClusterClient with default settings.static final HypercomputeClusterClientcreate(HypercomputeClusterSettings settings) Constructs an instance of HypercomputeClusterClient, using the given settings.static final HypercomputeClusterClientConstructs an instance of HypercomputeClusterClient, using the given stub for making calls.createClusterAsync(CreateClusterRequest request) Creates a new Cluster in a given project and location.createClusterAsync(LocationName parent, Cluster cluster, String clusterId) Creates a new Cluster in a given project and location.createClusterAsync(String parent, Cluster cluster, String clusterId) Creates a new Cluster in a given project and location.Creates a new Cluster in a given project and location.Creates a new Cluster in a given project and location.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> Deletes a single Cluster.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteClusterAsync(DeleteClusterRequest request) Deletes a single Cluster.final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteClusterAsync(String name) Deletes a single Cluster.Deletes a single Cluster.final OperationCallable<DeleteClusterRequest,com.google.protobuf.Empty, OperationMetadata> Deletes a single Cluster.final ClustergetCluster(ClusterName name) Gets details of a single Cluster.final ClustergetCluster(GetClusterRequest request) Gets details of a single Cluster.final ClustergetCluster(String name) Gets details of a single Cluster.Gets details of a single Cluster.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final LocationgetLocation(GetLocationRequest request) Gets information about a location.Gets information about a location.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.getStub()booleanbooleanlistClusters(ListClustersRequest request) Lists Clusters in a given project and location.listClusters(LocationName parent) Lists Clusters in a given project and location.listClusters(String parent) Lists Clusters in a given project and location.Lists Clusters in a given project and location.Lists Clusters in a given project and location.listLocations(ListLocationsRequest request) Lists information about the supported locations for this service.Lists information about the supported locations for this service.Lists information about the supported locations for this service.voidshutdown()voidupdateClusterAsync(Cluster cluster, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single Cluster.updateClusterAsync(UpdateClusterRequest request) Updates the parameters of a single Cluster.Updates the parameters of a single Cluster.Updates the parameters of a single Cluster.
-
Constructor Details
-
HypercomputeClusterClient
Constructs an instance of HypercomputeClusterClient, 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
-
HypercomputeClusterClient
-
-
Method Details
-
create
Constructs an instance of HypercomputeClusterClient with default settings.- Throws:
IOException
-
create
public static final HypercomputeClusterClient create(HypercomputeClusterSettings settings) throws IOException Constructs an instance of HypercomputeClusterClient, 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 HypercomputeClusterClient, using the given stub for making calls. This is for advanced usage - prefer using create(HypercomputeClusterSettings). -
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. -
listClusters
Lists Clusters in a given project and 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 (HypercomputeClusterClient hypercomputeClusterClient = HypercomputeClusterClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (Cluster element : hypercomputeClusterClient.listClusters(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Parent location of the clusters to list, in the format `projects/{project}/locations/{location}`.- Throws:
ApiException- if the remote call fails
-
listClusters
Lists Clusters in a given project and 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 (HypercomputeClusterClient hypercomputeClusterClient = HypercomputeClusterClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (Cluster element : hypercomputeClusterClient.listClusters(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. Parent location of the clusters to list, in the format `projects/{project}/locations/{location}`.- Throws:
ApiException- if the remote call fails
-
listClusters
public final HypercomputeClusterClient.ListClustersPagedResponse listClusters(ListClustersRequest request) Lists Clusters in a given project and 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 (HypercomputeClusterClient hypercomputeClusterClient = HypercomputeClusterClient.create()) { ListClustersRequest request = ListClustersRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (Cluster element : hypercomputeClusterClient.listClusters(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
-
listClustersPagedCallable
public final UnaryCallable<ListClustersRequest,HypercomputeClusterClient.ListClustersPagedResponse> listClustersPagedCallable()Lists Clusters in a given project and 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 (HypercomputeClusterClient hypercomputeClusterClient = HypercomputeClusterClient.create()) { ListClustersRequest request = ListClustersRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<Cluster> future = hypercomputeClusterClient.listClustersPagedCallable().futureCall(request); // Do something. for (Cluster element : future.get().iterateAll()) { // doThingsWith(element); } } -
listClustersCallable
Lists Clusters in a given project and 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 (HypercomputeClusterClient hypercomputeClusterClient = HypercomputeClusterClient.create()) { ListClustersRequest request = ListClustersRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListClustersResponse response = hypercomputeClusterClient.listClustersCallable().call(request); for (Cluster element : response.getClustersList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getCluster
Gets details of a single 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 (HypercomputeClusterClient hypercomputeClusterClient = HypercomputeClusterClient.create()) { ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); Cluster response = hypercomputeClusterClient.getCluster(name); }- Parameters:
name- Required. Name of the cluster to retrieve, in the format `projects/{project}/locations/{location}/clusters/{cluster}`.- Throws:
ApiException- if the remote call fails
-
getCluster
Gets details of a single 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 (HypercomputeClusterClient hypercomputeClusterClient = HypercomputeClusterClient.create()) { String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString(); Cluster response = hypercomputeClusterClient.getCluster(name); }- Parameters:
name- Required. Name of the cluster to retrieve, in the format `projects/{project}/locations/{location}/clusters/{cluster}`.- Throws:
ApiException- if the remote call fails
-
getCluster
Gets details of a single 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 (HypercomputeClusterClient hypercomputeClusterClient = HypercomputeClusterClient.create()) { GetClusterRequest request = GetClusterRequest.newBuilder() .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) .build(); Cluster response = hypercomputeClusterClient.getCluster(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getClusterCallable
Gets details of a single 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 (HypercomputeClusterClient hypercomputeClusterClient = HypercomputeClusterClient.create()) { GetClusterRequest request = GetClusterRequest.newBuilder() .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) .build(); ApiFuture<Cluster> future = hypercomputeClusterClient.getClusterCallable().futureCall(request); // Do something. Cluster response = future.get(); } -
createClusterAsync
public final OperationFuture<Cluster,OperationMetadata> createClusterAsync(LocationName parent, Cluster cluster, String clusterId) Creates a new Cluster in a given project and 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 (HypercomputeClusterClient hypercomputeClusterClient = HypercomputeClusterClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); Cluster cluster = Cluster.newBuilder().build(); String clusterId = "clusterId561939637"; Cluster response = hypercomputeClusterClient.createClusterAsync(parent, cluster, clusterId).get(); }- Parameters:
parent- Required. Parent location in which the cluster should be created, in the format `projects/{project}/locations/{location}`.cluster- Required. Cluster to create.clusterId- Required. ID of the cluster to create. Must conform to [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034) (lower-case, alphanumeric, and at most 63 characters).- Throws:
ApiException- if the remote call fails
-
createClusterAsync
public final OperationFuture<Cluster,OperationMetadata> createClusterAsync(String parent, Cluster cluster, String clusterId) Creates a new Cluster in a given project and 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 (HypercomputeClusterClient hypercomputeClusterClient = HypercomputeClusterClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); Cluster cluster = Cluster.newBuilder().build(); String clusterId = "clusterId561939637"; Cluster response = hypercomputeClusterClient.createClusterAsync(parent, cluster, clusterId).get(); }- Parameters:
parent- Required. Parent location in which the cluster should be created, in the format `projects/{project}/locations/{location}`.cluster- Required. Cluster to create.clusterId- Required. ID of the cluster to create. Must conform to [RFC-1034](https://datatracker.ietf.org/doc/html/rfc1034) (lower-case, alphanumeric, and at most 63 characters).- Throws:
ApiException- if the remote call fails
-
createClusterAsync
public final OperationFuture<Cluster,OperationMetadata> createClusterAsync(CreateClusterRequest request) Creates a new Cluster in a given project and 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 (HypercomputeClusterClient hypercomputeClusterClient = HypercomputeClusterClient.create()) { CreateClusterRequest request = CreateClusterRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setClusterId("clusterId561939637") .setCluster(Cluster.newBuilder().build()) .setRequestId("requestId693933066") .build(); Cluster response = hypercomputeClusterClient.createClusterAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createClusterOperationCallable
public final OperationCallable<CreateClusterRequest,Cluster, createClusterOperationCallable()OperationMetadata> Creates a new Cluster in a given project and 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 (HypercomputeClusterClient hypercomputeClusterClient = HypercomputeClusterClient.create()) { CreateClusterRequest request = CreateClusterRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setClusterId("clusterId561939637") .setCluster(Cluster.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<Cluster, OperationMetadata> future = hypercomputeClusterClient.createClusterOperationCallable().futureCall(request); // Do something. Cluster response = future.get(); } -
createClusterCallable
Creates a new Cluster in a given project and 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 (HypercomputeClusterClient hypercomputeClusterClient = HypercomputeClusterClient.create()) { CreateClusterRequest request = CreateClusterRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setClusterId("clusterId561939637") .setCluster(Cluster.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = hypercomputeClusterClient.createClusterCallable().futureCall(request); // Do something. Operation response = future.get(); } -
updateClusterAsync
public final OperationFuture<Cluster,OperationMetadata> updateClusterAsync(Cluster cluster, com.google.protobuf.FieldMask updateMask) Updates the parameters of a single 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 (HypercomputeClusterClient hypercomputeClusterClient = HypercomputeClusterClient.create()) { Cluster cluster = Cluster.newBuilder().build(); FieldMask updateMask = FieldMask.newBuilder().build(); Cluster response = hypercomputeClusterClient.updateClusterAsync(cluster, updateMask).get(); }- Parameters:
cluster- Required. Cluster to update.updateMask- Optional. Mask specifying which fields in the cluster to update. All paths must be specified explicitly - wildcards are not supported. At least one path must be provided.- Throws:
ApiException- if the remote call fails
-
updateClusterAsync
public final OperationFuture<Cluster,OperationMetadata> updateClusterAsync(UpdateClusterRequest request) Updates the parameters of a single 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 (HypercomputeClusterClient hypercomputeClusterClient = HypercomputeClusterClient.create()) { UpdateClusterRequest request = UpdateClusterRequest.newBuilder() .setCluster(Cluster.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .setRequestId("requestId693933066") .build(); Cluster response = hypercomputeClusterClient.updateClusterAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateClusterOperationCallable
public final OperationCallable<UpdateClusterRequest,Cluster, updateClusterOperationCallable()OperationMetadata> Updates the parameters of a single 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 (HypercomputeClusterClient hypercomputeClusterClient = HypercomputeClusterClient.create()) { UpdateClusterRequest request = UpdateClusterRequest.newBuilder() .setCluster(Cluster.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .setRequestId("requestId693933066") .build(); OperationFuture<Cluster, OperationMetadata> future = hypercomputeClusterClient.updateClusterOperationCallable().futureCall(request); // Do something. Cluster response = future.get(); } -
updateClusterCallable
Updates the parameters of a single 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 (HypercomputeClusterClient hypercomputeClusterClient = HypercomputeClusterClient.create()) { UpdateClusterRequest request = UpdateClusterRequest.newBuilder() .setCluster(Cluster.newBuilder().build()) .setUpdateMask(FieldMask.newBuilder().build()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = hypercomputeClusterClient.updateClusterCallable().futureCall(request); // Do something. Operation response = future.get(); } -
deleteClusterAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteClusterAsync(ClusterName name) Deletes a single 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 (HypercomputeClusterClient hypercomputeClusterClient = HypercomputeClusterClient.create()) { ClusterName name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]"); hypercomputeClusterClient.deleteClusterAsync(name).get(); }- Parameters:
name- Required. Name of the cluster to delete, in the format `projects/{project}/locations/{location}/clusters/{cluster}`.- Throws:
ApiException- if the remote call fails
-
deleteClusterAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteClusterAsync(String name) Deletes a single 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 (HypercomputeClusterClient hypercomputeClusterClient = HypercomputeClusterClient.create()) { String name = ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString(); hypercomputeClusterClient.deleteClusterAsync(name).get(); }- Parameters:
name- Required. Name of the cluster to delete, in the format `projects/{project}/locations/{location}/clusters/{cluster}`.- Throws:
ApiException- if the remote call fails
-
deleteClusterAsync
public final OperationFuture<com.google.protobuf.Empty,OperationMetadata> deleteClusterAsync(DeleteClusterRequest request) Deletes a single 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 (HypercomputeClusterClient hypercomputeClusterClient = HypercomputeClusterClient.create()) { DeleteClusterRequest request = DeleteClusterRequest.newBuilder() .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) .setRequestId("requestId693933066") .build(); hypercomputeClusterClient.deleteClusterAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteClusterOperationCallable
public final OperationCallable<DeleteClusterRequest,com.google.protobuf.Empty, deleteClusterOperationCallable()OperationMetadata> Deletes a single 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 (HypercomputeClusterClient hypercomputeClusterClient = HypercomputeClusterClient.create()) { DeleteClusterRequest request = DeleteClusterRequest.newBuilder() .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) .setRequestId("requestId693933066") .build(); OperationFuture<Empty, OperationMetadata> future = hypercomputeClusterClient.deleteClusterOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteClusterCallable
Deletes a single 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 (HypercomputeClusterClient hypercomputeClusterClient = HypercomputeClusterClient.create()) { DeleteClusterRequest request = DeleteClusterRequest.newBuilder() .setName(ClusterName.of("[PROJECT]", "[LOCATION]", "[CLUSTER]").toString()) .setRequestId("requestId693933066") .build(); ApiFuture<Operation> future = hypercomputeClusterClient.deleteClusterCallable().futureCall(request); // Do something. future.get(); } -
listLocations
public final HypercomputeClusterClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request) Lists information about the supported locations for this service.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 (HypercomputeClusterClient hypercomputeClusterClient = HypercomputeClusterClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Location element : hypercomputeClusterClient.listLocations(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
-
listLocationsPagedCallable
public final UnaryCallable<ListLocationsRequest,HypercomputeClusterClient.ListLocationsPagedResponse> listLocationsPagedCallable()Lists information about the supported locations for this service.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 (HypercomputeClusterClient hypercomputeClusterClient = HypercomputeClusterClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Location> future = hypercomputeClusterClient.listLocationsPagedCallable().futureCall(request); // Do something. for (Location element : future.get().iterateAll()) { // doThingsWith(element); } } -
listLocationsCallable
Lists information about the supported locations for this service.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 (HypercomputeClusterClient hypercomputeClusterClient = HypercomputeClusterClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListLocationsResponse response = hypercomputeClusterClient.listLocationsCallable().call(request); for (Location element : response.getLocationsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getLocation
Gets information about a 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 (HypercomputeClusterClient hypercomputeClusterClient = HypercomputeClusterClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); Location response = hypercomputeClusterClient.getLocation(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getLocationCallable
Gets information about a 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 (HypercomputeClusterClient hypercomputeClusterClient = HypercomputeClusterClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); ApiFuture<Location> future = hypercomputeClusterClient.getLocationCallable().futureCall(request); // Do something. Location 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
-