From e3a79e3bf7b17d6b748b1340ada7f1509e01ee1e Mon Sep 17 00:00:00 2001 From: Yao Cui Date: Tue, 23 Jul 2024 15:40:20 +0000 Subject: [PATCH] docs(quickstart): Replace deprecated RPC in the sample code --- google/cloud/edgenetwork/CMakeLists.txt | 5 +++-- google/cloud/edgenetwork/README.md | 4 ++-- google/cloud/edgenetwork/quickstart/quickstart.cc | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/google/cloud/edgenetwork/CMakeLists.txt b/google/cloud/edgenetwork/CMakeLists.txt index 9eeacea257a2b..4df48ccd6fed5 100644 --- a/google/cloud/edgenetwork/CMakeLists.txt +++ b/google/cloud/edgenetwork/CMakeLists.txt @@ -29,7 +29,8 @@ if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS) COMMAND cmake -P "${PROJECT_SOURCE_DIR}/cmake/quickstart-runner.cmake" $ 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 () diff --git a/google/cloud/edgenetwork/README.md b/google/cloud/edgenetwork/README.md index c749820f8f75d..aa9b3ce39c95b 100644 --- a/google/cloud/edgenetwork/README.md +++ b/google/cloud/edgenetwork/README.md @@ -22,7 +22,7 @@ this library. #include 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; } @@ -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"; } diff --git a/google/cloud/edgenetwork/quickstart/quickstart.cc b/google/cloud/edgenetwork/quickstart/quickstart.cc index bc3267d036aba..4bf106c3edd5e 100644 --- a/google/cloud/edgenetwork/quickstart/quickstart.cc +++ b/google/cloud/edgenetwork/quickstart/quickstart.cc @@ -18,7 +18,7 @@ #include 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; } @@ -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"; }