Override the default endpoint
In some cases, you may need to override the default endpoint used by the client library. Use the google::cloud::EndpointOption
when initializing the client library to change this default. For example, this will override the default endpoint for google::cloud::bigtable::Table
:
namespace bigtable = ::google::cloud::bigtable;
[](std::string const& project_id, std::string const& instance_id,
std::string const& table_id) {
auto options = google::cloud::Options{}.set<google::cloud::EndpointOption>(
"private.googleapis.com");
auto resource = bigtable::TableResource(project_id, instance_id, table_id);
return bigtable::Table(bigtable::MakeDataConnection(options), resource);
}
Changing the default endpoint for other *Client
classes is very similar, as shown in these examples: