# Class TpuClient (2.94.0)

2.94.0 (latest) 2.92.0 2.89.0 2.88.0 2.86.0 2.84.0 2.83.0 2.81.0 2.79.0 2.77.0 2.76.0 2.75.0 2.74.0 2.73.0 2.71.0 2.69.0 2.68.0 2.65.0 2.64.0 2.63.0 2.61.0 2.60.0 2.59.0 2.58.0 2.57.0 2.56.0 2.55.0 2.54.0 2.53.0 2.52.0 2.50.0 2.49.0 2.48.0 2.47.0 2.46.0 2.45.0 2.44.0 2.43.0 2.42.0 2.41.0 2.40.0 2.38.0 2.37.0 2.36.0 2.35.0 2.34.0 2.33.0 2.32.0 2.31.0 2.30.0 2.29.0 2.28.0 2.25.0 2.24.0 2.23.0 2.22.0 2.21.0 2.20.0 2.19.0 2.18.0 2.17.0 2.16.0 2.15.0 2.14.0 2.13.0 2.12.0 2.10.0 2.9.0 2.8.0 2.7.0 2.6.0 2.5.0 2.2.6

|---|---|---|
| [GitHub Repository](https://github.com/googleapis/google-cloud-java/tree/main/java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2/TpuClient.java) | [Product Reference](https://cloud.google.com/tpu/docs) | [REST Documentation](https://cloud.google.com/tpu/docs/reference/rest) |

Service Description: Manages TPU nodes and other resources

TPU API v2

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. - listNodes(ListNodesRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - listNodes(LocationName parent) - listNodes(String parent) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - listNodesPagedCallable() - listNodesCallable() |
| 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. - getNode(GetNodeRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - getNode(NodeName name) - getNode(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - getNodeCallable() |
| CreateNode | Creates a node. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - createNodeAsync(CreateNodeRequest request) Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. - createNodeAsync(LocationName parent, Node node, String nodeId) - createNodeAsync(String parent, Node node, String nodeId) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - createNodeOperationCallable() - createNodeCallable() |
| DeleteNode | Deletes a node. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - deleteNodeAsync(DeleteNodeRequest request) Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. - deleteNodeAsync(NodeName name) - deleteNodeAsync(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - deleteNodeOperationCallable() - deleteNodeCallable() |
| 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. - stopNodeAsync(StopNodeRequest request) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - stopNodeOperationCallable() - stopNodeCallable() |
| StartNode | Starts a node. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - startNodeAsync(StartNodeRequest request) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - startNodeOperationCallable() - startNodeCallable() |
| UpdateNode | Updates the configurations of a node. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - updateNodeAsync(UpdateNodeRequest request) Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. - updateNodeAsync(Node node, FieldMask updateMask) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - updateNodeOperationCallable() - updateNodeCallable() |
| ListQueuedResources | Lists queued resources. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - listQueuedResources(ListQueuedResourcesRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - listQueuedResources(LocationName parent) - listQueuedResources(String parent) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - listQueuedResourcesPagedCallable() - listQueuedResourcesCallable() |
| GetQueuedResource | Gets details of a queued resource. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - getQueuedResource(GetQueuedResourceRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - getQueuedResource(QueuedResourceName name) - getQueuedResource(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - getQueuedResourceCallable() |
| CreateQueuedResource | Creates a QueuedResource TPU instance. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - createQueuedResourceAsync(CreateQueuedResourceRequest request) Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. - createQueuedResourceAsync(LocationName parent, QueuedResource queuedResource, String queuedResourceId) - createQueuedResourceAsync(String parent, QueuedResource queuedResource, String queuedResourceId) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - createQueuedResourceOperationCallable() - createQueuedResourceCallable() |
| DeleteQueuedResource | Deletes a QueuedResource TPU instance. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - deleteQueuedResourceAsync(DeleteQueuedResourceRequest request) Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. - deleteQueuedResourceAsync(QueuedResourceName name) - deleteQueuedResourceAsync(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - deleteQueuedResourceOperationCallable() - deleteQueuedResourceCallable() |
| ResetQueuedResource | Resets a QueuedResource TPU instance | Request object method variants only take one parameter, a request object, which must be constructed before the call. - resetQueuedResourceAsync(ResetQueuedResourceRequest request) Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service. - resetQueuedResourceAsync(QueuedResourceName name) - resetQueuedResourceAsync(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - resetQueuedResourceOperationCallable() - resetQueuedResourceCallable() |
| GenerateServiceIdentity | Generates the Cloud TPU service identity for the project. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - generateServiceIdentity(GenerateServiceIdentityRequest request) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - generateServiceIdentityCallable() |
| 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. - listAcceleratorTypes(ListAcceleratorTypesRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - listAcceleratorTypes(LocationName parent) - listAcceleratorTypes(String parent) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - listAcceleratorTypesPagedCallable() - listAcceleratorTypesCallable() |
| GetAcceleratorType | Gets AcceleratorType. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - getAcceleratorType(GetAcceleratorTypeRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - getAcceleratorType(AcceleratorTypeName name) - getAcceleratorType(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - getAcceleratorTypeCallable() |
| ListRuntimeVersions | Lists runtime versions supported by this API. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - listRuntimeVersions(ListRuntimeVersionsRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - listRuntimeVersions(LocationName parent) - listRuntimeVersions(String parent) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - listRuntimeVersionsPagedCallable() - listRuntimeVersionsCallable() |
| GetRuntimeVersion | Gets a runtime version. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - getRuntimeVersion(GetRuntimeVersionRequest request) "Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method. - getRuntimeVersion(RuntimeVersionName name) - getRuntimeVersion(String name) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - getRuntimeVersionCallable() |
| GetGuestAttributes | Retrieves the guest attributes for the node. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - getGuestAttributes(GetGuestAttributesRequest request) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - getGuestAttributesCallable() |
| 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. - listLocations(ListLocationsRequest request) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - listLocationsPagedCallable() - listLocationsCallable() |
| GetLocation | Gets information about a location. | Request object method variants only take one parameter, a request object, which must be constructed before the call. - getLocation(GetLocationRequest request) Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service. - getLocationCallable() |
[Methods]

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);
     
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
     TpuSettings tpuSettings = TpuSettings.newHttpJsonBuilder().build();
     TpuClient tpuClient = TpuClient.create(tpuSettings);
     
Please refer to the GitHub repository's samples for more quickstart code snippets.

## Inheritance

[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \> TpuClient

## Static Methods

### create()

    public static final TpuClient create()

Constructs an instance of TpuClient with default settings.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.TpuClient` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### create(TpuSettings settings)

    public static final TpuClient create(TpuSettings settings)

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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `settings` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.TpuSettings` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.TpuClient` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html` |   |

### create(TpuStub stub)

    public static final TpuClient create(TpuStub stub)

Constructs an instance of TpuClient, using the given stub for making calls. This is for
advanced usage - prefer using create(TpuSettings).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `stub` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.stub.TpuStub` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.TpuClient` |   |

## Constructors

### TpuClient(TpuSettings settings)

    protected TpuClient(TpuSettings settings)

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.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `settings` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.TpuSettings` |

### TpuClient(TpuStub stub)

    protected TpuClient(TpuStub stub)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `stub` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.stub.TpuStub` |

## Methods

### awaitTermination(long duration, TimeUnit unit)

    public boolean awaitTermination(long duration, TimeUnit unit)

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `duration` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |
| `unit` | `https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/TimeUnit.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

| **Exceptions** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/InterruptedException.html` |   |

### close()

    public final void close()

### createNodeAsync(CreateNodeRequest request)

    public final OperationFuture<Node,OperationMetadata> createNodeAsync(CreateNodeRequest request)

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();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.CreateNodeRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.Node,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.OperationMetadata>` |   |

### createNodeAsync(LocationName parent, Node node, String nodeId)

    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** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.LocationName` Required. The parent resource name. |
| `node` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.Node` Required. The node. |
| `nodeId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` The unqualified resource name. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.Node,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.OperationMetadata>` |   |

### createNodeAsync(String parent, Node node, String nodeId)

    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** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The parent resource name. |
| `node` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.Node` Required. The node. |
| `nodeId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` The unqualified resource name. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.Node,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.OperationMetadata>` |   |

### createNodeCallable()

    public final UnaryCallable<CreateNodeRequest,Operation> 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();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.CreateNodeRequest,https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.Operation.html>` |   |

### createNodeOperationCallable()

    public final OperationCallable<CreateNodeRequest,Node,OperationMetadata> createNodeOperationCallable()

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();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.OperationCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.CreateNodeRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.Node,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.OperationMetadata>` |   |

### createQueuedResourceAsync(CreateQueuedResourceRequest request)

    public final OperationFuture<QueuedResource,OperationMetadata> createQueuedResourceAsync(CreateQueuedResourceRequest request)

Creates a QueuedResource TPU instance.

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()) {
       CreateQueuedResourceRequest request =
           CreateQueuedResourceRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setQueuedResourceId("queuedResourceId437646236")
               .setQueuedResource(QueuedResource.newBuilder().build())
               .setRequestId("requestId693933066")
               .build();
       QueuedResource response = tpuClient.createQueuedResourceAsync(request).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.CreateQueuedResourceRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.QueuedResource,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.OperationMetadata>` |   |

### createQueuedResourceAsync(LocationName parent, QueuedResource queuedResource, String queuedResourceId)

    public final OperationFuture<QueuedResource,OperationMetadata> createQueuedResourceAsync(LocationName parent, QueuedResource queuedResource, String queuedResourceId)

Creates a QueuedResource TPU instance.

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]");
       QueuedResource queuedResource = QueuedResource.newBuilder().build();
       String queuedResourceId = "queuedResourceId437646236";
       QueuedResource response =
           tpuClient.createQueuedResourceAsync(parent, queuedResource, queuedResourceId).get();
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.LocationName` Required. The parent resource name. |
| `queuedResource` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.QueuedResource` Required. The queued resource. |
| `queuedResourceId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Optional. The unqualified resource name. Should follow the `^[A-Za-z0-9_.~+%-]+$` regex format. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.QueuedResource,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.OperationMetadata>` |   |

### createQueuedResourceAsync(String parent, QueuedResource queuedResource, String queuedResourceId)

    public final OperationFuture<QueuedResource,OperationMetadata> createQueuedResourceAsync(String parent, QueuedResource queuedResource, String queuedResourceId)

Creates a QueuedResource TPU instance.

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();
       QueuedResource queuedResource = QueuedResource.newBuilder().build();
       String queuedResourceId = "queuedResourceId437646236";
       QueuedResource response =
           tpuClient.createQueuedResourceAsync(parent, queuedResource, queuedResourceId).get();
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The parent resource name. |
| `queuedResource` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.QueuedResource` Required. The queued resource. |
| `queuedResourceId` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Optional. The unqualified resource name. Should follow the `^[A-Za-z0-9_.~+%-]+$` regex format. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.QueuedResource,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.OperationMetadata>` |   |

### createQueuedResourceCallable()

    public final UnaryCallable<CreateQueuedResourceRequest,Operation> createQueuedResourceCallable()

Creates a QueuedResource TPU instance.

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()) {
       CreateQueuedResourceRequest request =
           CreateQueuedResourceRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setQueuedResourceId("queuedResourceId437646236")
               .setQueuedResource(QueuedResource.newBuilder().build())
               .setRequestId("requestId693933066")
               .build();
       ApiFuture<Operation> future = tpuClient.createQueuedResourceCallable().futureCall(request);
       // Do something.
       Operation response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.CreateQueuedResourceRequest,https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.Operation.html>` |   |

### createQueuedResourceOperationCallable()

    public final OperationCallable<CreateQueuedResourceRequest,QueuedResource,OperationMetadata> createQueuedResourceOperationCallable()

Creates a QueuedResource TPU instance.

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()) {
       CreateQueuedResourceRequest request =
           CreateQueuedResourceRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setQueuedResourceId("queuedResourceId437646236")
               .setQueuedResource(QueuedResource.newBuilder().build())
               .setRequestId("requestId693933066")
               .build();
       OperationFuture<QueuedResource, OperationMetadata> future =
           tpuClient.createQueuedResourceOperationCallable().futureCall(request);
       // Do something.
       QueuedResource response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.OperationCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.CreateQueuedResourceRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.QueuedResource,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.OperationMetadata>` |   |

### deleteNodeAsync(DeleteNodeRequest request)

    public final OperationFuture<Empty,OperationMetadata> deleteNodeAsync(DeleteNodeRequest request)

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();
       tpuClient.deleteNodeAsync(request).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.DeleteNodeRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.OperationMetadata>` |   |

### deleteNodeAsync(NodeName name)

    public final OperationFuture<Empty,OperationMetadata> deleteNodeAsync(NodeName name)

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]");
       tpuClient.deleteNodeAsync(name).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.NodeName` Required. The resource name. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.OperationMetadata>` |   |

### deleteNodeAsync(String name)

    public final OperationFuture<Empty,OperationMetadata> deleteNodeAsync(String name)

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();
       tpuClient.deleteNodeAsync(name).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The resource name. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.OperationMetadata>` |   |

### deleteNodeCallable()

    public final UnaryCallable<DeleteNodeRequest,Operation> 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.
       future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.DeleteNodeRequest,https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.Operation.html>` |   |

### deleteNodeOperationCallable()

    public final OperationCallable<DeleteNodeRequest,Empty,OperationMetadata> deleteNodeOperationCallable()

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<Empty, OperationMetadata> future =
           tpuClient.deleteNodeOperationCallable().futureCall(request);
       // Do something.
       future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.OperationCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.DeleteNodeRequest,https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.OperationMetadata>` |   |

### deleteQueuedResourceAsync(DeleteQueuedResourceRequest request)

    public final OperationFuture<Empty,OperationMetadata> deleteQueuedResourceAsync(DeleteQueuedResourceRequest request)

Deletes a QueuedResource TPU instance.

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()) {
       DeleteQueuedResourceRequest request =
           DeleteQueuedResourceRequest.newBuilder()
               .setName(
                   QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]").toString())
               .setRequestId("requestId693933066")
               .setForce(true)
               .build();
       tpuClient.deleteQueuedResourceAsync(request).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.DeleteQueuedResourceRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.OperationMetadata>` |   |

### deleteQueuedResourceAsync(QueuedResourceName name)

    public final OperationFuture<Empty,OperationMetadata> deleteQueuedResourceAsync(QueuedResourceName name)

Deletes a QueuedResource TPU instance.

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()) {
       QueuedResourceName name =
           QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]");
       tpuClient.deleteQueuedResourceAsync(name).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.QueuedResourceName` Required. The resource name. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.OperationMetadata>` |   |

### deleteQueuedResourceAsync(String name)

    public final OperationFuture<Empty,OperationMetadata> deleteQueuedResourceAsync(String name)

Deletes a QueuedResource TPU instance.

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 =
           QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]").toString();
       tpuClient.deleteQueuedResourceAsync(name).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The resource name. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.OperationMetadata>` |   |

### deleteQueuedResourceCallable()

    public final UnaryCallable<DeleteQueuedResourceRequest,Operation> deleteQueuedResourceCallable()

Deletes a QueuedResource TPU instance.

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()) {
       DeleteQueuedResourceRequest request =
           DeleteQueuedResourceRequest.newBuilder()
               .setName(
                   QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]").toString())
               .setRequestId("requestId693933066")
               .setForce(true)
               .build();
       ApiFuture<Operation> future = tpuClient.deleteQueuedResourceCallable().futureCall(request);
       // Do something.
       future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.DeleteQueuedResourceRequest,https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.Operation.html>` |   |

### deleteQueuedResourceOperationCallable()

    public final OperationCallable<DeleteQueuedResourceRequest,Empty,OperationMetadata> deleteQueuedResourceOperationCallable()

Deletes a QueuedResource TPU instance.

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()) {
       DeleteQueuedResourceRequest request =
           DeleteQueuedResourceRequest.newBuilder()
               .setName(
                   QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]").toString())
               .setRequestId("requestId693933066")
               .setForce(true)
               .build();
       OperationFuture<Empty, OperationMetadata> future =
           tpuClient.deleteQueuedResourceOperationCallable().futureCall(request);
       // Do something.
       future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.OperationCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.DeleteQueuedResourceRequest,https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.Empty.html,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.OperationMetadata>` |   |

### generateServiceIdentity(GenerateServiceIdentityRequest request)

    public final GenerateServiceIdentityResponse generateServiceIdentity(GenerateServiceIdentityRequest request)

Generates the Cloud TPU service identity for the project.

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()) {
       GenerateServiceIdentityRequest request =
           GenerateServiceIdentityRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .build();
       GenerateServiceIdentityResponse response = tpuClient.generateServiceIdentity(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.GenerateServiceIdentityRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.GenerateServiceIdentityResponse` |   |

### generateServiceIdentityCallable()

    public final UnaryCallable<GenerateServiceIdentityRequest,GenerateServiceIdentityResponse> generateServiceIdentityCallable()

Generates the Cloud TPU service identity for the project.

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()) {
       GenerateServiceIdentityRequest request =
           GenerateServiceIdentityRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .build();
       ApiFuture<GenerateServiceIdentityResponse> future =
           tpuClient.generateServiceIdentityCallable().futureCall(request);
       // Do something.
       GenerateServiceIdentityResponse response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.GenerateServiceIdentityRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.GenerateServiceIdentityResponse>` |   |

### getAcceleratorType(AcceleratorTypeName name)

    public final AcceleratorType getAcceleratorType(AcceleratorTypeName name)

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);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.AcceleratorTypeName` Required. The resource name. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.AcceleratorType` |   |

### getAcceleratorType(GetAcceleratorTypeRequest request)

    public final AcceleratorType getAcceleratorType(GetAcceleratorTypeRequest request)

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);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.GetAcceleratorTypeRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.AcceleratorType` |   |

### getAcceleratorType(String name)

    public final AcceleratorType getAcceleratorType(String name)

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);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The resource name. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.AcceleratorType` |   |

### getAcceleratorTypeCallable()

    public final UnaryCallable<GetAcceleratorTypeRequest,AcceleratorType> 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();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.GetAcceleratorTypeRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.AcceleratorType>` |   |

### getGuestAttributes(GetGuestAttributesRequest request)

    public final GetGuestAttributesResponse getGuestAttributes(GetGuestAttributesRequest request)

Retrieves the guest attributes for the 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()) {
       GetGuestAttributesRequest request =
           GetGuestAttributesRequest.newBuilder()
               .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString())
               .setQueryPath("queryPath-1807004403")
               .addAllWorkerIds(new ArrayList<String>())
               .build();
       GetGuestAttributesResponse response = tpuClient.getGuestAttributes(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.GetGuestAttributesRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.GetGuestAttributesResponse` |   |

### getGuestAttributesCallable()

    public final UnaryCallable<GetGuestAttributesRequest,GetGuestAttributesResponse> getGuestAttributesCallable()

Retrieves the guest attributes for the 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()) {
       GetGuestAttributesRequest request =
           GetGuestAttributesRequest.newBuilder()
               .setName(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString())
               .setQueryPath("queryPath-1807004403")
               .addAllWorkerIds(new ArrayList<String>())
               .build();
       ApiFuture<GetGuestAttributesResponse> future =
           tpuClient.getGuestAttributesCallable().futureCall(request);
       // Do something.
       GetGuestAttributesResponse response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.GetGuestAttributesRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.GetGuestAttributesResponse>` |   |

### getHttpJsonOperationsClient()

    public final OperationsClient getHttpJsonOperationsClient()

> [!WARNING]
> **Beta**
>
> This feature is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1) of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see the launch stage descriptions.

Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.httpjson.longrunning.OperationsClient.html` |   |

### getLocation(GetLocationRequest request)

    public final Location getLocation(GetLocationRequest request)

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);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `com.google.cloud.location.GetLocationRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `com.google.cloud.location.Location` |   |

### getLocationCallable()

    public final UnaryCallable<GetLocationRequest,Location> 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();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location>` |   |

### getNode(GetNodeRequest request)

    public final Node getNode(GetNodeRequest request)

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);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.GetNodeRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.Node` |   |

### getNode(NodeName name)

    public final Node getNode(NodeName name)

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);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.NodeName` Required. The resource name. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.Node` |   |

### getNode(String name)

    public final Node getNode(String name)

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);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The resource name. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.Node` |   |

### getNodeCallable()

    public final UnaryCallable<GetNodeRequest,Node> 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();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.GetNodeRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.Node>` |   |

### getOperationsClient()

    public final OperationsClient getOperationsClient()

Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.OperationsClient.html` |   |

### getQueuedResource(GetQueuedResourceRequest request)

    public final QueuedResource getQueuedResource(GetQueuedResourceRequest request)

Gets details of a queued resource.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (TpuClient tpuClient = TpuClient.create()) {
       GetQueuedResourceRequest request =
           GetQueuedResourceRequest.newBuilder()
               .setName(
                   QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]").toString())
               .build();
       QueuedResource response = tpuClient.getQueuedResource(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.GetQueuedResourceRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.QueuedResource` |   |

### getQueuedResource(QueuedResourceName name)

    public final QueuedResource getQueuedResource(QueuedResourceName name)

Gets details of a queued resource.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (TpuClient tpuClient = TpuClient.create()) {
       QueuedResourceName name =
           QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]");
       QueuedResource response = tpuClient.getQueuedResource(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.QueuedResourceName` Required. The resource name. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.QueuedResource` |   |

### getQueuedResource(String name)

    public final QueuedResource getQueuedResource(String name)

Gets details of a queued resource.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (TpuClient tpuClient = TpuClient.create()) {
       String name =
           QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]").toString();
       QueuedResource response = tpuClient.getQueuedResource(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The resource name. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.QueuedResource` |   |

### getQueuedResourceCallable()

    public final UnaryCallable<GetQueuedResourceRequest,QueuedResource> getQueuedResourceCallable()

Gets details of a queued resource.

Sample code:


     // This snippet has been automatically generated and should be regarded as a code template only.
     // It will require modifications to work:
     // - It may require correct/in-range values for request initialization.
     // - It may require specifying regional endpoints when creating the service client as shown in
     // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
     try (TpuClient tpuClient = TpuClient.create()) {
       GetQueuedResourceRequest request =
           GetQueuedResourceRequest.newBuilder()
               .setName(
                   QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]").toString())
               .build();
       ApiFuture<QueuedResource> future = tpuClient.getQueuedResourceCallable().futureCall(request);
       // Do something.
       QueuedResource response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.GetQueuedResourceRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.QueuedResource>` |   |

### getRuntimeVersion(GetRuntimeVersionRequest request)

    public final RuntimeVersion getRuntimeVersion(GetRuntimeVersionRequest request)

Gets a runtime 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()) {
       GetRuntimeVersionRequest request =
           GetRuntimeVersionRequest.newBuilder()
               .setName(
                   RuntimeVersionName.of("[PROJECT]", "[LOCATION]", "[RUNTIME_VERSION]").toString())
               .build();
       RuntimeVersion response = tpuClient.getRuntimeVersion(request);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.GetRuntimeVersionRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.RuntimeVersion` |   |

### getRuntimeVersion(RuntimeVersionName name)

    public final RuntimeVersion getRuntimeVersion(RuntimeVersionName name)

Gets a runtime 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()) {
       RuntimeVersionName name =
           RuntimeVersionName.of("[PROJECT]", "[LOCATION]", "[RUNTIME_VERSION]");
       RuntimeVersion response = tpuClient.getRuntimeVersion(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.RuntimeVersionName` Required. The resource name. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.RuntimeVersion` |   |

### getRuntimeVersion(String name)

    public final RuntimeVersion getRuntimeVersion(String name)

Gets a runtime 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 =
           RuntimeVersionName.of("[PROJECT]", "[LOCATION]", "[RUNTIME_VERSION]").toString();
       RuntimeVersion response = tpuClient.getRuntimeVersion(name);
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The resource name. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.RuntimeVersion` |   |

### getRuntimeVersionCallable()

    public final UnaryCallable<GetRuntimeVersionRequest,RuntimeVersion> getRuntimeVersionCallable()

Gets a runtime 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()) {
       GetRuntimeVersionRequest request =
           GetRuntimeVersionRequest.newBuilder()
               .setName(
                   RuntimeVersionName.of("[PROJECT]", "[LOCATION]", "[RUNTIME_VERSION]").toString())
               .build();
       ApiFuture<RuntimeVersion> future = tpuClient.getRuntimeVersionCallable().futureCall(request);
       // Do something.
       RuntimeVersion response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.GetRuntimeVersionRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.RuntimeVersion>` |   |

### getSettings()

    public final TpuSettings getSettings()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.TpuSettings` |   |

### getStub()

    public TpuStub getStub()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.stub.TpuStub` |   |

### isShutdown()

    public boolean isShutdown()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### isTerminated()

    public boolean isTerminated()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### listAcceleratorTypes(ListAcceleratorTypesRequest request)

    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(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .setFilter("filter-1274492040")
               .setOrderBy("orderBy-1207110587")
               .build();
       for (AcceleratorType element : tpuClient.listAcceleratorTypes(request).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.ListAcceleratorTypesRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.TpuClient.ListAcceleratorTypesPagedResponse` |   |

### listAcceleratorTypes(LocationName parent)

    public final TpuClient.ListAcceleratorTypesPagedResponse listAcceleratorTypes(LocationName 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()) {
       LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
       for (AcceleratorType element : tpuClient.listAcceleratorTypes(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.LocationName` Required. The parent resource name. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.TpuClient.ListAcceleratorTypesPagedResponse` |   |

### listAcceleratorTypes(String parent)

    public final TpuClient.ListAcceleratorTypesPagedResponse listAcceleratorTypes(String 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()) {
       String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
       for (AcceleratorType element : tpuClient.listAcceleratorTypes(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The parent resource name. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.TpuClient.ListAcceleratorTypesPagedResponse` |   |

### 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(LocationName.of("[PROJECT]", "[LOCATION]").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;
         }
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.ListAcceleratorTypesRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.ListAcceleratorTypesResponse>` |   |

### 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(LocationName.of("[PROJECT]", "[LOCATION]").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);
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.ListAcceleratorTypesRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.TpuClient.ListAcceleratorTypesPagedResponse>` |   |

### listLocations(ListLocationsRequest request)

    public final TpuClient.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 (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);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `com.google.cloud.location.ListLocationsRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.TpuClient.ListLocationsPagedResponse` |   |

### listLocationsCallable()

    public final UnaryCallable<ListLocationsRequest,ListLocationsResponse> 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;
         }
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse>` |   |

### 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);
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<com.google.cloud.location.ListLocationsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.TpuClient.ListLocationsPagedResponse>` |   |

### listNodes(ListNodesRequest request)

    public final TpuClient.ListNodesPagedResponse listNodes(ListNodesRequest request)

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);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.ListNodesRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.TpuClient.ListNodesPagedResponse` |   |

### listNodes(LocationName parent)

    public final TpuClient.ListNodesPagedResponse listNodes(LocationName parent)

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);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.LocationName` Required. The parent resource name. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.TpuClient.ListNodesPagedResponse` |   |

### listNodes(String parent)

    public final TpuClient.ListNodesPagedResponse listNodes(String parent)

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);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The parent resource name. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.TpuClient.ListNodesPagedResponse` |   |

### listNodesCallable()

    public final UnaryCallable<ListNodesRequest,ListNodesResponse> 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;
         }
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.ListNodesRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.ListNodesResponse>` |   |

### 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);
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.ListNodesRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.TpuClient.ListNodesPagedResponse>` |   |

### listQueuedResources(ListQueuedResourcesRequest request)

    public final TpuClient.ListQueuedResourcesPagedResponse listQueuedResources(ListQueuedResourcesRequest request)

Lists queued resources.

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()) {
       ListQueuedResourcesRequest request =
           ListQueuedResourcesRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       for (QueuedResource element : tpuClient.listQueuedResources(request).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.ListQueuedResourcesRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.TpuClient.ListQueuedResourcesPagedResponse` |   |

### listQueuedResources(LocationName parent)

    public final TpuClient.ListQueuedResourcesPagedResponse listQueuedResources(LocationName parent)

Lists queued resources.

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 (QueuedResource element : tpuClient.listQueuedResources(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.LocationName` Required. The parent resource name. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.TpuClient.ListQueuedResourcesPagedResponse` |   |

### listQueuedResources(String parent)

    public final TpuClient.ListQueuedResourcesPagedResponse listQueuedResources(String parent)

Lists queued resources.

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 (QueuedResource element : tpuClient.listQueuedResources(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The parent resource name. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.TpuClient.ListQueuedResourcesPagedResponse` |   |

### listQueuedResourcesCallable()

    public final UnaryCallable<ListQueuedResourcesRequest,ListQueuedResourcesResponse> listQueuedResourcesCallable()

Lists queued resources.

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()) {
       ListQueuedResourcesRequest request =
           ListQueuedResourcesRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       while (true) {
         ListQueuedResourcesResponse response =
             tpuClient.listQueuedResourcesCallable().call(request);
         for (QueuedResource element : response.getQueuedResourcesList()) {
           // doThingsWith(element);
         }
         String nextPageToken = response.getNextPageToken();
         if (!Strings.isNullOrEmpty(nextPageToken)) {
           request = request.toBuilder().setPageToken(nextPageToken).build();
         } else {
           break;
         }
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.ListQueuedResourcesRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.ListQueuedResourcesResponse>` |   |

### listQueuedResourcesPagedCallable()

    public final UnaryCallable<ListQueuedResourcesRequest,TpuClient.ListQueuedResourcesPagedResponse> listQueuedResourcesPagedCallable()

Lists queued resources.

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()) {
       ListQueuedResourcesRequest request =
           ListQueuedResourcesRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .build();
       ApiFuture<QueuedResource> future =
           tpuClient.listQueuedResourcesPagedCallable().futureCall(request);
       // Do something.
       for (QueuedResource element : future.get().iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.ListQueuedResourcesRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.TpuClient.ListQueuedResourcesPagedResponse>` |   |

### listRuntimeVersions(ListRuntimeVersionsRequest request)

    public final TpuClient.ListRuntimeVersionsPagedResponse listRuntimeVersions(ListRuntimeVersionsRequest request)

Lists runtime 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()) {
       ListRuntimeVersionsRequest request =
           ListRuntimeVersionsRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .setFilter("filter-1274492040")
               .setOrderBy("orderBy-1207110587")
               .build();
       for (RuntimeVersion element : tpuClient.listRuntimeVersions(request).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.ListRuntimeVersionsRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.TpuClient.ListRuntimeVersionsPagedResponse` |   |

### listRuntimeVersions(LocationName parent)

    public final TpuClient.ListRuntimeVersionsPagedResponse listRuntimeVersions(LocationName parent)

Lists runtime 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()) {
       LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
       for (RuntimeVersion element : tpuClient.listRuntimeVersions(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.LocationName` Required. The parent resource name. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.TpuClient.ListRuntimeVersionsPagedResponse` |   |

### listRuntimeVersions(String parent)

    public final TpuClient.ListRuntimeVersionsPagedResponse listRuntimeVersions(String parent)

Lists runtime 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 = LocationName.of("[PROJECT]", "[LOCATION]").toString();
       for (RuntimeVersion element : tpuClient.listRuntimeVersions(parent).iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `parent` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The parent resource name. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.TpuClient.ListRuntimeVersionsPagedResponse` |   |

### listRuntimeVersionsCallable()

    public final UnaryCallable<ListRuntimeVersionsRequest,ListRuntimeVersionsResponse> listRuntimeVersionsCallable()

Lists runtime 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()) {
       ListRuntimeVersionsRequest request =
           ListRuntimeVersionsRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .setFilter("filter-1274492040")
               .setOrderBy("orderBy-1207110587")
               .build();
       while (true) {
         ListRuntimeVersionsResponse response =
             tpuClient.listRuntimeVersionsCallable().call(request);
         for (RuntimeVersion element : response.getRuntimeVersionsList()) {
           // doThingsWith(element);
         }
         String nextPageToken = response.getNextPageToken();
         if (!Strings.isNullOrEmpty(nextPageToken)) {
           request = request.toBuilder().setPageToken(nextPageToken).build();
         } else {
           break;
         }
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.ListRuntimeVersionsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.ListRuntimeVersionsResponse>` |   |

### listRuntimeVersionsPagedCallable()

    public final UnaryCallable<ListRuntimeVersionsRequest,TpuClient.ListRuntimeVersionsPagedResponse> listRuntimeVersionsPagedCallable()

Lists runtime 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()) {
       ListRuntimeVersionsRequest request =
           ListRuntimeVersionsRequest.newBuilder()
               .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
               .setPageSize(883849137)
               .setPageToken("pageToken873572522")
               .setFilter("filter-1274492040")
               .setOrderBy("orderBy-1207110587")
               .build();
       ApiFuture<RuntimeVersion> future =
           tpuClient.listRuntimeVersionsPagedCallable().futureCall(request);
       // Do something.
       for (RuntimeVersion element : future.get().iterateAll()) {
         // doThingsWith(element);
       }
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.ListRuntimeVersionsRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.TpuClient.ListRuntimeVersionsPagedResponse>` |   |

### resetQueuedResourceAsync(QueuedResourceName name)

    public final OperationFuture<QueuedResource,OperationMetadata> resetQueuedResourceAsync(QueuedResourceName name)

Resets a QueuedResource TPU instance

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()) {
       QueuedResourceName name =
           QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]");
       QueuedResource response = tpuClient.resetQueuedResourceAsync(name).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.QueuedResourceName` Required. The name of the queued resource. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.QueuedResource,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.OperationMetadata>` |   |

### resetQueuedResourceAsync(ResetQueuedResourceRequest request)

    public final OperationFuture<QueuedResource,OperationMetadata> resetQueuedResourceAsync(ResetQueuedResourceRequest request)

Resets a QueuedResource TPU instance

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()) {
       ResetQueuedResourceRequest request =
           ResetQueuedResourceRequest.newBuilder()
               .setName(
                   QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]").toString())
               .build();
       QueuedResource response = tpuClient.resetQueuedResourceAsync(request).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.ResetQueuedResourceRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.QueuedResource,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.OperationMetadata>` |   |

### resetQueuedResourceAsync(String name)

    public final OperationFuture<QueuedResource,OperationMetadata> resetQueuedResourceAsync(String name)

Resets a QueuedResource TPU instance

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 =
           QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]").toString();
       QueuedResource response = tpuClient.resetQueuedResourceAsync(name).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` Required. The name of the queued resource. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.QueuedResource,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.OperationMetadata>` |   |

### resetQueuedResourceCallable()

    public final UnaryCallable<ResetQueuedResourceRequest,Operation> resetQueuedResourceCallable()

Resets a QueuedResource TPU instance

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()) {
       ResetQueuedResourceRequest request =
           ResetQueuedResourceRequest.newBuilder()
               .setName(
                   QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]").toString())
               .build();
       ApiFuture<Operation> future = tpuClient.resetQueuedResourceCallable().futureCall(request);
       // Do something.
       Operation response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.ResetQueuedResourceRequest,https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.Operation.html>` |   |

### resetQueuedResourceOperationCallable()

    public final OperationCallable<ResetQueuedResourceRequest,QueuedResource,OperationMetadata> resetQueuedResourceOperationCallable()

Resets a QueuedResource TPU instance

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()) {
       ResetQueuedResourceRequest request =
           ResetQueuedResourceRequest.newBuilder()
               .setName(
                   QueuedResourceName.of("[PROJECT]", "[LOCATION]", "[QUEUED_RESOURCE]").toString())
               .build();
       OperationFuture<QueuedResource, OperationMetadata> future =
           tpuClient.resetQueuedResourceOperationCallable().futureCall(request);
       // Do something.
       QueuedResource response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.OperationCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.ResetQueuedResourceRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.QueuedResource,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.OperationMetadata>` |   |

### shutdown()

    public void shutdown()

### shutdownNow()

    public void shutdownNow()

### startNodeAsync(StartNodeRequest request)

    public final OperationFuture<Node,OperationMetadata> startNodeAsync(StartNodeRequest request)

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(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString())
               .build();
       Node response = tpuClient.startNodeAsync(request).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.StartNodeRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.Node,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.OperationMetadata>` |   |

### startNodeCallable()

    public final UnaryCallable<StartNodeRequest,Operation> 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(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString())
               .build();
       ApiFuture<Operation> future = tpuClient.startNodeCallable().futureCall(request);
       // Do something.
       Operation response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.StartNodeRequest,https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.Operation.html>` |   |

### startNodeOperationCallable()

    public final OperationCallable<StartNodeRequest,Node,OperationMetadata> startNodeOperationCallable()

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(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString())
               .build();
       OperationFuture<Node, OperationMetadata> future =
           tpuClient.startNodeOperationCallable().futureCall(request);
       // Do something.
       Node response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.OperationCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.StartNodeRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.Node,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.OperationMetadata>` |   |

### stopNodeAsync(StopNodeRequest request)

    public final OperationFuture<Node,OperationMetadata> stopNodeAsync(StopNodeRequest request)

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(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString())
               .build();
       Node response = tpuClient.stopNodeAsync(request).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.StopNodeRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.Node,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.OperationMetadata>` |   |

### stopNodeCallable()

    public final UnaryCallable<StopNodeRequest,Operation> 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(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString())
               .build();
       ApiFuture<Operation> future = tpuClient.stopNodeCallable().futureCall(request);
       // Do something.
       Operation response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.StopNodeRequest,https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.Operation.html>` |   |

### stopNodeOperationCallable()

    public final OperationCallable<StopNodeRequest,Node,OperationMetadata> 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(NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]").toString())
               .build();
       OperationFuture<Node, OperationMetadata> future =
           tpuClient.stopNodeOperationCallable().futureCall(request);
       // Do something.
       Node response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.OperationCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.StopNodeRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.Node,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.OperationMetadata>` |   |

### updateNodeAsync(Node node, FieldMask updateMask)

    public final OperationFuture<Node,OperationMetadata> updateNodeAsync(Node node, FieldMask updateMask)

Updates the configurations 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()) {
       Node node = Node.newBuilder().build();
       FieldMask updateMask = FieldMask.newBuilder().build();
       Node response = tpuClient.updateNodeAsync(node, updateMask).get();
     }
     
| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `node` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.Node` Required. The node. Only fields specified in update_mask are updated. |
| `updateMask` | `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.FieldMask.html` Required. Mask of fields from Node to update. Supported fields: \[description, tags, labels, metadata, network_config.enable_external_ips\]. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.Node,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.OperationMetadata>` |   |

### updateNodeAsync(UpdateNodeRequest request)

    public final OperationFuture<Node,OperationMetadata> updateNodeAsync(UpdateNodeRequest request)

Updates the configurations 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()) {
       UpdateNodeRequest request =
           UpdateNodeRequest.newBuilder()
               .setUpdateMask(FieldMask.newBuilder().build())
               .setNode(Node.newBuilder().build())
               .build();
       Node response = tpuClient.updateNodeAsync(request).get();
     }
     
| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.UpdateNodeRequest` The request object containing all of the parameters for the API call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.longrunning.OperationFuture.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.Node,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.OperationMetadata>` |   |

### updateNodeCallable()

    public final UnaryCallable<UpdateNodeRequest,Operation> updateNodeCallable()

Updates the configurations 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()) {
       UpdateNodeRequest request =
           UpdateNodeRequest.newBuilder()
               .setUpdateMask(FieldMask.newBuilder().build())
               .setNode(Node.newBuilder().build())
               .build();
       ApiFuture<Operation> future = tpuClient.updateNodeCallable().futureCall(request);
       // Do something.
       Operation response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.UnaryCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.UpdateNodeRequest,https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.longrunning.Operation.html>` |   |

### updateNodeOperationCallable()

    public final OperationCallable<UpdateNodeRequest,Node,OperationMetadata> updateNodeOperationCallable()

Updates the configurations 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()) {
       UpdateNodeRequest request =
           UpdateNodeRequest.newBuilder()
               .setUpdateMask(FieldMask.newBuilder().build())
               .setNode(Node.newBuilder().build())
               .build();
       OperationFuture<Node, OperationMetadata> future =
           tpuClient.updateNodeOperationCallable().futureCall(request);
       // Do something.
       Node response = future.get();
     }
     
| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/gax/latest/com.google.api.gax.rpc.OperationCallable.html<https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.UpdateNodeRequest,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.Node,https://docs.cloud.google.com/java/docs/reference/google-cloud-tpu/latest/com.google.cloud.tpu.v2.OperationMetadata>` |   |