Package com.google.cloud.tpu.v1 (2.28.0)

A client to Cloud TPU API

The interfaces provided are listed below, along with usage samples.

TpuClient

Service Description: Manages TPU nodes and other resources

TPU API v1

Sample for TpuClient:


 // 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);
 }
 

Classes

AcceleratorType

A accelerator type that a Node can be configured with.

Protobuf type google.cloud.tpu.v1.AcceleratorType

AcceleratorType.Builder

A accelerator type that a Node can be configured with.

Protobuf type google.cloud.tpu.v1.AcceleratorType

AcceleratorTypeName

AcceleratorTypeName.Builder

Builder for projects/{project}/locations/{location}/acceleratorTypes/{accelerator_type}.

CloudTpuProto

CreateNodeRequest

Request for CreateNode.

Protobuf type google.cloud.tpu.v1.CreateNodeRequest

CreateNodeRequest.Builder

Request for CreateNode.

Protobuf type google.cloud.tpu.v1.CreateNodeRequest

DeleteNodeRequest

Request for DeleteNode.

Protobuf type google.cloud.tpu.v1.DeleteNodeRequest

DeleteNodeRequest.Builder

Request for DeleteNode.

Protobuf type google.cloud.tpu.v1.DeleteNodeRequest

GetAcceleratorTypeRequest

Request for GetAcceleratorType.

Protobuf type google.cloud.tpu.v1.GetAcceleratorTypeRequest

GetAcceleratorTypeRequest.Builder

Request for GetAcceleratorType.

Protobuf type google.cloud.tpu.v1.GetAcceleratorTypeRequest

GetNodeRequest

Request for GetNode.

Protobuf type google.cloud.tpu.v1.GetNodeRequest

GetNodeRequest.Builder

Request for GetNode.

Protobuf type google.cloud.tpu.v1.GetNodeRequest

GetTensorFlowVersionRequest

Request for GetTensorFlowVersion.

Protobuf type google.cloud.tpu.v1.GetTensorFlowVersionRequest

GetTensorFlowVersionRequest.Builder

Request for GetTensorFlowVersion.

Protobuf type google.cloud.tpu.v1.GetTensorFlowVersionRequest

ListAcceleratorTypesRequest

Request for ListAcceleratorTypes.

Protobuf type google.cloud.tpu.v1.ListAcceleratorTypesRequest

ListAcceleratorTypesRequest.Builder

Request for ListAcceleratorTypes.

Protobuf type google.cloud.tpu.v1.ListAcceleratorTypesRequest

ListAcceleratorTypesResponse

Response for ListAcceleratorTypes.

Protobuf type google.cloud.tpu.v1.ListAcceleratorTypesResponse

ListAcceleratorTypesResponse.Builder

Response for ListAcceleratorTypes.

Protobuf type google.cloud.tpu.v1.ListAcceleratorTypesResponse

ListNodesRequest

Request for ListNodes.

Protobuf type google.cloud.tpu.v1.ListNodesRequest

ListNodesRequest.Builder

Request for ListNodes.

Protobuf type google.cloud.tpu.v1.ListNodesRequest

ListNodesResponse

Response for ListNodes.

Protobuf type google.cloud.tpu.v1.ListNodesResponse

ListNodesResponse.Builder

Response for ListNodes.

Protobuf type google.cloud.tpu.v1.ListNodesResponse

ListTensorFlowVersionsRequest

Request for ListTensorFlowVersions.

Protobuf type google.cloud.tpu.v1.ListTensorFlowVersionsRequest

ListTensorFlowVersionsRequest.Builder

Request for ListTensorFlowVersions.

Protobuf type google.cloud.tpu.v1.ListTensorFlowVersionsRequest

ListTensorFlowVersionsResponse

Response for ListTensorFlowVersions.

Protobuf type google.cloud.tpu.v1.ListTensorFlowVersionsResponse

ListTensorFlowVersionsResponse.Builder

Response for ListTensorFlowVersions.

Protobuf type google.cloud.tpu.v1.ListTensorFlowVersionsResponse

LocationName

LocationName.Builder

Builder for projects/{project}/locations/{location}.

NetworkEndpoint

A network endpoint over which a TPU worker can be reached.

Protobuf type google.cloud.tpu.v1.NetworkEndpoint

NetworkEndpoint.Builder

A network endpoint over which a TPU worker can be reached.

Protobuf type google.cloud.tpu.v1.NetworkEndpoint

Node

A TPU instance.

Protobuf type google.cloud.tpu.v1.Node

Node.Builder

A TPU instance.

Protobuf type google.cloud.tpu.v1.Node

NodeName

NodeName.Builder

Builder for projects/{project}/locations/{location}/nodes/{node}.

OperationMetadata

Metadata describing an Operation

Protobuf type google.cloud.tpu.v1.OperationMetadata

OperationMetadata.Builder

Metadata describing an Operation

Protobuf type google.cloud.tpu.v1.OperationMetadata

ReimageNodeRequest

Request for ReimageNode.

Protobuf type google.cloud.tpu.v1.ReimageNodeRequest

ReimageNodeRequest.Builder

Request for ReimageNode.

Protobuf type google.cloud.tpu.v1.ReimageNodeRequest

SchedulingConfig

Sets the scheduling options for this node.

Protobuf type google.cloud.tpu.v1.SchedulingConfig

SchedulingConfig.Builder

Sets the scheduling options for this node.

Protobuf type google.cloud.tpu.v1.SchedulingConfig

StartNodeRequest

Request for StartNode.

Protobuf type google.cloud.tpu.v1.StartNodeRequest

StartNodeRequest.Builder

Request for StartNode.

Protobuf type google.cloud.tpu.v1.StartNodeRequest

StopNodeRequest

