Class TpuClient
- All Implemented Interfaces:
BackgroundResource,AutoCloseable
TPU API v1
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 (TpuClient tpuClient = TpuClient.create()) {
NodeName name = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]");
Node response = tpuClient.getNode(name);
}
Note: close() needs to be called on the TpuClient 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 |
|---|---|---|
ListNodes |
Lists nodes. |
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.
|
GetNode |
Gets the details of a node. |
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.
|
CreateNode |
Creates a node. |
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.
|
DeleteNode |
Deletes a node. |
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.
|
ReimageNode |
Reimages a node's OS. |
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.
|
StopNode |
Stops a node, this operation is only available with single TPU nodes. |
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.
|
StartNode |
Starts a node. |
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.
|
ListTensorFlowVersions |
List TensorFlow versions supported by this API. |
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.
|
GetTensorFlowVersion |
Gets TensorFlow Version. |
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.
|
ListAcceleratorTypes |
Lists accelerator types supported by this API. |
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.
|
GetAcceleratorType |
Gets AcceleratorType. |
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.
|
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 TpuSettings 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
TpuSettings tpuSettings =
TpuSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
TpuClient tpuClient = TpuClient.create(tpuSettings);
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
TpuSettings tpuSettings = TpuSettings.newBuilder().setEndpoint(myEndpoint).build();
TpuClient tpuClient = TpuClient.create(tpuSettings);
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 classstatic classstatic classstatic classstatic classstatic classstatic class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedTpuClient(TpuSettings settings) Constructs an instance of TpuClient, using the given settings. -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(long duration, TimeUnit unit) final voidclose()static final TpuClientcreate()Constructs an instance of TpuClient with default settings.static final TpuClientConstructs an instance of TpuClient, using the given stub for making calls.static final TpuClientcreate(TpuSettings settings) Constructs an instance of TpuClient, using the given settings.final OperationFuture<Node,OperationMetadata> createNodeAsync(CreateNodeRequest request) Creates a node.final OperationFuture<Node,OperationMetadata> createNodeAsync(LocationName parent, Node node, String nodeId) Creates a node.final OperationFuture<Node,OperationMetadata> createNodeAsync(String parent, Node node, String nodeId) Creates a node.Creates a node.Creates a node.final OperationFuture<Node,OperationMetadata> deleteNodeAsync(DeleteNodeRequest request) Deletes a node.final OperationFuture<Node,OperationMetadata> deleteNodeAsync(NodeName name) Deletes a node.final OperationFuture<Node,OperationMetadata> deleteNodeAsync(String name) Deletes a node.Deletes a node.Deletes a node.final AcceleratorTypeGets AcceleratorType.final AcceleratorTypeGets AcceleratorType.final AcceleratorTypegetAcceleratorType(String name) Gets AcceleratorType.Gets AcceleratorType.final LocationgetLocation(GetLocationRequest request) Gets information about a location.Gets information about a location.final NodegetNode(GetNodeRequest request) Gets the details of a node.final NodeGets the details of a node.final NodeGets the details of a node.final UnaryCallable<GetNodeRequest,Node> Gets the details of a node.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final TpuSettingsgetStub()final TensorFlowVersionGets TensorFlow Version.final TensorFlowVersionGets TensorFlow Version.final TensorFlowVersiongetTensorFlowVersion(String name) Gets TensorFlow Version.Gets TensorFlow Version.booleanbooleanLists accelerator types supported by this API.Lists accelerator types supported by this API.listAcceleratorTypes(String parent) Lists accelerator types supported by this API.Lists accelerator types supported by this API.Lists accelerator types supported by this API.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.listNodes(ListNodesRequest request) Lists nodes.listNodes(LocationName parent) Lists nodes.Lists nodes.Lists nodes.Lists nodes.List TensorFlow versions supported by this API.List TensorFlow versions supported by this API.listTensorFlowVersions(String parent) List TensorFlow versions supported by this API.List TensorFlow versions supported by this API.List TensorFlow versions supported by this API.final OperationFuture<Node,OperationMetadata> reimageNodeAsync(ReimageNodeRequest request) Reimages a node's OS.Reimages a node's OS.Reimages a node's OS.voidshutdown()voidfinal OperationFuture<Node,OperationMetadata> startNodeAsync(StartNodeRequest request) Starts a node.Starts a node.Starts a node.final OperationFuture<Node,OperationMetadata> stopNodeAsync(StopNodeRequest request) Stops a node, this operation is only available with single TPU nodes.Stops a node, this operation is only available with single TPU nodes.Stops a node, this operation is only available with single TPU nodes.
-
Constructor Details
-
TpuClient
Constructs an instance of TpuClient, 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
-
TpuClient
-
-
Method Details
-
create
Constructs an instance of TpuClient with default settings.- Throws:
IOException
-
create
Constructs an instance of TpuClient, 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 TpuClient, using the given stub for making calls. This is for advanced usage - prefer using create(TpuSettings). -
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. -
listNodes
Lists nodes.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 (TpuClient tpuClient = TpuClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); for (Node element : tpuClient.listNodes(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent resource name.- Throws:
ApiException- if the remote call fails
-
listNodes
Lists nodes.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 (TpuClient tpuClient = TpuClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); for (Node element : tpuClient.listNodes(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent resource name.- Throws:
ApiException- if the remote call fails
-
listNodes
Lists nodes.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 (TpuClient tpuClient = TpuClient.create()) { ListNodesRequest request = ListNodesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Node element : tpuClient.listNodes(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
-
listNodesPagedCallable
public final UnaryCallable<ListNodesRequest,TpuClient.ListNodesPagedResponse> listNodesPagedCallable()Lists nodes.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 (TpuClient tpuClient = TpuClient.create()) { ListNodesRequest request = ListNodesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Node> future = tpuClient.listNodesPagedCallable().futureCall(request); // Do something. for (Node element : future.get().iterateAll()) { // doThingsWith(element); } } -
listNodesCallable
Lists nodes.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 (TpuClient tpuClient = TpuClient.create()) { ListNodesRequest request = ListNodesRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListNodesResponse response = tpuClient.listNodesCallable().call(request); for (Node element : response.getNodesList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getNode
Gets the details of a node.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 (TpuClient tpuClient = TpuClient.create()) { NodeName name = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]"); Node response = tpuClient.getNode(name); }- Parameters:
name- Required. The resource name.- Throws:
ApiException- if the remote call fails
-
getNode
Gets the details of a node.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 (TpuClient tpuClient = TpuClient.create()) { String name = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString(); Node response = tpuClient.getNode(name); }- Parameters:
name- Required. The resource name.- Throws:
ApiException- if the remote call fails
-
getNode
Gets the details of a node.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 (TpuClient tpuClient = TpuClient.create()) { GetNodeRequest request = GetNodeRequest.newBuilder() .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) .build(); Node response = tpuClient.getNode(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getNodeCallable
Gets the details of a node.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 (TpuClient tpuClient = TpuClient.create()) { GetNodeRequest request = GetNodeRequest.newBuilder() .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) .build(); ApiFuture<Node> future = tpuClient.getNodeCallable().futureCall(request); // Do something. Node response = future.get(); } -
createNodeAsync
public final OperationFuture<Node,OperationMetadata> createNodeAsync(LocationName parent, Node node, String nodeId) Creates a node.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 (TpuClient tpuClient = TpuClient.create()) { LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]"); Node node = Node.newBuilder().build(); String nodeId = "nodeId-1040171331"; Node response = tpuClient.createNodeAsync(parent, node, nodeId).get(); }- Parameters:
parent- Required. The parent resource name.node- Required. The node.nodeId- The unqualified resource name.- Throws:
ApiException- if the remote call fails
-
createNodeAsync
public final OperationFuture<Node,OperationMetadata> createNodeAsync(String parent, Node node, String nodeId) Creates a node.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 (TpuClient tpuClient = TpuClient.create()) { String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString(); Node node = Node.newBuilder().build(); String nodeId = "nodeId-1040171331"; Node response = tpuClient.createNodeAsync(parent, node, nodeId).get(); }- Parameters:
parent- Required. The parent resource name.node- Required. The node.nodeId- The unqualified resource name.- Throws:
ApiException- if the remote call fails
-
createNodeAsync
Creates a node.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 (TpuClient tpuClient = TpuClient.create()) { CreateNodeRequest request = CreateNodeRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setNodeId("nodeId-1040171331") .setNode(Node.newBuilder().build()) .build(); Node response = tpuClient.createNodeAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createNodeOperationCallable
public final OperationCallable<CreateNodeRequest,Node, createNodeOperationCallable()OperationMetadata> Creates a node.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 (TpuClient tpuClient = TpuClient.create()) { CreateNodeRequest request = CreateNodeRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setNodeId("nodeId-1040171331") .setNode(Node.newBuilder().build()) .build(); OperationFuture<Node, OperationMetadata> future = tpuClient.createNodeOperationCallable().futureCall(request); // Do something. Node response = future.get(); } -
createNodeCallable
Creates a node.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 (TpuClient tpuClient = TpuClient.create()) { CreateNodeRequest request = CreateNodeRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setNodeId("nodeId-1040171331") .setNode(Node.newBuilder().build()) .build(); ApiFuture<Operation> future = tpuClient.createNodeCallable().futureCall(request); // Do something. Operation response = future.get(); } -
deleteNodeAsync
Deletes a node.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 (TpuClient tpuClient = TpuClient.create()) { NodeName name = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]"); Node response = tpuClient.deleteNodeAsync(name).get(); }- Parameters:
name- Required. The resource name.- Throws:
ApiException- if the remote call fails
-
deleteNodeAsync
Deletes a node.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 (TpuClient tpuClient = TpuClient.create()) { String name = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString(); Node response = tpuClient.deleteNodeAsync(name).get(); }- Parameters:
name- Required. The resource name.- Throws:
ApiException- if the remote call fails
-
deleteNodeAsync
Deletes a node.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 (TpuClient tpuClient = TpuClient.create()) { DeleteNodeRequest request = DeleteNodeRequest.newBuilder() .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) .build(); Node response = tpuClient.deleteNodeAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteNodeOperationCallable
public final OperationCallable<DeleteNodeRequest,Node, deleteNodeOperationCallable()OperationMetadata> Deletes a node.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 (TpuClient tpuClient = TpuClient.create()) { DeleteNodeRequest request = DeleteNodeRequest.newBuilder() .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) .build(); OperationFuture<Node, OperationMetadata> future = tpuClient.deleteNodeOperationCallable().futureCall(request); // Do something. Node response = future.get(); } -
deleteNodeCallable
Deletes a node.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 (TpuClient tpuClient = TpuClient.create()) { DeleteNodeRequest request = DeleteNodeRequest.newBuilder() .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString()) .build(); ApiFuture<Operation> future = tpuClient.deleteNodeCallable().futureCall(request); // Do something. Operation response = future.get(); } -
reimageNodeAsync
Reimages a node's OS.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 (TpuClient tpuClient = TpuClient.create()) { ReimageNodeRequest request = ReimageNodeRequest.newBuilder() .setName("name3373707") .setTensorflowVersion("tensorflowVersion-470125103") .build(); Node response = tpuClient.reimageNodeAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
reimageNodeOperationCallable
public final OperationCallable<ReimageNodeRequest,Node, reimageNodeOperationCallable()OperationMetadata> Reimages a node's OS.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 (TpuClient tpuClient = TpuClient.create()) { ReimageNodeRequest request = ReimageNodeRequest.newBuilder() .setName("name3373707") .setTensorflowVersion("tensorflowVersion-470125103") .build(); OperationFuture<Node, OperationMetadata> future = tpuClient.reimageNodeOperationCallable().futureCall(request); // Do something. Node response = future.get(); } -
reimageNodeCallable
Reimages a node's OS.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 (TpuClient tpuClient = TpuClient.create()) { ReimageNodeRequest request = ReimageNodeRequest.newBuilder() .setName("name3373707") .setTensorflowVersion("tensorflowVersion-470125103") .build(); ApiFuture<Operation> future = tpuClient.reimageNodeCallable().futureCall(request); // Do something. Operation response = future.get(); } -
stopNodeAsync
Stops a node, this operation is only available with single TPU nodes.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 (TpuClient tpuClient = TpuClient.create()) { StopNodeRequest request = StopNodeRequest.newBuilder().setName("name3373707").build(); Node response = tpuClient.stopNodeAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
stopNodeOperationCallable
Stops a node, this operation is only available with single TPU nodes.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 (TpuClient tpuClient = TpuClient.create()) { StopNodeRequest request = StopNodeRequest.newBuilder().setName("name3373707").build(); OperationFuture<Node, OperationMetadata> future = tpuClient.stopNodeOperationCallable().futureCall(request); // Do something. Node response = future.get(); } -
stopNodeCallable
Stops a node, this operation is only available with single TPU nodes.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 (TpuClient tpuClient = TpuClient.create()) { StopNodeRequest request = StopNodeRequest.newBuilder().setName("name3373707").build(); ApiFuture<Operation> future = tpuClient.stopNodeCallable().futureCall(request); // Do something. Operation response = future.get(); } -
startNodeAsync
Starts a node.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 (TpuClient tpuClient = TpuClient.create()) { StartNodeRequest request = StartNodeRequest.newBuilder().setName("name3373707").build(); Node response = tpuClient.startNodeAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
startNodeOperationCallable
public final OperationCallable<StartNodeRequest,Node, startNodeOperationCallable()OperationMetadata> Starts a node.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 (TpuClient tpuClient = TpuClient.create()) { StartNodeRequest request = StartNodeRequest.newBuilder().setName("name3373707").build(); OperationFuture<Node, OperationMetadata> future = tpuClient.startNodeOperationCallable().futureCall(request); // Do something. Node response = future.get(); } -
startNodeCallable
Starts a node.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 (TpuClient tpuClient = TpuClient.create()) { StartNodeRequest request = StartNodeRequest.newBuilder().setName("name3373707").build(); ApiFuture<Operation> future = tpuClient.startNodeCallable().futureCall(request); // Do something. Operation response = future.get(); } -
listTensorFlowVersions
public final TpuClient.ListTensorFlowVersionsPagedResponse listTensorFlowVersions(TensorFlowVersionName parent) List TensorFlow versions supported by this API.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 (TpuClient tpuClient = TpuClient.create()) { TensorFlowVersionName parent = TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]"); for (TensorFlowVersion element : tpuClient.listTensorFlowVersions(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent resource name.- Throws:
ApiException- if the remote call fails
-
listTensorFlowVersions
List TensorFlow versions supported by this API.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 (TpuClient tpuClient = TpuClient.create()) { String parent = TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]").toString(); for (TensorFlowVersion element : tpuClient.listTensorFlowVersions(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent resource name.- Throws:
ApiException- if the remote call fails
-
listTensorFlowVersions
public final TpuClient.ListTensorFlowVersionsPagedResponse listTensorFlowVersions(ListTensorFlowVersionsRequest request) List TensorFlow versions supported by this API.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 (TpuClient tpuClient = TpuClient.create()) { ListTensorFlowVersionsRequest request = ListTensorFlowVersionsRequest.newBuilder() .setParent( TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]") .toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (TensorFlowVersion element : tpuClient.listTensorFlowVersions(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
-
listTensorFlowVersionsPagedCallable
public final UnaryCallable<ListTensorFlowVersionsRequest,TpuClient.ListTensorFlowVersionsPagedResponse> listTensorFlowVersionsPagedCallable()List TensorFlow versions supported by this API.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 (TpuClient tpuClient = TpuClient.create()) { ListTensorFlowVersionsRequest request = ListTensorFlowVersionsRequest.newBuilder() .setParent( TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]") .toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<TensorFlowVersion> future = tpuClient.listTensorFlowVersionsPagedCallable().futureCall(request); // Do something. for (TensorFlowVersion element : future.get().iterateAll()) { // doThingsWith(element); } } -
listTensorFlowVersionsCallable
public final UnaryCallable<ListTensorFlowVersionsRequest,ListTensorFlowVersionsResponse> listTensorFlowVersionsCallable()List TensorFlow versions supported by this API.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 (TpuClient tpuClient = TpuClient.create()) { ListTensorFlowVersionsRequest request = ListTensorFlowVersionsRequest.newBuilder() .setParent( TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]") .toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListTensorFlowVersionsResponse response = tpuClient.listTensorFlowVersionsCallable().call(request); for (TensorFlowVersion element : response.getTensorflowVersionsList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getTensorFlowVersion
Gets TensorFlow Version.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 (TpuClient tpuClient = TpuClient.create()) { TensorFlowVersionName name = TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]"); TensorFlowVersion response = tpuClient.getTensorFlowVersion(name); }- Parameters:
name- Required. The resource name.- Throws:
ApiException- if the remote call fails
-
getTensorFlowVersion
Gets TensorFlow Version.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 (TpuClient tpuClient = TpuClient.create()) { String name = TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]").toString(); TensorFlowVersion response = tpuClient.getTensorFlowVersion(name); }- Parameters:
name- Required. The resource name.- Throws:
ApiException- if the remote call fails
-
getTensorFlowVersion
Gets TensorFlow Version.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 (TpuClient tpuClient = TpuClient.create()) { GetTensorFlowVersionRequest request = GetTensorFlowVersionRequest.newBuilder() .setName( TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]") .toString()) .build(); TensorFlowVersion response = tpuClient.getTensorFlowVersion(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getTensorFlowVersionCallable
public final UnaryCallable<GetTensorFlowVersionRequest,TensorFlowVersion> getTensorFlowVersionCallable()Gets TensorFlow Version.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 (TpuClient tpuClient = TpuClient.create()) { GetTensorFlowVersionRequest request = GetTensorFlowVersionRequest.newBuilder() .setName( TensorFlowVersionName.of("[PROJECT]", "[LOCATION]", "[TENSOR_FLOW_VERSION]") .toString()) .build(); ApiFuture<TensorFlowVersion> future = tpuClient.getTensorFlowVersionCallable().futureCall(request); // Do something. TensorFlowVersion response = future.get(); } -
listAcceleratorTypes
public final TpuClient.ListAcceleratorTypesPagedResponse listAcceleratorTypes(AcceleratorTypeName parent) Lists accelerator types supported by this API.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 (TpuClient tpuClient = TpuClient.create()) { AcceleratorTypeName parent = AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]"); for (AcceleratorType element : tpuClient.listAcceleratorTypes(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent resource name.- Throws:
ApiException- if the remote call fails
-
listAcceleratorTypes
Lists accelerator types supported by this API.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 (TpuClient tpuClient = TpuClient.create()) { String parent = AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]").toString(); for (AcceleratorType element : tpuClient.listAcceleratorTypes(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The parent resource name.- Throws:
ApiException- if the remote call fails
-
listAcceleratorTypes
public final TpuClient.ListAcceleratorTypesPagedResponse listAcceleratorTypes(ListAcceleratorTypesRequest request) Lists accelerator types supported by this API.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 (TpuClient tpuClient = TpuClient.create()) { ListAcceleratorTypesRequest request = ListAcceleratorTypesRequest.newBuilder() .setParent( AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]") .toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); for (AcceleratorType element : tpuClient.listAcceleratorTypes(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
-
listAcceleratorTypesPagedCallable
public final UnaryCallable<ListAcceleratorTypesRequest,TpuClient.ListAcceleratorTypesPagedResponse> listAcceleratorTypesPagedCallable()Lists accelerator types supported by this API.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 (TpuClient tpuClient = TpuClient.create()) { ListAcceleratorTypesRequest request = ListAcceleratorTypesRequest.newBuilder() .setParent( AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]") .toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); ApiFuture<AcceleratorType> future = tpuClient.listAcceleratorTypesPagedCallable().futureCall(request); // Do something. for (AcceleratorType element : future.get().iterateAll()) { // doThingsWith(element); } } -
listAcceleratorTypesCallable
public final UnaryCallable<ListAcceleratorTypesRequest,ListAcceleratorTypesResponse> listAcceleratorTypesCallable()Lists accelerator types supported by this API.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 (TpuClient tpuClient = TpuClient.create()) { ListAcceleratorTypesRequest request = ListAcceleratorTypesRequest.newBuilder() .setParent( AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]") .toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .setFilter("filter-1274492040") .setOrderBy("orderBy-1207110587") .build(); while (true) { ListAcceleratorTypesResponse response = tpuClient.listAcceleratorTypesCallable().call(request); for (AcceleratorType element : response.getAcceleratorTypesList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
getAcceleratorType
Gets AcceleratorType.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 (TpuClient tpuClient = TpuClient.create()) { AcceleratorTypeName name = AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]"); AcceleratorType response = tpuClient.getAcceleratorType(name); }- Parameters:
name- Required. The resource name.- Throws:
ApiException- if the remote call fails
-
getAcceleratorType
Gets AcceleratorType.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 (TpuClient tpuClient = TpuClient.create()) { String name = AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]").toString(); AcceleratorType response = tpuClient.getAcceleratorType(name); }- Parameters:
name- Required. The resource name.- Throws:
ApiException- if the remote call fails
-
getAcceleratorType
Gets AcceleratorType.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 (TpuClient tpuClient = TpuClient.create()) { GetAcceleratorTypeRequest request = GetAcceleratorTypeRequest.newBuilder() .setName( AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]") .toString()) .build(); AcceleratorType response = tpuClient.getAcceleratorType(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getAcceleratorTypeCallable
Gets AcceleratorType.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 (TpuClient tpuClient = TpuClient.create()) { GetAcceleratorTypeRequest request = GetAcceleratorTypeRequest.newBuilder() .setName( AcceleratorTypeName.of("[PROJECT]", "[LOCATION]", "[ACCELERATOR_TYPE]") .toString()) .build(); ApiFuture<AcceleratorType> future = tpuClient.getAcceleratorTypeCallable().futureCall(request); // Do something. AcceleratorType response = future.get(); } -
listLocations
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 (TpuClient tpuClient = TpuClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (Location element : tpuClient.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,TpuClient.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 (TpuClient tpuClient = TpuClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<Location> future = tpuClient.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 (TpuClient tpuClient = TpuClient.create()) { ListLocationsRequest request = ListLocationsRequest.newBuilder() .setName("name3373707") .setFilter("filter-1274492040") .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListLocationsResponse response = tpuClient.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 (TpuClient tpuClient = TpuClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); Location response = tpuClient.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 (TpuClient tpuClient = TpuClient.create()) { GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build(); ApiFuture<Location> future = tpuClient.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
-