Skip to content

Commit

Permalink
docs(quickstart) replace deprecated RPC in the sample code
Browse files Browse the repository at this point in the history
  • Loading branch information
cuiy0006 committed Jul 23, 2024
1 parent 7b2867f commit 5b0d8f8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions google/cloud/edgenetwork/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS)
COMMAND
cmake -P "${PROJECT_SOURCE_DIR}/cmake/quickstart-runner.cmake"
$<TARGET_FILE:edgenetwork_quickstart> GOOGLE_CLOUD_PROJECT
GOOGLE_CLOUD_CPP_TEST_REGION)
GOOGLE_CLOUD_CPP_TEST_REGION GOOGLE_CLOUD_CPP_TEST_ZONE)
set_tests_properties(edgenetwork_quickstart
PROPERTIES LABELS "integration-test;quickstart")
PROPERTIES LABELS "integration-test;quickstart"
PASS_REGULAR_EXPRESSION "message of Resource 'zones/.*' was not found")
endif ()
4 changes: 2 additions & 2 deletions google/cloud/edgenetwork/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ this library.
#include <iostream>

int main(int argc, char* argv[]) try {
if (argc != 3) {
if (argc != 4) {
std::cerr << "Usage: " << argv[0] << " project-id location-id\n";
return 1;
}
Expand All @@ -33,7 +33,7 @@ int main(int argc, char* argv[]) try {
auto client =
edgenetwork::EdgeNetworkClient(edgenetwork::MakeEdgeNetworkConnection());

for (auto r : client.ListZones(location.FullName())) {
for (auto r : client.ListNetworks(location.FullName() + "/zones/" + argv[3])) {
if (!r) throw std::move(r).status();
std::cout << r->DebugString() << "\n";
}
Expand Down
4 changes: 2 additions & 2 deletions google/cloud/edgenetwork/quickstart/quickstart.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <iostream>

int main(int argc, char* argv[]) try {
if (argc != 3) {
if (argc != 4) {
std::cerr << "Usage: " << argv[0] << " project-id location-id\n";
return 1;
}
Expand All @@ -29,7 +29,7 @@ int main(int argc, char* argv[]) try {
auto client =
edgenetwork::EdgeNetworkClient(edgenetwork::MakeEdgeNetworkConnection());

for (auto r : client.ListZones(location.FullName())) {
for (auto r : client.ListNetworks(location.FullName() + "/zones/" + argv[3])) {
if (!r) throw std::move(r).status();
std::cout << r->DebugString() << "\n";
}
Expand Down

0 comments on commit 5b0d8f8

Please sign in to comment.