Reputation: 21
I am using google-cloud-bigquery
SDK version 2.38.2 to create a BigQuery client in a Java project. I need to determines the exact endpoint URL when creating a BigQuery client using the following code snippet:
BigQueryOptions.newBuilder()
.setProjectId(projectName)
.setCredentials(credentials)
.build().getService();
Context:
Specific Questions:
Upvotes: 2
Views: 31
Reputation: 75950
You can't, because the client library always use bigquery.googleapis.com. It's a game of router, DNS, other network magic that route your traffic.
You have to trust Google for this, but you can also validate that it work correctly. Deploy a VM in a subnet without private service connect, and another with it. Do not add public IP on the VM. Then run your code.
If you have the private service connect, the traffic goes to BigQuery. If not, the VM can't resolve the public URL because it hasn't public IP.
Upvotes: 0