- Notifications
You must be signed in to change notification settings - Fork433
C++ Client Libraries for Google Cloud Services
License
googleapis/google-cloud-cpp
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This repository contains idiomatic C++ client libraries for the followingGoogle Cloud Platform services.
Please check theCHANGELOG for important announcements and upcoming changes.
Each library (see below) contains a directory namedquickstart/ that'sintended to help you get up and running in a matter of minutes. Thisquickstart/ directory contains a minimal "Hello World" program demonstratinghow to use the library, along with minimal build files for common build systems,such as CMake and Bazel.
As an example, the following code snippet, taken fromGoogle Cloud Storage, should give you a senseof what it's like to use one of these C++ libraries.
#include"google/cloud/storage/client.h"#include"google/cloud/common_options.h"#include<cstdlib>#include<iostream>#include<string>intmain(int argc,char* argv[]) {if (argc !=2) { std::cerr <<"Missing bucket name.\n"; std::cerr <<"Usage: quickstart <bucket-name>\n";return1; } std::stringconst bucket_name = argv[1];// Create a client to communicate with Google Cloud Storage. This client// uses the default configuration for authentication and project id.auto options = google::cloud::Options{};// If the CURL_CA_BUNDLE environment variable is set, configure the client// to use it. This is required for the Windows CI environment where standard// system roots may not be sufficient or accessible by the hermetic build.autoconst* ca_bundle =std::getenv("CURL_CA_BUNDLE");if (ca_bundle !=nullptr) { options.set<google::cloud::CARootsFilePathOption>(ca_bundle); }auto client =google::cloud::storage::Client(options);auto writer = client.WriteObject(bucket_name,"quickstart.txt"); writer <<"Hello World!"; writer.Close();if (!writer.metadata()) { std::cerr <<"Error creating object:" << writer.metadata().status() <<"\n";return1; } std::cout <<"Successfully created object:" << *writer.metadata() <<"\n";auto reader = client.ReadObject(bucket_name,"quickstart.txt");if (!reader) { std::cerr <<"Error reading object:" << reader.status() <<"\n";return1; } std::string contents{std::istreambuf_iterator<char>{reader}, {}}; std::cout << contents <<"\n";return0;}
See each library'sREADME.md file for more information about:
- Where to find the documentation for the library and the service.
- How to get started using the library.
- How to incorporate the library into your build system.
- The library's support status if not Generally Available (GA); unless noted ina library's
README.md, these libraries are all GA and supported by Google.
Expand to see the full list of GA libraries
- Access Approval API[quickstart][reference]
- Access Context Manager API[quickstart][reference]
- Advisory Notifications API[quickstart][reference]
- Vertex AI API[quickstart][reference]
- AlloyDB API[quickstart][reference]
- API Gateway API[quickstart][reference]
- Apigee Connect API[quickstart][reference]
- API Keys API[quickstart][reference]
- App Engine Admin API[quickstart][reference]
- App Hub API[quickstart][reference]
- Artifact Registry API[quickstart][reference]
- Cloud Asset API[quickstart][reference]
- Assured Workloads API[quickstart][reference]
- Cloud AutoML API[quickstart][reference]
- Backup and DR Service API[quickstart][reference]
- Bare Metal Solution API[quickstart][reference]
- Batch API[quickstart][reference]
- BeyondCorp API[quickstart][reference]
- Google Cloud BigQuery[quickstart][reference]
- BigQuery API[quickstart][reference]
- Google Cloud Bigtable[quickstart][reference]
- Cloud Billing Budget API[quickstart][reference]
- Binary Authorization API[quickstart][reference]
- Certificate Manager API[quickstart][reference]
- Cloud Channel API[quickstart][reference]
- Chronicle API[quickstart][reference]
- Cloud Build API[quickstart][reference]
- Cloud Controls Partner API[quickstart][reference]
- Cloud Quotas API[quickstart][reference]
- Cloud Security Compliance API[quickstart][reference]
- Cloud Commerce Consumer Procurement API[quickstart][reference]
- Cloud Composer[quickstart][reference]
- Compute Engine API[quickstart][reference]
- Confidential Computing API[quickstart][reference]
- Infrastructure Manager API[quickstart][reference]
- Config Delivery API[quickstart][reference]
- Connectors API[quickstart][reference]
- Contact Center AI Insights API[quickstart][reference]
- Kubernetes Engine API[quickstart][reference]
- Container Analysis API[quickstart][reference]
- Document AI Warehouse API[quickstart][reference]
- Google Cloud Data Catalog API[quickstart][reference]
- Dataform API[quickstart][reference]
- Cloud Data Fusion API[quickstart][reference]
- Database Migration API[quickstart][reference]
- Cloud Dataplex API[quickstart][reference]
- Cloud Dataproc API[quickstart][reference]
- Cloud Datastore API[quickstart][reference]
- Datastream API[quickstart][reference]
- Google Cloud Deploy API[quickstart][reference]
- Developer Connect API[quickstart][reference]
- Device Streaming API[quickstart][reference]
- Dialogflow CX API[quickstart][reference]
- Dialogflow ES API[quickstart][reference]
- Discovery Engine API[quickstart][reference]
- Cloud Data Loss Prevention (DLP) API[quickstart][reference]
- Cloud Document AI API[quickstart][reference]
- Cloud Domains API[quickstart][reference]
- Distributed Cloud Edge Container API[quickstart][reference]
- Distributed Cloud Edge Network API[quickstart][reference]
- Essential Contacts API[quickstart][reference]
- Eventarc API[quickstart][reference]
- Cloud Filestore API[quickstart][reference]
- Financial Services API[quickstart][reference]
- Cloud Functions API[quickstart][reference]
- Backup for GKE API[quickstart][reference]
- Connect Gateway API[quickstart][reference]
- GKE Hub[quickstart][reference]
- Anthos Multi-Cloud API[quickstart][reference]
- Google Cloud IAM[quickstart][reference]
- Cloud Identity-Aware Proxy API[quickstart][reference]
- Cloud IDS API[quickstart][reference]
- Cloud Key Management Service (KMS) API[quickstart][reference]
- Cloud Natural Language API[quickstart][reference]
- License Manager API[quickstart][reference]
- Google Cloud Logging[quickstart][reference]
- Google Cloud Managed Lustre API[quickstart][reference]
- Maintenance API[quickstart][reference]
- Managed Service for Microsoft Active Directory API[quickstart][reference]
- Managed Service for Apache Kafka API[quickstart][reference]
- Cloud Memorystore for Memcached API[quickstart][reference]
- Memorystore API[quickstart][reference]
- Dataproc Metastore API[quickstart][reference]
- Migration Center API[quickstart][reference]
- Cloud Monitoring API[quickstart][reference]
- NetApp API[quickstart][reference]
- Network Connectivity API[quickstart][reference]
- Network Management API[quickstart][reference]
- Network Security API[quickstart][reference]
- Network Services API[quickstart][reference]
- Notebooks API[quickstart][reference]
- OAuth2 Access Token Generation[quickstart][reference]
- Cloud Optimization API[quickstart][reference]
- Oracle Database@Google Cloud API[quickstart][reference]
- Organization Policy API[quickstart][reference]
- OS Config API[quickstart][reference]
- Cloud OS Login API[quickstart][reference]
- Parallelstore API[quickstart][reference]
- Parameter Manager API[quickstart][reference]
- Policy Simulator API[quickstart][reference]
- Policy Troubleshooter API[quickstart][reference]
- Certificate Authority API[quickstart][reference]
- Privileged Access Manager API[quickstart][reference]
- Cloud Profiler API[quickstart][reference]
- Public Certificate Authority API[quickstart][reference]
- Google Cloud Pub/Sub[quickstart][reference]
- Rapid Migration Assessment API[quickstart][reference]
- reCAPTCHA Enterprise API[quickstart][reference]
- Recommender[quickstart][reference]
- Google Cloud Memorystore for Redis API[quickstart][reference]
- Cloud Resource Manager API[quickstart][reference]
- Retail API[quickstart][reference]
- Cloud Run Admin API[quickstart][reference]
- Cloud Scheduler API[quickstart][reference]
- Secret Manager API[quickstart][reference]
- Secure Source Manager API[quickstart][reference]
- Security Command Center API[quickstart][reference]
- Security Center Management API[quickstart][reference]
- Service Control API[quickstart][reference]
- Service Directory API[quickstart][reference]
- Service Health API[quickstart][reference]
- Service Management API[quickstart][reference]
- Service Usage API[quickstart][reference]
- Cloud Shell API[quickstart][reference]
- Google Cloud Spanner[quickstart][reference]
- Cloud Speech-to-Text API[quickstart][reference]
- Cloud SQL Admin API[quickstart][reference]
- Google Cloud Storage[quickstart][reference]
- Storage Batch Operations API[quickstart][reference]
- Storage Control API[quickstart][reference]
- Storage Insights API[quickstart][reference]
- Storage Transfer API[quickstart][reference]
- Google Cloud Support API[quickstart][reference]
- Cloud Talent Solution API[quickstart][reference]
- Cloud Tasks API[quickstart][reference]
- Telco Automation API[quickstart][reference]
- Cloud Text-to-Speech API[quickstart][reference]
- Timeseries Insights API[quickstart][reference]
- Cloud TPU API[quickstart][reference]
- Cloud Trace API[quickstart][reference]
- Cloud Translation API[quickstart][reference]
- Video Services[quickstart][reference]
- Cloud Video Intelligence API[quickstart][reference]
- Cloud Vision API[quickstart][reference]
- VM Migration API[quickstart][reference]
- VMware Engine API[quickstart][reference]
- Serverless VPC Access API[quickstart][reference]
- Web Risk API[quickstart][reference]
- Web Security Scanner API[quickstart][reference]
- Workflow Executions API[quickstart][reference]
- Cloud Workstations API[quickstart][reference]
This is a quickstart guide for developers wanting to compile the libraries andrun the examples included with the libraries.
- Packaging maintainers or developers who prefer to install the library in afixed directory (such as
/usr/localor/opt) should consult thepackaging guide. - Developers who prefer using a package manager such asvcpkg, orConda, should follow theinstructions for their package manager.
- Developers wanting to use the libraries as part of a larger CMake or Bazelproject should consult thequickstart guides for the library orlibraries they want to use.
- Developers wanting to compile the library just to run some examples or testsshould read the current document.
- Contributors and developers to
google-cloud-cppshould consult the guide toset up a development workstation.
This library requires Bazel >= 6.0. From the top-level directory, run the usualcommands.
bazel build //...
This library requires CMake >= 3.10. If you are planning to install thelibraries please consult thepackaging guide, theseinstructions willNOT produce artifacts that you can put in/usr/local, orshare with your colleagues.
From the top-level directory ofgoogle-cloud-cpp run these commands:
git -C$HOME clone https://github.com/microsoft/vcpkg.gitenv VCPKG_ROOT=$HOME/vcpkg$HOME/vcpkg/bootstrap-vcpkg.shcmake -S. -B cmake-out/ -DCMAKE_TOOLCHAIN_FILE=$HOME/vcpkg/scripts/buildsystems/vcpkg.cmakecmake --build cmake-out -- -j$(nproc)
The binary artifacts, such as examples, will be placed incmake-out/.
- This project follows Google'sFoundational C++ Support Policy, which is summarized in theFoundational C++ Support Matrix.
- Language Version (>= C++14).
- Operating Systems: Windows, macOS, and Linux.
- Build Systems: Bazel (>= 6.0), CMake (>= 3.10).
- Compilers: GCC (>= 7.5), Clang (>= 6.0), MSVC (>= 2022), Apple Clang (>=12).
- This project uses dependencies described indoc/packaging.md.
- This project works with or without exceptions enabled.
- This project cutsmonthly releaseswith detailed release notes.
This project follows Google'sOSS Library Breaking Change Policy.
In general, we avoid making backwards incompatible changes to ourpublic API. Sometimes such changes yield benefits to ourcustomers, in the form of better performance, easier-to-understand APIs, and/ormore consistent APIs across services. When these benefits warrant it, we will:
- Announce these changes prominently in our
CHANGELOG.mdfile and in theaffected release's notes. - Increase the major version for
google-cloud-cpp.
Nevertheless, though we take commercially reasonable efforts to prevent this, itis possible that backwards incompatible changes go undetected and, therefore,undocumented. We apologize if this is the case and welcome feedback or bugreports to rectify the problem.
- GitHub Discussions -- For questions and general comments
- GitHub Issues -- For reporting bugs and feature requests
SeeCONTRIBUTING.md for details on how to contribute tothis project, including how to build and test your changes as well as how toproperly format your code.
Apache 2.0; seeLICENSE for details.
About
C++ Client Libraries for Google Cloud Services
Topics
Resources
License
Code of conduct
Contributing
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.