Skip to content

Commit 4ce6763

Browse files
joshuamoAaron Gabriel Neyer
and
Aaron Gabriel Neyer
authored
chore(python): Add example of using client_options for regional endpoints (#316)
* Add example of using client_options for regional endpoints * Add example of using client_options for regional endpoints * Add example of using client_options for regional endpoints * Add example of using client_options for regional endpoints Co-authored-by: Aaron Gabriel Neyer <[email protected]>
1 parent 8c6f1b5 commit 4ce6763

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

cloudbuild/snippets/quickstart.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,19 @@ def quickstart():
2323
print the in-progress status and print the completed status."""
2424

2525
# Authorize the client with Google defaults
26-
# If you're using Private Pools, add a regional `api_endpoint` to `CloudBuildClient()`
27-
# For example, '<YOUR_POOL_REGION>-cloudbuild.googleapis.com'
2826
credentials, project_id = google.auth.default()
2927
client = cloudbuild_v1.services.cloud_build.CloudBuildClient()
3028

29+
# If you're using Private Pools or a non-global default pool, add a regional
30+
# `api_endpoint` to `CloudBuildClient()`
31+
# For example, '<YOUR_POOL_REGION>-cloudbuild.googleapis.com'
32+
#
33+
# from google.api_core import client_options
34+
# client_options = client_options.ClientOptions(
35+
# api_endpoint="us-central1-cloudbuild.googleapis.com"
36+
# )
37+
# client = cloudbuild_v1.services.cloud_build.CloudBuildClient(client_options=client_options)
38+
3139
build = cloudbuild_v1.Build()
3240

3341
# The following build steps will output "hello world"

0 commit comments

Comments
 (0)