Skip to content

Latest commit

History

History
59 lines (44 loc) · 1.93 KB

README.md

File metadata and controls

59 lines (44 loc) · 1.93 KB

Infrastructure Manager API C++ Client Library

This directory contains an idiomatic C++ client library for the Infrastructure Manager API,a service to create and manage Google Cloud resources and infrastructure.

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.

#include"google/cloud/config/v1/config_client.h"
#include"google/cloud/location.h"
#include<iostream>

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

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

namespaceconfig=::google::cloud::config_v1;
autoclient =config::ConfigClient(config::MakeConfigConnection());

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

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

More Information