Google Cloud C++ Client
2.7.0
C++ Client Library for Google Cloud Platform
|
Modules | |
Options only applicable when using REST transport | |
Classes | |
struct | google::cloud::EndpointOption |
Change the endpoint. More... | |
struct | google::cloud::UserAgentProductsOption |
User-agent products to include with each request. More... | |
struct | google::cloud::UserProjectOption |
Specifies a project for quota and billing purposes. More... | |
struct | google::cloud::AuthorityOption |
Configure the "authority" attribute. More... | |
struct | google::cloud::UnifiedCredentialsOption |
A wrapper to store credentials into an options. More... | |
struct | google::cloud::DelegatesOption |
Configure the delegates for MakeImpersonateServiceAccountCredentials() More... | |
struct | google::cloud::ScopesOption |
Configure the scopes for MakeImpersonateServiceAccountCredentials() More... | |
struct | google::cloud::AccessTokenLifetimeOption |
Configure the access token lifetime. More... | |
struct | google::cloud::CARootsFilePathOption |
Configures a custom CA (Certificates Authority) certificates file. More... | |
struct | google::cloud::GrpcCredentialOption |
The gRPC credentials used by clients configured with this object. More... | |
struct | google::cloud::GrpcNumChannelsOption |
The number of transport channels to create. More... | |
struct | google::cloud::GrpcChannelArgumentsOption |
A string-string map of arguments for grpc::ChannelArguments::SetString . More... | |
struct | google::cloud::GrpcChannelArgumentsNativeOption |
The native grpc::ChannelArguments object. More... | |
struct | google::cloud::GrpcTracingOptionsOption |
The TracingOptions to use when printing grpc protocol buffer messages. More... | |
struct | google::cloud::GrpcBackgroundThreadPoolSizeOption |
The size of the background thread pool. More... | |
struct | google::cloud::GrpcCompletionQueueOption |
The CompletionQueue to use for background gRPC work. More... | |
struct | google::cloud::GrpcBackgroundThreadsFactoryOption |
Changes the BackgroundThreadsFactory . More... | |
class | google::cloud::Options |
A class that holds option structs indexed by their type. More... | |
struct | google::cloud::RestTracingOptionsOption |
The TracingOptions to use when printing REST transport http messages. More... | |
While the client libraries defaults should work for most applications, there are multiple runtime configuration options that applications may need to set. For example, the application may need to override the endpoint used to access the service, or change the retry policies to be more strict (or lenient) than the defaults.
Applications use google::cloud::Options
to override the defaults. You can think of an instance of google::cloud::Options
as a set of overrides, indexed by a C++ type that uniquely identifies the option. There is no need for applications to fill this set with the defaults.
For most libraries overrides can be made at 3 different levels:
*Client
objects*Connection
objectsIn general, function call overrides take precedence over *Client
overrides, and these in turn take precedence over any overrides in the *Connection
override. However, most options can only be set when the *Connection
object is created. You need to consult the documentation for an option to determine if they are usable for a specific function call.
Consider this example:
In this case, rpc_4
will retry the request up to 7 times, because the value of the kms::RetryPolicyOption
overrides the values at the connection or client level. Meanwhile, rpc_3
will retry the request 5 times, because the value at the *Client
level overrides the value at the *Connection
level. Likewise, rpc_2
will retry the request 3 times, because this is the value in the *Connection
and there are no overrides in the client or function calls. Finally, rpc_1
will use the default. For this service the default is to retry for 30 minutes.
Note that only the connection overrides the g::EndpointOption
. Overriding this option at the *Client
or function call level would have no effect.
All libraries have options that are only meaningful for that library (and ignored by other libraries). In some cases, the option may be specific to a service* (sometimes called "an API"). In the previous example, the kms::KeyManagementServiceRetryPolicyOption
is only applicable to kms::KeyManagementServiceClient
and kms::KeyManagementServiceConnection
. Other services in the same library (e.g., kms::EkmServiceClient
) will ignore this option. Likewise, other services in different libraries (e.g. pubsub::Publisher
) will also ignore the option.