Contains all the Google Cloud C++ Library APIs.
google::cloud::mocks
Contains helpers for testing the Google Cloud C++ Client Libraries.
Classes
google::cloud::AsyncOperation
Represents a pending asynchronous operation.
google::cloud::AsyncStreamingReadWriteRpc
A streaming read-write RPC.
google::cloud::BackgroundThreads
A object representing the background threads available to a Client.
google::cloud::CompletionQueue
Call the functor associated with asynchronous operations when they complete.
google::cloud::ConnectionOptions
The configuration parameters for client connections.
google::cloud::Credentials
An opaque representation of the authentication configuration.
google::cloud::ErrorInfo
Describes the cause of the error with structured details.
google::cloud::future
Implement ISO/IEC TS 19571:2016 future<T>
.
google::cloud::future< void >
Implement ISO/IEC TS 19571:2016 future for void.
google::cloud::GenericPollingPolicy
Construct a polling policy from existing Retry and Backoff policies.
google::cloud::KmsKeyName
This class identifies a Google Cloud KMS Key.
google::cloud::LogBackend
The logging backend interface.
google::cloud::Logger
Define the class to capture a log message.
google::cloud::Logger< false >
Define the logger for a disabled log level.
google::cloud::LogSink
A sink to receive log records.
google::cloud::Options
A class that holds option structs indexed by their type.
google::cloud::PollingPolicy
Control the Cloud C++ client library behavior with respect to polling on long running operations.
google::cloud::Project
This class identifies a Cloud Project.
google::cloud::promise
Implement promise<T>
as defined in ISO/IEC TS 19571:2016.
google::cloud::promise< void >
Specialize promise as defined in ISO/IEC TS 19571:2016 for void.
google::cloud::RuntimeStatusError
A runtime error that wraps a google::cloud::Status
.
google::cloud::Status
Represents success or an error with info about the error.
google::cloud::StatusOr
Holds a value or a Status
indicating why there is no value.
google::cloud::StreamRange
A StreamRange
<T>
is a range of StatusOr
<T>
where the end-of-stream is indicated by a non-OK Status
.
google::cloud::TracingOptions
The configuration parameters for RPC/protobuf tracing.
Structs
google::cloud::AccessTokenLifetimeOption
Configure the access token lifetime.
google::cloud::AsyncTimerResult
The result of an async timer operation.
google::cloud::AuthorityOption
Configure the "authority" attribute.
google::cloud::CARootsFilePathOption
Configures a custom CA (Certificates Authority) certificates file.
google::cloud::DelegatesOption
Configure the delegates for MakeImpersonateServiceAccountCredentials()
google::cloud::EndpointOption
Change the endpoint.
google::cloud::ExperimentalTag
An argument type to indicate experimental functions.
google::cloud::GrpcBackgroundThreadPoolSizeOption
The size of the background thread pool.
google::cloud::GrpcBackgroundThreadsFactoryOption
Changes the BackgroundThreadsFactory
.
google::cloud::GrpcChannelArgumentsNativeOption
The native grpc::ChannelArguments
object.
google::cloud::GrpcChannelArgumentsOption
A string-string map of arguments for grpc::ChannelArguments::SetString
.
google::cloud::GrpcCompletionQueueOption
The CompletionQueue
to use for background gRPC work.
google::cloud::GrpcCredentialOption
The gRPC credentials used by clients configured with this object.
google::cloud::GrpcNumChannelsOption
The number of transport channels to create.
google::cloud::GrpcTracingOptionsOption
The TracingOptions
to use when printing grpc protocol buffer messages.
google::cloud::LogRecord
Represents a single log message.
google::cloud::NullStream
Implements operator<< for all types, without any effect.
google::cloud::QuotaUserOption
Configure the QuotaUser system parameter.
google::cloud::RestTracingOptionsOption
The TracingOptions
to use when printing REST transport http messages.
google::cloud::ScopesOption
Configure the scopes for MakeImpersonateServiceAccountCredentials()
google::cloud::ServerTimeoutOption
Timeout for the server to finish processing the request.
google::cloud::TracingComponentsOption
Return whether tracing is enabled for the given component
.
google::cloud::UnifiedCredentialsOption
A wrapper to store credentials into an options.
google::cloud::UserAgentProductsOption
User-agent products to include with each request.
google::cloud::UserIpOption
Configure the UserIp query parameter.
google::cloud::UserProjectOption
Specifies a project for quota and billing purposes.
Enums
Idempotency
Whether a request is idempotent.
Severity
Define the severity levels for Google Cloud Platform C++ Libraries logging.
StatusCode
Well-known status codes with grpc::StatusCode
-compatible values.
Functions
MakeInsecureCredentials
Create insecure (aka anonymous, aka unauthenticated) credentials.
These credentials are mostly intended for testing. Integration tests running against an emulator do not need to authenticate. In fact, it may be impossible to connect to an emulator using SSL/TLS because the emulators typically run without secure communication.
In addition, unit tests may benefit from using these credentials: loading the default credentials unnecessarily slows down the unit tests, and in some CI environments the credentials may fail to load, creating confusing warnings and sometimes even errors.
Parameter | |
---|---|
Name | Description |
opts |
optional configuration values. Note that the effect of these parameters depends on the underlying transport. For example, |
MakeGoogleDefaultCredentials
Creates the default credentials.
These are the most commonly used credentials, and are expected to meet the needs of most applications. The Google Default Credentials conform to aip/4110. Consider using these credentials when:
- Your application is deployed to a GCP environment such as GCE, GKE, or Cloud Run. Each of these deployment environments provides a default service account to the application, and offers mechanisms to change the default credentials without any code changes to your application.
- You are testing or developing the application on a workstation (physical or virtual). These credentials will use your preferences as set with gcloud auth application-default. These preferences can be your own GCP user credentials, or some service account.
- Regardless of where your application is running, you can use the
GOOGLE_APPLICATION_CREDENTIALS
environment variable to override the defaults. This environment variable should point to a file containing a service account key file, or a JSON object describing your user credentials.
See Also
https://cloud.google.com/docs/authentication for more information on authentication in GCP.
Parameter | |
---|---|
Name | Description |
opts |
optional configuration values. Note that the effect of these parameters depends on the underlying transport. For example, |
MakeAccessTokenCredentials
Creates credentials with a fixed access token.
These credentials are useful when using an out-of-band mechanism to fetch access tokens. Note that access tokens are time limited, you will need to manually refresh the tokens created by the
See Also
https://cloud.google.com/docs/authentication for more information on authentication in GCP.
Parameters | |
---|---|
Name | Description |
access_token |
the access token to be used by the client library. |
expiration |
the expiration time for the token. |
opts |
optional configuration values. Note that the effect of these parameters depends on the underlying transport. For example, |
MakeImpersonateServiceAccountCredentials
Creates credentials for service account impersonation.
Service account impersonation allows one account (user or service account) to act as a second account. This can be useful in multi-tenant services, where the service may perform some actions with an specific account associated with a tenant. The tenant can grant or restrict permissions to this tenant account.
When using service account impersonation is important to distinguish between the credentials used to obtain the target account credentials (the base_credentials
) parameter, and the credentials representing the target_service_account
.
Use AccessTokenLifetimeOption
to configure the maximum lifetime of the obtained credentials. The default is 1h (3600s), see IAM quotas for the limits set by the platform and how to override them.
Use DelegatesOption
to configure a sequence of intermediate service account, each of which has permissions to impersonate the next and the last one has permissions to impersonate target_service_account
.
Use ScopesOption
to restrict the authentication scope for the obtained credentials. See below for possible values.
See Also
https://cloud.google.com/docs/authentication for more information on authentication in GCP.
See Also
https://cloud.google.com/iam/docs/impersonating-service-accounts for information on managing service account impersonation.
See Also
https://developers.google.com/identity/protocols/oauth2/scopes for authentication scopes in Google Cloud Platform.
Parameters | |
---|---|
Name | Description |
base_credentials |
the credentials used to contact the IAM Credentials services. |
target_service_account |
the email address of the service account to impersonate. |
opts |
optional configuration values. Note that the effect of these parameters depends on the underlying transport. For example, |
MakeServiceAccountCredentials
Creates service account credentials from a service account key.
A service account is an account for an application or compute workload instead of an individual end user. The recommended practice is to use Google Default Credentials, which relies on the configuration of the Google Cloud system hosting your application (GCE, GKE, Cloud Run) to authenticate your workload or application. But sometimes you may need to create and download a service account key, for example, to use a service account when running your application on a system that is not part of Google Cloud.
Service account credentials are used in this latter case.
You can create multiple service account keys for a single service account. When you create a service account key, the key is returned as string, in the format described by aip/4112. This string contains an id for the service account, as well as the cryptographical materials (a RSA private key) required to authenticate the caller.
Therefore, services account keys should be treated as any other secret with security implications. Think of them as unencrypted passwords. Do not store them where unauthorized persons or programs may read them.
As stated above, most applications should probably use default credentials, maybe pointing them to a file with these contents. Using this function may be useful when the service account key is obtained from Cloud Secret Manager or a similar service.
Parameters | |
---|---|
Name | Description |
json_object |
the service account configuration as a JSON string. Typically applications read this from a file, or download the contents from something like Google's secret manager service. |
opts |
optional configuration values. Note that the effect of these parameters depends on the underlying transport. For example, |
MakeExternalAccountCredentials
Creates credentials based on external accounts.
Workload Identity Federation can grant on-premises or multi-cloud workloads access to Google Cloud resources, without using a service account key. You can use identity federation with Amazon Web Services (AWS), or with any identity provider that supports OpenID Connect (OIDC), such as Microsoft Azure, or SAML 2.0.
See Also
https://cloud.google.com/docs/authentication for more information on authentication in GCP.
Parameters | |
---|---|
Name | Description |
json_object |
the external account configuration as a JSON string. Typically applications read this from a file, or download the contents from something like Google's secret manager service. The configuration file can be created using the create-cred-config |
opts |
optional configuration values. Note that the effect of these parameters depends on the underlying transport. For example, |
make_ready_future
Create a future that is immediately ready.
Parameters | |
---|---|
Name | Description |
t |
|
typename T |
|
make_ready_future
Create a future that is immediately ready.
MakeStatusFromRpcError
Creates a google::cloud::Status
from a grpc::Status.
Parameter | |
---|---|
Name | Description |
status |
|
MakeStatusFromRpcError
Creates a google::cloud::Status
from a grpc::StatusCode and description.
Parameters | |
---|---|
Name | Description |
code |
|
what |
|
MakeStatusFromRpcError
Creates a google::cloud::Status
from a google:rpc::
Status
proto.
Some gRPC services return the google::rpc::Status
proto for errors. The libraries in google-cloud-cpp
represent these errors using a google::cloud::Status
.
Parameter | |
---|---|
Name | Description |
proto |
|
MakeKmsKeyName
Constructs a KmsKeyName
from the given full_name
.
Returns a non-OK Status if full_name
is improperly formed.
Parameter | |
---|---|
Name | Description |
full_name |
|
ParseSeverity
Convert a human-readable representation to a Severity.
Parameter | |
---|---|
Name | Description |
name |
|
MakeProject
Constructs a Project
from the given full_name
.
Returns a non-OK Status if full_name
is improperly formed.
Parameter | |
---|---|
Name | Description |
full_name |
|
StatusCodeToString
Convert code
to a human readable string.
Parameter | |
---|---|
Name | Description |
code |
|
make_status_or
Parameters | |
---|---|
Name | Description |
rhs |
|
typename T |
|
SetTerminateHandler
Install terminate handler and get the old one atomically.
Parameter | |
---|---|
Name | Description |
f |
the handler. It should never return, behaviour is undefined otherwise. |
GetTerminateHandler
Get the currently installed handler.
Terminate
Invoke the currently installed handler.
This function should never return.
Parameter | |
---|---|
Name | Description |
msg |
Details about the error. |
version_major
The Google Cloud C++ Client major version.
See Alsohttps://semver.org/spec/v2.0.0.html for details.
version_minor
The Google Cloud C++ Client minor version.
See Alsohttps://semver.org/spec/v2.0.0.html for details.
version_patch
The Google Cloud C++ Client patch version.
See Alsohttps://semver.org/spec/v2.0.0.html for details.
version_pre_release
The Google Cloud C++ Client pre-release version.
See Alsohttps://semver.org/spec/v2.0.0.html for details.
version
A single integer representing the Major/Minor/Patch version.
version_string
The version as a string, in MAJOR.MINOR.PATCH[-PRE][+gitrev] format.