-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(bazel): Update WORKSPACE files for rules_gapic, gax_java, gener…
…ator_java versions (#230) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 472750037 Source-Link: googleapis/googleapis@88f2ea3 Source-Link: https://github.com/googleapis/googleapis-gen/commit/230a5588306aae18fe8f2a57f14d4039ad72c901 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMjMwYTU1ODgzMDZhYWUxOGZlOGYyYTU3ZjE0ZDQwMzlhZDcyYzkwMSJ9
- Loading branch information
1 parent
f35e8bf
commit 5142eca
Showing
113 changed files
with
5,584 additions
and
234 deletions.
There are no files selected for viewing
343 changes: 245 additions & 98 deletions
343
java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v1/TpuClient.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
378 changes: 270 additions & 108 deletions
378
java-tpu/google-cloud-tpu/src/main/java/com/google/cloud/tpu/v2alpha1/TpuClient.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
.../snippets/generated/com/google/cloud/tpu/v1/stub/tpustubsettings/getnode/SyncGetNode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright 2022 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.google.cloud.tpu.v1.stub.samples; | ||
|
||
// [START tpu_v1_generated_tpustubsettings_getnode_sync] | ||
import com.google.cloud.tpu.v1.stub.TpuStubSettings; | ||
import java.time.Duration; | ||
|
||
public class SyncGetNode { | ||
|
||
public static void main(String[] args) throws Exception { | ||
syncGetNode(); | ||
} | ||
|
||
public static void syncGetNode() throws Exception { | ||
// 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 | ||
TpuStubSettings.Builder tpuSettingsBuilder = TpuStubSettings.newBuilder(); | ||
tpuSettingsBuilder | ||
.getNodeSettings() | ||
.setRetrySettings( | ||
tpuSettingsBuilder.getNodeSettings().getRetrySettings().toBuilder() | ||
.setTotalTimeout(Duration.ofSeconds(30)) | ||
.build()); | ||
TpuStubSettings tpuSettings = tpuSettingsBuilder.build(); | ||
} | ||
} | ||
// [END tpu_v1_generated_tpustubsettings_getnode_sync] |
44 changes: 44 additions & 0 deletions
44
.../generated/com/google/cloud/tpu/v1/tpuclient/create/SyncCreateSetCredentialsProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright 2022 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.google.cloud.tpu.v1.samples; | ||
|
||
// [START tpu_v1_generated_tpuclient_create_setcredentialsprovider_sync] | ||
import com.google.api.gax.core.FixedCredentialsProvider; | ||
import com.google.cloud.tpu.v1.TpuClient; | ||
import com.google.cloud.tpu.v1.TpuSettings; | ||
import com.google.cloud.tpu.v1.myCredentials; | ||
|
||
public class SyncCreateSetCredentialsProvider { | ||
|
||
public static void main(String[] args) throws Exception { | ||
syncCreateSetCredentialsProvider(); | ||
} | ||
|
||
public static void syncCreateSetCredentialsProvider() throws Exception { | ||
// 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); | ||
} | ||
} | ||
// [END tpu_v1_generated_tpuclient_create_setcredentialsprovider_sync] |
40 changes: 40 additions & 0 deletions
40
...es/snippets/generated/com/google/cloud/tpu/v1/tpuclient/create/SyncCreateSetEndpoint.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright 2022 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.google.cloud.tpu.v1.samples; | ||
|
||
// [START tpu_v1_generated_tpuclient_create_setendpoint_sync] | ||
import com.google.cloud.tpu.v1.TpuClient; | ||
import com.google.cloud.tpu.v1.TpuSettings; | ||
import com.google.cloud.tpu.v1.myEndpoint; | ||
|
||
public class SyncCreateSetEndpoint { | ||
|
||
public static void main(String[] args) throws Exception { | ||
syncCreateSetEndpoint(); | ||
} | ||
|
||
public static void syncCreateSetEndpoint() throws Exception { | ||
// 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); | ||
} | ||
} | ||
// [END tpu_v1_generated_tpuclient_create_setendpoint_sync] |
52 changes: 52 additions & 0 deletions
52
...ples/snippets/generated/com/google/cloud/tpu/v1/tpuclient/createnode/AsyncCreateNode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright 2022 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.google.cloud.tpu.v1.samples; | ||
|
||
// [START tpu_v1_generated_tpuclient_createnode_async] | ||
import com.google.api.core.ApiFuture; | ||
import com.google.cloud.tpu.v1.CreateNodeRequest; | ||
import com.google.cloud.tpu.v1.LocationName; | ||
import com.google.cloud.tpu.v1.Node; | ||
import com.google.cloud.tpu.v1.TpuClient; | ||
import com.google.longrunning.Operation; | ||
|
||
public class AsyncCreateNode { | ||
|
||
public static void main(String[] args) throws Exception { | ||
asyncCreateNode(); | ||
} | ||
|
||
public static void asyncCreateNode() throws Exception { | ||
// 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(); | ||
} | ||
} | ||
} | ||
// [END tpu_v1_generated_tpuclient_createnode_async] |
53 changes: 53 additions & 0 deletions
53
...s/snippets/generated/com/google/cloud/tpu/v1/tpuclient/createnode/AsyncCreateNodeLRO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright 2022 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package com.google.cloud.tpu.v1.samples; | ||
|
||
// [START tpu_v1_generated_tpuclient_createnode_lro_async] | ||
import com.google.api.gax.longrunning.OperationFuture; | ||
import com.google.cloud.tpu.v1.CreateNodeRequest; | ||
import com.google.cloud.tpu.v1.LocationName; | ||
import com.google.cloud.tpu.v1.Node; | ||
import com.google.cloud.tpu.v1.OperationMetadata; | ||
import com.google.cloud.tpu.v1.TpuClient; | ||
|
||
public class AsyncCreateNodeLRO { | ||
|
||
public static void main(String[] args) throws Exception { | ||
asyncCreateNodeLRO(); | ||
} | ||
|
||
public static void asyncCreateNodeLRO() throws Exception { | ||
// 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(); | ||
} | ||
} | ||
} | ||
// [END tpu_v1_generated_tpuclient_createnode_lro_async] |
Oops, something went wrong.