Request for StopNode.

Protobuf type google.cloud.tpu.v1.StopNodeRequest

StopNodeRequest.Builder

Request for StopNode.

Protobuf type google.cloud.tpu.v1.StopNodeRequest

Symptom

A Symptom instance.

Protobuf type google.cloud.tpu.v1.Symptom

Symptom.Builder

A Symptom instance.

Protobuf type google.cloud.tpu.v1.Symptom

TensorFlowVersion

A tensorflow version that a Node can be configured with.

Protobuf type google.cloud.tpu.v1.TensorFlowVersion

TensorFlowVersion.Builder

A tensorflow version that a Node can be configured with.

Protobuf type google.cloud.tpu.v1.TensorFlowVersion

TensorFlowVersionName

TensorFlowVersionName.Builder

Builder for projects/{project}/locations/{location}/tensorFlowVersions/{tensor_flow_version}.

TpuClient

Service Description: Manages TPU nodes and other resources

TPU API v1

This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (TpuClient tpuClient = TpuClient.create()) {
   NodeName name = NodeName.of("[PROJECT]", "[LOCATION]", "[NODE]");
   Node response = tpuClient.getNode(name);
 }
 

Note: close() needs to be called on the TpuClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().

The surface of this class includes several types of Java methods for each of the API's methods:

  1. A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
  2. A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
  3. A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.

See the individual methods for example code.

Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.

This class can be customized by passing in a custom instance of TpuSettings to create(). For example:

To customize credentials:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 TpuSettings tpuSettings =
     TpuSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 TpuClient tpuClient = TpuClient.create(tpuSettings);
 

To customize the endpoint:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 TpuSettings tpuSettings = TpuSettings.newBuilder().setEndpoint(myEndpoint).build();
 TpuClient tpuClient = TpuClient.create(tpuSettings);
 

Please refer to the GitHub repository's samples for more quickstart code snippets.

TpuClient.ListAcceleratorTypesFixedSizeCollection

TpuClient.ListAcceleratorTypesPage

TpuClient.ListAcceleratorTypesPagedResponse

TpuClient.ListLocationsFixedSizeCollection

TpuClient.ListLocationsPage

TpuClient.ListLocationsPagedResponse

TpuClient.ListNodesFixedSizeCollection

TpuClient.ListNodesPage

TpuClient.ListNodesPagedResponse

TpuClient.ListTensorFlowVersionsFixedSizeCollection

TpuClient.ListTensorFlowVersionsPage

TpuClient.ListTensorFlowVersionsPagedResponse

TpuGrpc

Manages TPU nodes and other resources TPU API v1

TpuGrpc.TpuBlockingStub

A stub to allow clients to do synchronous rpc calls to service Tpu.

Manages TPU nodes and other resources TPU API v1

TpuGrpc.TpuFutureStub

A stub to allow clients to do ListenableFuture-style rpc calls to service Tpu.

Manages TPU nodes and other resources TPU API v1

TpuGrpc.TpuImplBase

Base class for the server implementation of the service Tpu.

Manages TPU nodes and other resources TPU API v1

TpuGrpc.TpuStub

A stub to allow clients to do asynchronous rpc calls to service Tpu.

Manages TPU nodes and other resources TPU API v1

TpuSettings

Settings class to configure an instance of TpuClient.

The default instance has everything set to sensible defaults:

  • The default service address (tpu.googleapis.com) and default port (443) are used.
  • Credentials are acquired automatically through Application Default Credentials.
  • Retries are configured for idempotent methods but not for non-idempotent methods.

The builder of this class is recursive, so contained classes are themselves builders. When build() is called, the tree of builders is called to create the complete settings object.

For example, to set the total timeout of getNode to 30 seconds:


 // 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.Builder tpuSettingsBuilder = TpuSettings.newBuilder();
 tpuSettingsBuilder
     .getNodeSettings()
     .setRetrySettings(
         tpuSettingsBuilder
             .getNodeSettings()
             .getRetrySettings()
             .toBuilder()
             .setTotalTimeout(Duration.ofSeconds(30))
             .build());
 TpuSettings tpuSettings = tpuSettingsBuilder.build();
 

TpuSettings.Builder

Builder for TpuSettings.

Interfaces

AcceleratorTypeOrBuilder

CreateNodeRequestOrBuilder

DeleteNodeRequestOrBuilder

GetAcceleratorTypeRequestOrBuilder

GetNodeRequestOrBuilder

GetTensorFlowVersionRequestOrBuilder

ListAcceleratorTypesRequestOrBuilder

ListAcceleratorTypesResponseOrBuilder

ListNodesRequestOrBuilder

ListNodesResponseOrBuilder

ListTensorFlowVersionsRequestOrBuilder

ListTensorFlowVersionsResponseOrBuilder

NetworkEndpointOrBuilder

NodeOrBuilder

OperationMetadataOrBuilder

ReimageNodeRequestOrBuilder

SchedulingConfigOrBuilder

StartNodeRequestOrBuilder

StopNodeRequestOrBuilder

SymptomOrBuilder

TensorFlowVersionOrBuilder

TpuGrpc.AsyncService

Manages TPU nodes and other resources TPU API v1

Enums

Node.ApiVersion

TPU API Version.

Protobuf enum google.cloud.tpu.v1.Node.ApiVersion

Node.Health

Health defines the status of a TPU node as reported by Health Monitor.

Protobuf enum google.cloud.tpu.v1.Node.Health

Node.State

Represents the different states of a TPU node during its lifecycle.

Protobuf enum google.cloud.tpu.v1.Node.State

Symptom.SymptomType

SymptomType represents the different types of Symptoms that a TPU can be at.

Protobuf enum google.cloud.tpu.v1.Symptom.SymptomType