- 2.56.0 (latest)
- 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
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 v2alpha1
Sample for TpuClient:
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.v2alpha1.AcceleratorType
AcceleratorType.Builder
A accelerator type that a Node can be configured with.
Protobuf type google.cloud.tpu.v2alpha1.AcceleratorType
AcceleratorTypeName
AcceleratorTypeName.Builder
Builder for projects/{project}/locations/{location}/acceleratorTypes/{accelerator_type}.
AccessConfig
An access config attached to the TPU worker.
Protobuf type google.cloud.tpu.v2alpha1.AccessConfig
AccessConfig.Builder
An access config attached to the TPU worker.
Protobuf type google.cloud.tpu.v2alpha1.AccessConfig
AttachedDisk
A node-attached disk resource. Next ID: 8;
Protobuf type google.cloud.tpu.v2alpha1.AttachedDisk
AttachedDisk.Builder
A node-attached disk resource. Next ID: 8;
Protobuf type google.cloud.tpu.v2alpha1.AttachedDisk
CloudTpuProto
CreateNodeRequest
Request for CreateNode.
Protobuf type google.cloud.tpu.v2alpha1.CreateNodeRequest
CreateNodeRequest.Builder
Request for CreateNode.
Protobuf type google.cloud.tpu.v2alpha1.CreateNodeRequest
DeleteNodeRequest
Request for DeleteNode.
Protobuf type google.cloud.tpu.v2alpha1.DeleteNodeRequest
DeleteNodeRequest.Builder
Request for DeleteNode.
Protobuf type google.cloud.tpu.v2alpha1.DeleteNodeRequest
GenerateServiceIdentityRequest
Request for GenerateServiceIdentity.
Protobuf type google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest
GenerateServiceIdentityRequest.Builder
Request for GenerateServiceIdentity.
Protobuf type google.cloud.tpu.v2alpha1.GenerateServiceIdentityRequest
GenerateServiceIdentityResponse
Response for GenerateServiceIdentity.
Protobuf type google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse
GenerateServiceIdentityResponse.Builder
Response for GenerateServiceIdentity.
Protobuf type google.cloud.tpu.v2alpha1.GenerateServiceIdentityResponse
GetAcceleratorTypeRequest
Request for GetAcceleratorType.
Protobuf type google.cloud.tpu.v2alpha1.GetAcceleratorTypeRequest
GetAcceleratorTypeRequest.Builder
Request for GetAcceleratorType.
Protobuf type google.cloud.tpu.v2alpha1.GetAcceleratorTypeRequest
GetGuestAttributesRequest
Request for GetGuestAttributes.
Protobuf type google.cloud.tpu.v2alpha1.GetGuestAttributesRequest
GetGuestAttributesRequest.Builder
Request for GetGuestAttributes.
Protobuf type google.cloud.tpu.v2alpha1.GetGuestAttributesRequest
GetGuestAttributesResponse
Response for GetGuestAttributes.
Protobuf type google.cloud.tpu.v2alpha1.GetGuestAttributesResponse
GetGuestAttributesResponse.Builder
Response for GetGuestAttributes.
Protobuf type google.cloud.tpu.v2alpha1.GetGuestAttributesResponse
GetNodeRequest
Request for GetNode.
Protobuf type google.cloud.tpu.v2alpha1.GetNodeRequest
GetNodeRequest.Builder
Request for GetNode.
Protobuf type google.cloud.tpu.v2alpha1.GetNodeRequest
GetRuntimeVersionRequest
Request for GetRuntimeVersion.
Protobuf type google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest
GetRuntimeVersionRequest.Builder
Request for GetRuntimeVersion.
Protobuf type google.cloud.tpu.v2alpha1.GetRuntimeVersionRequest
GuestAttributes
A guest attributes.
Protobuf type google.cloud.tpu.v2alpha1.GuestAttributes
GuestAttributes.Builder
A guest attributes.
Protobuf type google.cloud.tpu.v2alpha1.GuestAttributes
GuestAttributesEntry
A guest attributes namespace/key/value entry.
Protobuf type google.cloud.tpu.v2alpha1.GuestAttributesEntry
GuestAttributesEntry.Builder
A guest attributes namespace/key/value entry.
Protobuf type google.cloud.tpu.v2alpha1.GuestAttributesEntry
GuestAttributesValue
Array of guest attribute namespace/key/value tuples.
Protobuf type google.cloud.tpu.v2alpha1.GuestAttributesValue
GuestAttributesValue.Builder
Array of guest attribute namespace/key/value tuples.
Protobuf type google.cloud.tpu.v2alpha1.GuestAttributesValue
ListAcceleratorTypesRequest
Request for ListAcceleratorTypes.
Protobuf type google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequest
ListAcceleratorTypesRequest.Builder
Request for ListAcceleratorTypes.
Protobuf type google.cloud.tpu.v2alpha1.ListAcceleratorTypesRequest
ListAcceleratorTypesResponse
Response for ListAcceleratorTypes.
Protobuf type google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponse
ListAcceleratorTypesResponse.Builder
Response for ListAcceleratorTypes.
Protobuf type google.cloud.tpu.v2alpha1.ListAcceleratorTypesResponse
ListNodesRequest
Request for ListNodes.
Protobuf type google.cloud.tpu.v2alpha1.ListNodesRequest
ListNodesRequest.Builder
Request for ListNodes.
Protobuf type google.cloud.tpu.v2alpha1.ListNodesRequest
ListNodesResponse
Response for ListNodes.
Protobuf type google.cloud.tpu.v2alpha1.ListNodesResponse
ListNodesResponse.Builder
Response for ListNodes.
Protobuf type google.cloud.tpu.v2alpha1.ListNodesResponse
ListRuntimeVersionsRequest
Request for ListRuntimeVersions.
Protobuf type google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest
ListRuntimeVersionsRequest.Builder
Request for ListRuntimeVersions.
Protobuf type google.cloud.tpu.v2alpha1.ListRuntimeVersionsRequest
ListRuntimeVersionsResponse
Response for ListRuntimeVersions.
Protobuf type google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse
ListRuntimeVersionsResponse.Builder
Response for ListRuntimeVersions.
Protobuf type google.cloud.tpu.v2alpha1.ListRuntimeVersionsResponse
LocationName
LocationName.Builder
Builder for projects/{project}/locations/{location}.
NetworkConfig
Network related configurations.
Protobuf type google.cloud.tpu.v2alpha1.NetworkConfig
NetworkConfig.Builder
Network related configurations.
Protobuf type google.cloud.tpu.v2alpha1.NetworkConfig
NetworkEndpoint
A network endpoint over which a TPU worker can be reached.
Protobuf type google.cloud.tpu.v2alpha1.NetworkEndpoint
NetworkEndpoint.Builder
A network endpoint over which a TPU worker can be reached.
Protobuf type google.cloud.tpu.v2alpha1.NetworkEndpoint
Node
A TPU instance.
Protobuf type google.cloud.tpu.v2alpha1.Node
Node.Builder
A TPU instance.
Protobuf type google.cloud.tpu.v2alpha1.Node
NodeName
NodeName.Builder
Builder for projects/{project}/locations/{location}/nodes/{node}.
OperationMetadata
Metadata describing an Operation
Protobuf type google.cloud.tpu.v2alpha1.OperationMetadata
OperationMetadata.Builder
Metadata describing an Operation
Protobuf type google.cloud.tpu.v2alpha1.OperationMetadata
RuntimeVersion
A runtime version that a Node can be configured with.
Protobuf type google.cloud.tpu.v2alpha1.RuntimeVersion
RuntimeVersion.Builder
A runtime version that a Node can be configured with.
Protobuf type google.cloud.tpu.v2alpha1.RuntimeVersion
RuntimeVersionName
RuntimeVersionName.Builder
Builder for projects/{project}/locations/{location}/runtimeVersions/{runtime_version}.
SchedulingConfig
Sets the scheduling options for this node.
Protobuf type google.cloud.tpu.v2alpha1.SchedulingConfig
SchedulingConfig.Builder
Sets the scheduling options for this node.
Protobuf type google.cloud.tpu.v2alpha1.SchedulingConfig
ServiceAccount
A service account.
Protobuf type google.cloud.tpu.v2alpha1.ServiceAccount
ServiceAccount.Builder
A service account.
Protobuf type google.cloud.tpu.v2alpha1.ServiceAccount
ServiceIdentity
The per-product per-project service identity for Cloud TPU service.
Protobuf type google.cloud.tpu.v2alpha1.ServiceIdentity
ServiceIdentity.Builder
The per-product per-project service identity for Cloud TPU service.
Protobuf type google.cloud.tpu.v2alpha1.ServiceIdentity
StartNodeRequest
Request for StartNode.
Protobuf type google.cloud.tpu.v2alpha1.StartNodeRequest
StartNodeRequest.Builder
Request for StartNode.
Protobuf type google.cloud.tpu.v2alpha1.StartNodeRequest
StopNodeRequest
Request for StopNode.
Protobuf type google.cloud.tpu.v2alpha1.StopNodeRequest
StopNodeRequest.Builder
Request for StopNode.
Protobuf type google.cloud.tpu.v2alpha1.StopNodeRequest
Symptom
A Symptom instance.
Protobuf type google.cloud.tpu.v2alpha1.Symptom
Symptom.Builder
A Symptom instance.
Protobuf type google.cloud.tpu.v2alpha1.Symptom
TpuClient
Service Description: Manages TPU nodes and other resources
TPU API v2alpha1
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:
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:
- 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.
- 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.
- 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:
TpuSettings tpuSettings =
TpuSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
TpuClient tpuClient = TpuClient.create(tpuSettings);
To customize the endpoint:
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.ListNodesFixedSizeCollection
TpuClient.ListNodesPage
TpuClient.ListNodesPagedResponse
TpuClient.ListRuntimeVersionsFixedSizeCollection
TpuClient.ListRuntimeVersionsPage
TpuClient.ListRuntimeVersionsPagedResponse
TpuGrpc
Manages TPU nodes and other resources TPU API v2alpha1
TpuGrpc.TpuBlockingStub
Manages TPU nodes and other resources TPU API v2alpha1
TpuGrpc.TpuFutureStub
Manages TPU nodes and other resources TPU API v2alpha1
TpuGrpc.TpuImplBase
Manages TPU nodes and other resources TPU API v2alpha1
TpuGrpc.TpuStub
Manages TPU nodes and other resources TPU API v2alpha1
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:
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.
UpdateNodeRequest
Request for UpdateNode.
Protobuf type google.cloud.tpu.v2alpha1.UpdateNodeRequest
UpdateNodeRequest.Builder
Request for UpdateNode.
Protobuf type google.cloud.tpu.v2alpha1.UpdateNodeRequest
Interfaces
AcceleratorTypeOrBuilder
AccessConfigOrBuilder
AttachedDiskOrBuilder
CreateNodeRequestOrBuilder
DeleteNodeRequestOrBuilder
GenerateServiceIdentityRequestOrBuilder
GenerateServiceIdentityResponseOrBuilder
GetAcceleratorTypeRequestOrBuilder
GetGuestAttributesRequestOrBuilder
GetGuestAttributesResponseOrBuilder
GetNodeRequestOrBuilder
GetRuntimeVersionRequestOrBuilder
GuestAttributesEntryOrBuilder
GuestAttributesOrBuilder
GuestAttributesValueOrBuilder
ListAcceleratorTypesRequestOrBuilder
ListAcceleratorTypesResponseOrBuilder
ListNodesRequestOrBuilder
ListNodesResponseOrBuilder
ListRuntimeVersionsRequestOrBuilder
ListRuntimeVersionsResponseOrBuilder
NetworkConfigOrBuilder
NetworkEndpointOrBuilder
NodeOrBuilder
OperationMetadataOrBuilder
RuntimeVersionOrBuilder
SchedulingConfigOrBuilder
ServiceAccountOrBuilder
ServiceIdentityOrBuilder
StartNodeRequestOrBuilder
StopNodeRequestOrBuilder
SymptomOrBuilder
UpdateNodeRequestOrBuilder
Enums
AttachedDisk.DiskMode
The different mode of the attached disk.
Protobuf enum google.cloud.tpu.v2alpha1.AttachedDisk.DiskMode
Node.ApiVersion
TPU API Version.
Protobuf enum google.cloud.tpu.v2alpha1.Node.ApiVersion
Node.Health
Health defines the status of a TPU node as reported by Health Monitor.
Protobuf enum google.cloud.tpu.v2alpha1.Node.Health
Node.State
Represents the different states of a TPU node during its lifecycle.
Protobuf enum google.cloud.tpu.v2alpha1.Node.State
Symptom.SymptomType
SymptomType represents the different types of Symptoms that a TPU can be at.
Protobuf enum google.cloud.tpu.v2alpha1.Symptom.SymptomType