Skip to content

Latest commit

History

History
64 lines (48 loc) · 2.23 KB

File metadata and controls

64 lines (48 loc) · 2.23 KB

Network Connectivity API C++ Client Library

This directory contains an idiomatic C++ client library for the Network Connectivity API,a suite of products that provide enterprise connectivity from your on-premises network or from another cloud provider to your Virtual Private Cloud (VPC) network.

While this library isGA,please note that the Google Cloud C++ client libraries donotfollowSemantic Versioning.

Quickstart

Thequickstart/directory contains a minimal environment to get started using this client library in a larger project. The following "Hello World" program is used in this quickstart, and should give you a taste of this library.

For detailed instructions on how to build and install this library, see the top-levelREADME.

#include"google/cloud/networkconnectivity/v1/hub_client.h"
#include"google/cloud/location.h"
#include<iostream>

intmain(intargc,char* argv[]) try {
if(argc!=2) {
std::cerr <<"Usage:"<< argv[0] <<"project-id\n";
return1;
}

autoconstlocation =google::cloud::Location(argv[1],"global");

namespacenetworkconnectivity=::google::cloud::networkconnectivity_v1;
autoclient =networkconnectivity::HubServiceClient(
networkconnectivity::MakeHubServiceConnection());

for(autoh: client.ListHubs(location.FullName())) {
if(!h)throwstd::move(h).status();
std::cout << h->DebugString() <<"\n";
}

return0;
}catch(google::cloud::Statusconst& status) {
std::cerr <<"google::cloud::Status thrown:"<< status <<"\n";
return1;
}

More Information