Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: [tpu] proper http bindings for v2 API #9035

Merged
merged 6 commits into from
Feb 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions java-tpu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ If you are using Maven, add this to your pom.xml file:
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-tpu</artifactId>
<version>2.9.0</version>
<version>2.10.0</version>
</dependency>
```

If you are using Gradle without BOM, add this to your dependencies:

```Groovy
implementation 'com.google.cloud:google-cloud-tpu:2.9.0'
implementation 'com.google.cloud:google-cloud-tpu:2.10.0'
```

If you are using SBT, add this to your dependencies:

```Scala
libraryDependencies += "com.google.cloud" % "google-cloud-tpu" % "2.9.0"
libraryDependencies += "com.google.cloud" % "google-cloud-tpu" % "2.10.0"
```

## Authentication
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -585,18 +585,14 @@ public class HttpJsonTpuStub extends TpuStub {
.setRequestFormatter(
ProtoMessageRequestFormatter.<ListLocationsRequest>newBuilder()
.setPath(
"/v1alpha1/{name=projects/*}/locations",
"/v2/{name=projects/*}/locations",
request -> {
Map<String, String> fields = new HashMap<>();
ProtoRestSerializer<ListLocationsRequest> serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "name", request.getName());
return fields;
})
.setAdditionalPaths(
"/v1/{name=projects/*}/locations",
"/v2alpha1/{name=projects/*}/locations",
"/v2/{name=projects/*}/locations")
.setQueryParamsExtractor(
request -> {
Map<String, List<String>> fields = new HashMap<>();
Expand All @@ -623,18 +619,14 @@ public class HttpJsonTpuStub extends TpuStub {
.setRequestFormatter(
ProtoMessageRequestFormatter.<GetLocationRequest>newBuilder()
.setPath(
"/v1alpha1/{name=projects/*/locations/*}",
"/v2/{name=projects/*/locations/*}",
request -> {
Map<String, String> fields = new HashMap<>();
ProtoRestSerializer<GetLocationRequest> serializer =
ProtoRestSerializer.create();
serializer.putPathParam(fields, "name", request.getName());
return fields;
})
.setAdditionalPaths(
"/v1/{name=projects/*/locations/*}",
"/v2alpha1/{name=projects/*/locations/*}",
"/v2/{name=projects/*/locations/*}")
.setQueryParamsExtractor(
request -> {
Map<String, List<String>> fields = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1336,7 +1336,7 @@ public final UnaryCallable<GetQueuedResourceRequest, QueuedResource> getQueuedRe
*
* @param parent Required. The parent resource name.
* @param queuedResource Required. The queued resource.
* @param queuedResourceId The unqualified resource name. Should follow the `^[A-Za-z0-9_.~+%-]+$`
* @param queuedResourceId The unqualified resource name. Should follow the ^[A-Za-z0-9_.~+%-]+$
* regex format.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
Expand Down Expand Up @@ -1374,7 +1374,7 @@ public final OperationFuture<QueuedResource, OperationMetadata> createQueuedReso
*
* @param parent Required. The parent resource name.
* @param queuedResource Required. The queued resource.
* @param queuedResourceId The unqualified resource name. Should follow the `^[A-Za-z0-9_.~+%-]+$`
* @param queuedResourceId The unqualified resource name. Should follow the ^[A-Za-z0-9_.~+%-]+$
* regex format.
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
*
*
* <pre>
* Request for [GetTensorFlowVersion][google.cloud.tpu.v1.Tpu.GetTensorFlowVersion].
* Request for
* [GetTensorFlowVersion][google.cloud.tpu.v1.Tpu.GetTensorFlowVersion].
* </pre>
*
* Protobuf type {@code google.cloud.tpu.v1.GetTensorFlowVersionRequest}
Expand Down Expand Up @@ -285,7 +286,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
*
*
* <pre>
* Request for [GetTensorFlowVersion][google.cloud.tpu.v1.Tpu.GetTensorFlowVersion].
* Request for
* [GetTensorFlowVersion][google.cloud.tpu.v1.Tpu.GetTensorFlowVersion].
* </pre>
*
* Protobuf type {@code google.cloud.tpu.v1.GetTensorFlowVersionRequest}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
*
*
* <pre>
* Request for [ListAcceleratorTypes][google.cloud.tpu.v1.Tpu.ListAcceleratorTypes].
* Request for
* [ListAcceleratorTypes][google.cloud.tpu.v1.Tpu.ListAcceleratorTypes].
* </pre>
*
* Protobuf type {@code google.cloud.tpu.v1.ListAcceleratorTypesRequest}
Expand Down Expand Up @@ -495,7 +496,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
*
*
* <pre>
* Request for [ListAcceleratorTypes][google.cloud.tpu.v1.Tpu.ListAcceleratorTypes].
* Request for
* [ListAcceleratorTypes][google.cloud.tpu.v1.Tpu.ListAcceleratorTypes].
* </pre>
*
* Protobuf type {@code google.cloud.tpu.v1.ListAcceleratorTypesRequest}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
*
*
* <pre>
* Response for [ListAcceleratorTypes][google.cloud.tpu.v1.Tpu.ListAcceleratorTypes].
* Response for
* [ListAcceleratorTypes][google.cloud.tpu.v1.Tpu.ListAcceleratorTypes].
* </pre>
*
* Protobuf type {@code google.cloud.tpu.v1.ListAcceleratorTypesResponse}
Expand Down Expand Up @@ -444,7 +445,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
*
*
* <pre>
* Response for [ListAcceleratorTypes][google.cloud.tpu.v1.Tpu.ListAcceleratorTypes].
* Response for
* [ListAcceleratorTypes][google.cloud.tpu.v1.Tpu.ListAcceleratorTypes].
* </pre>
*
* Protobuf type {@code google.cloud.tpu.v1.ListAcceleratorTypesResponse}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
*
*
* <pre>
* Request for [ListTensorFlowVersions][google.cloud.tpu.v1.Tpu.ListTensorFlowVersions].
* Request for
* [ListTensorFlowVersions][google.cloud.tpu.v1.Tpu.ListTensorFlowVersions].
* </pre>
*
* Protobuf type {@code google.cloud.tpu.v1.ListTensorFlowVersionsRequest}
Expand Down Expand Up @@ -496,7 +497,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
*
*
* <pre>
* Request for [ListTensorFlowVersions][google.cloud.tpu.v1.Tpu.ListTensorFlowVersions].
* Request for
* [ListTensorFlowVersions][google.cloud.tpu.v1.Tpu.ListTensorFlowVersions].
* </pre>
*
* Protobuf type {@code google.cloud.tpu.v1.ListTensorFlowVersionsRequest}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
*
*
* <pre>
* Response for [ListTensorFlowVersions][google.cloud.tpu.v1.Tpu.ListTensorFlowVersions].
* Response for
* [ListTensorFlowVersions][google.cloud.tpu.v1.Tpu.ListTensorFlowVersions].
* </pre>
*
* Protobuf type {@code google.cloud.tpu.v1.ListTensorFlowVersionsResponse}
Expand Down Expand Up @@ -448,7 +449,8 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build
*
*
* <pre>
* Response for [ListTensorFlowVersions][google.cloud.tpu.v1.Tpu.ListTensorFlowVersions].
* Response for
* [ListTensorFlowVersions][google.cloud.tpu.v1.Tpu.ListTensorFlowVersions].
* </pre>
*
* Protobuf type {@code google.cloud.tpu.v1.ListTensorFlowVersionsResponse}
Expand Down
Loading