-
Notifications
You must be signed in to change notification settings - Fork 373
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
doc(spanner): add *Client
samples
#10145
Conversation
Google Cloud Build Logs
ℹ️ NOTE: Kokoro logs are linked from "Details" below. |
Codecov ReportBase: 93.98% // Head: 93.97% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #10145 +/- ##
==========================================
- Coverage 93.98% 93.97% -0.02%
==========================================
Files 1525 1526 +1
Lines 140517 140564 +47
==========================================
+ Hits 132065 132092 +27
- Misses 8452 8472 +20
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ typo in description.
Google Cloud Build Logs
ℹ️ NOTE: Kokoro logs are linked from "Details" below. |
(argv.at(0), argv.at(1), argv.at(2), argv.at(3)); | ||
} | ||
|
||
void DatabaseAdminClientSetEndpoint(std::vector<std::string> const& argv) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment about generated Admin APIs having generated samples:
google-cloud-cpp/google/cloud/spanner/admin/samples/database_admin_client_samples.cc
Lines 32 to 44 in 7ddabb9
void SetClientEndpoint(std::vector<std::string> const& argv) { | |
if (!argv.empty()) { | |
throw google::cloud::testing_util::Usage{"set-client-endpoint"}; | |
} | |
//! [set-client-endpoint] | |
// This configuration is common with Private Google Access: | |
// https://cloud.google.com/vpc/docs/private-google-access | |
auto options = google::cloud::Options{}.set<google::cloud::EndpointOption>( | |
"private.googleapis.com"); | |
auto client = google::cloud::spanner_admin::DatabaseAdminClient( | |
google::cloud::spanner_admin::MakeDatabaseAdminConnection(options)); | |
//! [set-client-endpoint] | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have expected these InstanceAdminClient
and DatabaseAdminClient
samples to have disappeared then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooops, fixed now.
a06a840
to
729ac10
Compare
Google Cloud Build Logs
ℹ️ NOTE: Kokoro logs are linked from "Details" below. |
729ac10
to
7d1fb56
Compare
Google Cloud Build Logs
ℹ️ NOTE: Kokoro logs are linked from "Details" below. |
void ClientSetEndpoint(std::vector<std::string> const& argv) { | ||
if (argv.size() != 3) { | ||
throw google::cloud::testing_util::Usage{ | ||
"client-set-endpoint <project-id> <instance-id> <database-id>"}; | ||
} | ||
//! [client-set-endpoint] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to be an unreasonable stickler for consistency, you could rename this to SetClientEndpoint / [set-client-endpoint]
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah ... if we have set-client-endpoint
and with-service-account
tags in both of the admin samples, then why not the same here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
(argv.at(0), argv.at(1), argv.at(2)); | ||
} | ||
|
||
void ClientWithServiceAccount(std::vector<std::string> const& argv) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and this to WithServiceAccount / [with-service-account]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Add examples showing how to override the default endpoint and default authentication.
7d1fb56
to
cc51bea
Compare
Google Cloud Build Logs
ℹ️ NOTE: Kokoro logs are linked from "Details" below. |
Add examples showing how to override the default endpoint and default authentication.
Fixes #10141 and fixes #10142
This change is