Showing content from http://cloud.google.com/cpp/docs/reference/storage/2.41.0/storage-env below:
C++ Client Libraries | Google Cloud
Skip to main content
- Overview
-
Library reference docs
- Google Cloud Storage C++ Client Library
-
Namespaces
-
google::cloud::storage
- Overview
-
Classes
-
Functions
- PublicAccessPreventionEnforced()
- PublicAccessPreventionInherited()
- PublicAccessPreventionUnspecified()
- TEAM_EDITORS()
- TEAM_OWNERS()
- TEAM_VIEWERS()
- AutoFinalizeEnabled()
- AutoFinalizeDisabled()
- RpoDefault()
- RpoAsyncTurbo()
- CreateRandomPrefixName(std::string const &)
- DeleteByPrefix(Client &, std::string const &, std::string const &, Options &&...)
- ComposeMany(Client &, std::string const &, std::vector< ComposeSourceObject >, std::string const &, std::string, bool, Options &&...)
- MakeGrpcClient(Options)
- ComputeMD5Hash(absl::string_view)
- ComputeMD5Hash(std::string const &)
- ComputeMD5Hash(char const *)
- EnableMD5Hash()
- ComputeCrc32cChecksum(absl::string_view)
- ComputeCrc32cChecksum(std::string const &)
- ComputeCrc32cChecksum(char const *)
- ObjectRetentionUnlocked()
- ObjectRetentionLocked()
- ParallelUploadFile(Client, std::string, std::string, std::string, std::string, bool, Options &&...)
- FormatDateForForm(PolicyDocumentV4Result const &)
- AddExtensionHeader(std::string, std::string)
- WithGeneration(std::uint64_t)
- WithGenerationMarker(std::uint64_t)
- WithUserProject(std::string)
- WithMarker(std::string)
- WithResponseContentDisposition(std::string)
- WithResponseContentType(std::string const &)
- WithAcl()
- WithBilling()
- WithCompose()
- WithCors()
- WithEncryption()
- WithEncryptionConfig()
- WithLifecycle()
- WithLocation()
- WithLogging()
- WithStorageClass()
- WithTagging()
- AddExtensionField(std::string, std::string)
- RestoreResumableUploadSession(std::string)
- NewResumableUploadSession()
- version_major()
- version_minor()
- version_patch()
- version_pre_release()
- version()
- version_string()
- x_goog_api_client()
- EncryptionDataFromBinaryKey(std::string const &)
- EncryptionDataFromBase64Key(std::string const &)
- CreateKeyFromGenerator(Generator &)
- AcceptEncodingGzip()
- AcceptEncodingIdentity()
-
Operators
- operator==(CorsEntry const &, CorsEntry const &)
- operator<(CorsEntry const &, CorsEntry const &)
- operator!=(CorsEntry const &, CorsEntry const &)
- operator>(CorsEntry const &, CorsEntry const &)
- operator<=(CorsEntry const &, CorsEntry const &)
- operator>=(CorsEntry const &, CorsEntry const &)
- operator==(BucketCustomPlacementConfig const &, BucketCustomPlacementConfig const &)
- operator<(BucketCustomPlacementConfig const &, BucketCustomPlacementConfig const &)
- operator!=(BucketCustomPlacementConfig const &, BucketCustomPlacementConfig const &)
- operator>(BucketCustomPlacementConfig const &, BucketCustomPlacementConfig const &)
- operator<=(BucketCustomPlacementConfig const &, BucketCustomPlacementConfig const &)
- operator>=(BucketCustomPlacementConfig const &, BucketCustomPlacementConfig const &)
- operator==(UniformBucketLevelAccess const &, UniformBucketLevelAccess const &)
- operator<(UniformBucketLevelAccess const &, UniformBucketLevelAccess const &)
- operator!=(UniformBucketLevelAccess const &, UniformBucketLevelAccess const &)
- operator>(UniformBucketLevelAccess const &, UniformBucketLevelAccess const &)
- operator<=(UniformBucketLevelAccess const &, UniformBucketLevelAccess const &)
- operator>=(UniformBucketLevelAccess const &, UniformBucketLevelAccess const &)
- operator==(BucketIamConfiguration const &, BucketIamConfiguration const &)
- operator<(BucketIamConfiguration const &, BucketIamConfiguration const &)
- operator!=(BucketIamConfiguration const &, BucketIamConfiguration const &)
- operator>(BucketIamConfiguration const &, BucketIamConfiguration const &)
- operator<=(BucketIamConfiguration const &, BucketIamConfiguration const &)
- operator>=(BucketIamConfiguration const &, BucketIamConfiguration const &)
- operator==(BucketLifecycle const &, BucketLifecycle const &)
- operator<(BucketLifecycle const &, BucketLifecycle const &)
- operator!=(BucketLifecycle const &, BucketLifecycle const &)
- operator>(BucketLifecycle const &, BucketLifecycle const &)
- operator<=(BucketLifecycle const &, BucketLifecycle const &)
- operator>=(BucketLifecycle const &, BucketLifecycle const &)
- operator<<(std::ostream &, AutoFinalize const &)
- operator<<(std::ostream &, BucketAccessControl const &)
- operator==(BucketAutoclass const &, BucketAutoclass const &)
- operator!=(BucketAutoclass const &, BucketAutoclass const &)
- operator<<(std::ostream &, BucketAutoclass const &)
- operator==(BucketBilling const &, BucketBilling const &)
- operator<(BucketBilling const &, BucketBilling const &)
- operator!=(BucketBilling const &, BucketBilling const &)
- operator>(BucketBilling const &, BucketBilling const &)
- operator<=(BucketBilling const &, BucketBilling const &)
- operator>=(BucketBilling const &, BucketBilling const &)
- operator<<(std::ostream &, CorsEntry const &)
- operator<<(std::ostream &, BucketCustomPlacementConfig const &)
- operator==(BucketEncryption const &, BucketEncryption const &)
- operator<(BucketEncryption const &, BucketEncryption const &)
- operator!=(BucketEncryption const &, BucketEncryption const &)
- operator>(BucketEncryption const &, BucketEncryption const &)
- operator<=(BucketEncryption const &, BucketEncryption const &)
- operator>=(BucketEncryption const &, BucketEncryption const &)
- operator==(BucketHierarchicalNamespace const &, BucketHierarchicalNamespace const &)
- operator!=(BucketHierarchicalNamespace const &, BucketHierarchicalNamespace const &)
- operator<<(std::ostream &, BucketHierarchicalNamespace const &)
- operator<<(std::ostream &, UniformBucketLevelAccess const &)
- operator<<(std::ostream &, BucketIamConfiguration const &)
- operator==(BucketLogging const &, BucketLogging const &)
- operator<(BucketLogging const &, BucketLogging const &)
- operator!=(BucketLogging const &, BucketLogging const &)
- operator>(BucketLogging const &, BucketLogging const &)
- operator<=(BucketLogging const &, BucketLogging const &)
- operator>=(BucketLogging const &, BucketLogging const &)
- operator<<(std::ostream &, BucketLogging const &)
- operator<<(std::ostream &, BucketMetadata const &)
- operator==(BucketObjectRetention const &, BucketObjectRetention const &)
- operator!=(BucketObjectRetention const &, BucketObjectRetention const &)
- operator<<(std::ostream &, BucketObjectRetention const &)
- operator==(BucketRetentionPolicy const &, BucketRetentionPolicy const &)
- operator<(BucketRetentionPolicy const &, BucketRetentionPolicy const &)
- operator!=(BucketRetentionPolicy const &, BucketRetentionPolicy const &)
- operator>(BucketRetentionPolicy const &, BucketRetentionPolicy const &)
- operator<=(BucketRetentionPolicy const &, BucketRetentionPolicy const &)
- operator>=(BucketRetentionPolicy const &, BucketRetentionPolicy const &)
- operator<<(std::ostream &, BucketRetentionPolicy const &)
- operator==(BucketSoftDeletePolicy const &, BucketSoftDeletePolicy const &)
- operator!=(BucketSoftDeletePolicy const &, BucketSoftDeletePolicy const &)
- operator<<(std::ostream &, BucketSoftDeletePolicy const &)
- operator==(BucketVersioning const &, BucketVersioning const &)
- operator<(BucketVersioning const &, BucketVersioning const &)
- operator!=(BucketVersioning const &, BucketVersioning const &)
- operator>(BucketVersioning const &, BucketVersioning const &)
- operator<=(BucketVersioning const &, BucketVersioning const &)
- operator>=(BucketVersioning const &, BucketVersioning const &)
- operator==(BucketWebsite const &, BucketWebsite const &)
- operator<(BucketWebsite const &, BucketWebsite const &)
- operator!=(BucketWebsite const &, BucketWebsite const &)
- operator>(BucketWebsite const &, BucketWebsite const &)
- operator<=(BucketWebsite const &, BucketWebsite const &)
- operator>=(BucketWebsite const &, BucketWebsite const &)
- operator<<(std::ostream &, ReadRangeData const &)
- operator==(HmacKeyMetadata const &, HmacKeyMetadata const &)
- operator!=(HmacKeyMetadata const &, HmacKeyMetadata const &)
- operator<<(std::ostream &, HmacKeyMetadata const &)
- operator<<(std::ostream &, NativeExpression const &)
- operator<<(std::ostream &, NativeIamBinding const &)
- operator<<(std::ostream &, NativeIamPolicy const &)
- operator==(LifecycleRuleAction const &, LifecycleRuleAction const &)
- operator<(LifecycleRuleAction const &, LifecycleRuleAction const &)
- operator!=(LifecycleRuleAction const &, LifecycleRuleAction const &)
- operator>(LifecycleRuleAction const &, LifecycleRuleAction const &)
- operator<=(LifecycleRuleAction const &, LifecycleRuleAction const &)
- operator>=(LifecycleRuleAction const &, LifecycleRuleAction const &)
- operator<<(std::ostream &, LifecycleRuleAction const &)
- operator==(LifecycleRuleCondition const &, LifecycleRuleCondition const &)
- operator<(LifecycleRuleCondition const &, LifecycleRuleCondition const &)
- operator!=(LifecycleRuleCondition const &, LifecycleRuleCondition const &)
- operator>(LifecycleRuleCondition const &, LifecycleRuleCondition const &)
- operator<=(LifecycleRuleCondition const &, LifecycleRuleCondition const &)
- operator>=(LifecycleRuleCondition const &, LifecycleRuleCondition const &)
- operator<<(std::ostream &, LifecycleRuleCondition const &)
- operator==(LifecycleRule const &, LifecycleRule const &)
- operator<(LifecycleRule const &, LifecycleRule const &)
- operator!=(LifecycleRule const &, LifecycleRule const &)
- operator>(LifecycleRule const &, LifecycleRule const &)
- operator<=(LifecycleRule const &, LifecycleRule const &)
- operator>=(LifecycleRule const &, LifecycleRule const &)
- operator<<(std::ostream &, LifecycleRule const &)
- operator==(NotificationMetadata const &, NotificationMetadata const &)
- operator<(NotificationMetadata const &, NotificationMetadata const &)
- operator!=(NotificationMetadata const &, NotificationMetadata const &)
- operator>(NotificationMetadata const &, NotificationMetadata const &)
- operator<=(NotificationMetadata const &, NotificationMetadata const &)
- operator>=(NotificationMetadata const &, NotificationMetadata const &)
- operator<<(std::ostream &, NotificationMetadata const &)
- operator<<(std::ostream &, ObjectAccessControl const &)
- operator<<(std::ostream &, ComposeSourceObject const &)
- operator==(CustomerEncryption const &, CustomerEncryption const &)
- operator<(CustomerEncryption const &, CustomerEncryption const &)
- operator!=(CustomerEncryption const &, CustomerEncryption const &)
- operator>(CustomerEncryption const &, CustomerEncryption const &)
- operator<=(CustomerEncryption const &, CustomerEncryption const &)
- operator>=(CustomerEncryption const &, CustomerEncryption const &)
- operator<<(std::ostream &, ObjectMetadata const &)
- operator==(ObjectRetention const &, ObjectRetention const &)
- operator!=(ObjectRetention const &, ObjectRetention const &)
- operator<<(std::ostream &, ObjectRetention const &)
- operator==(Owner const &, Owner const &)
- operator<(Owner const &, Owner const &)
- operator!=(Owner const &, Owner const &)
- operator>(Owner const &, Owner const &)
- operator<=(Owner const &, Owner const &)
- operator>=(Owner const &, Owner const &)
- operator==(PolicyDocumentCondition const &, PolicyDocumentCondition const &)
- operator<(PolicyDocumentCondition const &, PolicyDocumentCondition const &)
- operator!=(PolicyDocumentCondition const &, PolicyDocumentCondition const &)
- operator>(PolicyDocumentCondition const &, PolicyDocumentCondition const &)
- operator<=(PolicyDocumentCondition const &, PolicyDocumentCondition const &)
- operator>=(PolicyDocumentCondition const &, PolicyDocumentCondition const &)
- operator<<(std::ostream &, PolicyDocumentCondition const &)
- operator<<(std::ostream &, PolicyDocument const &)
- operator<<(std::ostream &, PolicyDocumentV4 const &)
- operator<<(std::ostream &, PolicyDocumentResult const &)
- operator<<(std::ostream &, PolicyDocumentV4Result const &)
- operator==(ProjectTeam const &, ProjectTeam const &)
- operator<(ProjectTeam const &, ProjectTeam const &)
- operator!=(ProjectTeam const &, ProjectTeam const &)
- operator>(ProjectTeam const &, ProjectTeam const &)
- operator<=(ProjectTeam const &, ProjectTeam const &)
- operator>=(ProjectTeam const &, ProjectTeam const &)
- operator==(ServiceAccount const &, ServiceAccount const &)
- operator<(ServiceAccount const &, ServiceAccount const &)
- operator!=(ServiceAccount const &, ServiceAccount const &)
- operator>(ServiceAccount const &, ServiceAccount const &)
- operator<=(ServiceAccount const &, ServiceAccount const &)
- operator>=(ServiceAccount const &, ServiceAccount const &)
- operator<<(std::ostream &, ServiceAccount const &)
- operator<<(std::ostream &, CustomHeader const &)
- operator<<(std::ostream &, EncryptionKey const &)
- operator<<(std::ostream &, SourceEncryptionKey const &)
-
google::cloud::storage::event_type
-
google::cloud::storage::oauth2
- Overview
-
Classes
-
AuthorizedUserCredentials<HttpRequestBuilderType, ClockType>
-
ComputeEngineCredentials<HttpRequestBuilderType, ClockType>
-
ServiceAccountCredentials<HttpRequestBuilderType, ClockType>
-
Functions
- CreateAnonymousCredentials()
- CreateAuthorizedUserCredentialsFromJsonFilePath(std::string const &)
- CreateAuthorizedUserCredentialsFromJsonContents(std::string const &, ChannelOptions const &)
- CreateServiceAccountCredentialsFromFilePath(std::string const &)
- CreateServiceAccountCredentialsFromFilePath(std::string const &, absl::optional< std::set< std::string > >, absl::optional< std::string >)
- CreateServiceAccountCredentialsFromJsonFilePath(std::string const &)
- CreateServiceAccountCredentialsFromJsonFilePath(std::string const &, absl::optional< std::set< std::string > >, absl::optional< std::string >, ChannelOptions const &)
- CreateServiceAccountCredentialsFromP12FilePath(std::string const &)
- CreateServiceAccountCredentialsFromP12FilePath(std::string const &, absl::optional< std::set< std::string > >, absl::optional< std::string >, ChannelOptions const &)
- ParseAuthorizedUserRefreshResponse(storage::internal::HttpResponse const &, std::chrono::system_clock::time_point)
- ParseAuthorizedUserCredentials(std::string const &, std::string const &, std::string const &)
- ParseMetadataServerResponse(storage::internal::HttpResponse const &)
- ParseComputeEngineRefreshResponse(storage::internal::HttpResponse const &, std::chrono::system_clock::time_point)
- GoogleOAuthAccessTokenLifetime()
- GoogleOAuthAccessTokenExpirationSlack()
- GoogleOAuthRefreshEndpoint()
- GoogleOAuthScopeCloudPlatform()
- GoogleAdcEnvVar()
- GoogleAdcFilePathFromEnvVarOrEmpty()
- GoogleAdcFilePathFromWellKnownPathOrEmpty()
- GoogleGcloudAdcFileEnvVar()
- GoogleAdcHomeEnvVar()
- GoogleDefaultCredentials(ChannelOptions const &)
- CreateServiceAccountCredentialsFromDefaultPaths(ChannelOptions const &)
- CreateServiceAccountCredentialsFromDefaultPaths(absl::optional< std::set< std::string > >, absl::optional< std::string >, ChannelOptions const &)
- CreateServiceAccountCredentialsFromJsonContents(std::string const &, ChannelOptions const &)
- CreateServiceAccountCredentialsFromJsonContents(std::string const &, absl::optional< std::set< std::string > >, absl::optional< std::string >, ChannelOptions const &)
- CreateComputeEngineCredentials()
- CreateComputeEngineCredentials(std::string const &)
- ParseServiceAccountCredentials(std::string const &, std::string const &, std::string const &)
- ParseServiceAccountP12File(std::string const &, std::string const &)
- ParseServiceAccountRefreshResponse(storage::internal::HttpResponse const &, std::chrono::system_clock::time_point)
- AssertionComponentsFromInfo(ServiceAccountCredentialsInfo const &, std::chrono::system_clock::time_point)
- MakeJWTAssertion(std::string const &, std::string const &, std::string const &)
- CreateServiceAccountRefreshPayload(ServiceAccountCredentialsInfo const &, std::string const &, std::chrono::system_clock::time_point)
- MakeSelfSignedJWT(ServiceAccountCredentialsInfo const &, std::chrono::system_clock::time_point)
- ServiceAccountUseOAuth(ServiceAccountCredentialsInfo const &)
-
google::cloud::storage::payload_format
-
google::cloud::storage::storage_class
-
google::cloud::storage_experimental
- Overview
-
Classes
-
AsyncClient
- Overview
-
Functions
- InsertObject(BucketName const &, std::string, Collection &&, Options)
- InsertObject(google::storage::v2::WriteObjectRequest, Collection &&, Options)
- InsertObject(google::storage::v2::WriteObjectRequest, WritePayload, Options)
- Open(BucketName const &, std::string, Options)
- Open(google::storage::v2::BidiReadObjectSpec, Options)
- ReadObject(BucketName const &, std::string, Options)
- ReadObject(google::storage::v2::ReadObjectRequest, Options)
- ReadObjectRange(BucketName const &, std::string, std::int64_t, std::int64_t, Options)
- ReadObjectRange(google::storage::v2::ReadObjectRequest, std::int64_t, std::int64_t, Options)
- StartAppendableObjectUpload(BucketName const &, std::string, Options)
- StartAppendableObjectUpload(google::storage::v2::BidiWriteObjectRequest, Options)
- ResumeAppendableObjectUpload(BucketName const &, std::string, std::int64_t, Options)
- StartBufferedUpload(BucketName const &, std::string, Options)
- StartBufferedUpload(google::storage::v2::StartResumableWriteRequest, Options)
- ResumeBufferedUpload(std::string, Options)
- ResumeBufferedUpload(google::storage::v2::QueryWriteStatusRequest, Options)
- StartUnbufferedUpload(BucketName const &, std::string, Options)
- StartUnbufferedUpload(google::storage::v2::StartResumableWriteRequest, Options)
- ResumeUnbufferedUpload(std::string, Options)
- ResumeUnbufferedUpload(google::storage::v2::QueryWriteStatusRequest, Options)
- ComposeObject(BucketName const &, std::string, std::vector< google::storage::v2::ComposeObjectRequest::SourceObject >, Options)
- ComposeObject(google::storage::v2::ComposeObjectRequest, Options)
- DeleteObject(BucketName const &, std::string, Options)
- DeleteObject(BucketName const &, std::string, std::int64_t, Options)
- DeleteObject(google::storage::v2::DeleteObjectRequest, Options)
- StartRewrite(BucketName const &, std::string, BucketName const &, std::string, Options)
- StartRewrite(google::storage::v2::RewriteObjectRequest, Options)
- ResumeRewrite(BucketName const &, std::string, BucketName const &, std::string, std::string, Options)
- ResumeRewrite(google::storage::v2::RewriteObjectRequest, Options)
-
google::cloud::storage_mocks
Stay organized with collections Save and categorize content based on your preferences.
Environment Variables
A number of environment variables can be used to configure the behavior of the library. There are also functions to configure this behavior in code. The environment variables are convenient when troubleshooting problems.
Setting the Default Project
Some of the GCS APIs need a project as a parameter. For such APIs the application can (a) call an overload that takes the project id as a parameter, (b) define the project explicitly when the Client
object is constructed, or (c) set the GOOGLE_CLOUD_PROJECT
environment variable to the desired project id. If you have set this environment variable the code can be even simpler:
namespace gcs = ::google::cloud::storage;
using ::google::cloud::StatusOr;
[](gcs::Client client, std::string const& bucket_name) {
StatusOr<gcs::BucketMetadata> bucket_metadata =
client.CreateBucket(bucket_name, gcs::BucketMetadata());
if (!bucket_metadata) throw std::move(bucket_metadata).status();
std::cout << "Bucket " << bucket_metadata->name() << " created."
<< "\nFull Metadata: " << *bucket_metadata << "\n";
}
See Also
google::cloud::storage::ProjectIdOption
Endpoint Overrides
CLOUD_STORAGE_EMULATOR_ENDPOINT=...
: override the default endpoint used by the library. Intended for testing only.
CLOUD_STORAGE_TESTBENCH_ENDPOINT=...
: DEPRECATED please use CLOUD_STORAGE_EMULATOR_ENDPOINT
instead.
See Also
google::cloud::storage::RestEndpointOption
See Also
google::cloud::storage::IamEndpointOption
Enabling Experimental Behaviors
GOOGLE_CLOUD_CPP_STORAGE_REST_CONFIG=...
: configuration for the REST protocol, but currently unused.
GOOGLE_CLOUD_CPP_STORAGE_GRPC_CONFIG=...
: this is deprecated.
Logging
CLOUD_STORAGE_ENABLE_TRACING=raw-client
: enables logging for each "RPC" generated by the library. Unless you have configured your own logging backend, you should also set GOOGLE_CLOUD_CPP_ENABLE_CLOG
to produce any output on the program's console.
CLOUD_STORAGE_ENABLE_TRACING=http
: enables logging for the full http traffic generated by the library.
CLOUD_STORAGE_ENABLE_TRACING=raw-client,http
: enables all logging.
See Also
google::cloud::GrpcTracingOptionsOption
GOOGLE_CLOUD_CPP_ENABLE_CLOG=yes
: turns on logging in the library, basically the library always "logs" but the logging infrastructure has no backend to actually print anything until the application sets a backend or they set this environment variable.
See Also
google::cloud::LogBackend
See Also
google::cloud::LogSink
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-14 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-14 UTC."],[],[]]
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4