- 2.56.0 (latest)
- 2.55.0
- 2.54.0
- 2.53.3
- 2.52.3
- 2.50.0
- 2.49.0
- 2.48.2
- 2.47.0
- 2.46.0
- 2.45.0
- 2.44.1
- 2.43.2
- 2.42.0
- 2.41.0
- 2.40.1
- 2.39.0
- 2.38.0
- 2.37.0
- 2.36.1
- 2.34.0
- 2.33.0
- 2.32.1
- 2.30.1
- 2.29.1
- 2.28.0
- 2.27.1
- 2.24.0
- 2.23.0
- 2.22.6
- 2.21.0
- 2.20.2
- 2.19.0
- 2.18.0
- 2.17.2
- 2.16.0
- 2.15.1
- 2.14.0
- 2.13.1
- 2.12.0
- 2.11.3
- 2.10.0
- 2.9.3
- 2.8.1
- 2.7.1
- 2.6.1
- 2.5.1
- 2.4.5
- 2.3.0
- 2.2.3
- 2.1.10
A client to Cloud Storage API
The interfaces provided are listed below, along with usage samples.
StorageClient
Service Description: ## API Overview and Naming Syntax
The Cloud Storage gRPC API allows applications to read and write data through the abstractions of buckets and objects. For a description of these abstractions please see https://cloud.google.com/storage/docs .
Resources are named as follows: - Projects are referred to as they are defined by the Resource
Manager API, using strings like projects/123456
or projects/my-string-id
. - Buckets are named
using string names of the form: projects/{project}/buckets/{bucket}
For globally unique
buckets, _
may be substituted for the project. - Objects are uniquely identified by their name
along with the name of the bucket they belong to, as separate strings in this API. For example:
ReadObjectRequest { bucket: 'projects/_/buckets/my-bucket' object: 'my-object' } Note that
object names can contain /
characters, which are treated as any other character (no special
directory semantics).
Sample for StorageClient:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try
(
StorageClient
storageClient
=
StorageClient
.
create
())
{
BucketName
name
=
BucketName
.
of
(
"[PROJECT]"
,
"[BUCKET]"
);
storageClient
.
deleteBucket
(
name
);
}
Classes
BidiWriteObjectRequest
Request message for BidiWriteObject.
Protobuf type google.storage.v2.BidiWriteObjectRequest
BidiWriteObjectRequest.Builder
Request message for BidiWriteObject.
Protobuf type google.storage.v2.BidiWriteObjectRequest
BidiWriteObjectResponse
Response message for BidiWriteObject.
Protobuf type google.storage.v2.BidiWriteObjectResponse
BidiWriteObjectResponse.Builder
Response message for BidiWriteObject.
Protobuf type google.storage.v2.BidiWriteObjectResponse
Bucket
A bucket.
Protobuf type google.storage.v2.Bucket
Bucket.Autoclass
Configuration for a bucket's Autoclass feature.
Protobuf type google.storage.v2.Bucket.Autoclass
Bucket.Autoclass.Builder
Configuration for a bucket's Autoclass feature.
Protobuf type google.storage.v2.Bucket.Autoclass
Bucket.Billing
Billing properties of a bucket.
Protobuf type google.storage.v2.Bucket.Billing
Bucket.Billing.Builder
Billing properties of a bucket.
Protobuf type google.storage.v2.Bucket.Billing
Bucket.Builder
A bucket.
Protobuf type google.storage.v2.Bucket
Bucket.Cors
Cross-Origin Response sharing (CORS) properties for a bucket. For more on Cloud Storage and CORS, see https://cloud.google.com/storage/docs/cross-origin . For more on CORS in general, see https://tools.ietf.org/html/rfc6454 .
Protobuf type google.storage.v2.Bucket.Cors
Bucket.Cors.Builder
Cross-Origin Response sharing (CORS) properties for a bucket. For more on Cloud Storage and CORS, see https://cloud.google.com/storage/docs/cross-origin . For more on CORS in general, see https://tools.ietf.org/html/rfc6454 .
Protobuf type google.storage.v2.Bucket.Cors
Bucket.CustomPlacementConfig
Configuration for Custom Dual Regions. It should specify precisely two eligible regions within the same Multiregion. More information on regions may be found https://cloud.google.com/storage/docs/locations .
Protobuf type google.storage.v2.Bucket.CustomPlacementConfig
Bucket.CustomPlacementConfig.Builder
Configuration for Custom Dual Regions. It should specify precisely two eligible regions within the same Multiregion. More information on regions may be found https://cloud.google.com/storage/docs/locations .
Protobuf type google.storage.v2.Bucket.CustomPlacementConfig
Bucket.Encryption
Encryption properties of a bucket.
Protobuf type google.storage.v2.Bucket.Encryption
Bucket.Encryption.Builder
Encryption properties of a bucket.
Protobuf type google.storage.v2.Bucket.Encryption
Bucket.IamConfig
Bucket restriction options.
Protobuf type google.storage.v2.Bucket.IamConfig
Bucket.IamConfig.Builder
Bucket restriction options.
Protobuf type google.storage.v2.Bucket.IamConfig
Bucket.IamConfig.UniformBucketLevelAccess
Settings for Uniform Bucket level access. See https://cloud.google.com/storage/docs/uniform-bucket-level-access .
Protobuf type google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess
Bucket.IamConfig.UniformBucketLevelAccess.Builder
Settings for Uniform Bucket level access. See https://cloud.google.com/storage/docs/uniform-bucket-level-access .
Protobuf type google.storage.v2.Bucket.IamConfig.UniformBucketLevelAccess
Bucket.Lifecycle
Lifecycle properties of a bucket. For more information, see https://cloud.google.com/storage/docs/lifecycle .
Protobuf type google.storage.v2.Bucket.Lifecycle
Bucket.Lifecycle.Builder
Lifecycle properties of a bucket. For more information, see https://cloud.google.com/storage/docs/lifecycle .
Protobuf type google.storage.v2.Bucket.Lifecycle
Bucket.Lifecycle.Rule
A lifecycle Rule, combining an action to take on an object and a condition which will trigger that action.
Protobuf type google.storage.v2.Bucket.Lifecycle.Rule
Bucket.Lifecycle.Rule.Action
An action to take on an object.
Protobuf type google.storage.v2.Bucket.Lifecycle.Rule.Action
Bucket.Lifecycle.Rule.Action.Builder
An action to take on an object.
Protobuf type google.storage.v2.Bucket.Lifecycle.Rule.Action
Bucket.Lifecycle.Rule.Builder
A lifecycle Rule, combining an action to take on an object and a condition which will trigger that action.
Protobuf type google.storage.v2.Bucket.Lifecycle.Rule
Bucket.Lifecycle.Rule.Condition
A condition of an object which triggers some action.
Protobuf type google.storage.v2.Bucket.Lifecycle.Rule.Condition
Bucket.Lifecycle.Rule.Condition.Builder
A condition of an object which triggers some action.
Protobuf type google.storage.v2.Bucket.Lifecycle.Rule.Condition
Bucket.Logging
Logging-related properties of a bucket.
Protobuf type google.storage.v2.Bucket.Logging
Bucket.Logging.Builder
Logging-related properties of a bucket.
Protobuf type google.storage.v2.Bucket.Logging
Bucket.RetentionPolicy
Retention policy properties of a bucket.
Protobuf type google.storage.v2.Bucket.RetentionPolicy
Bucket.RetentionPolicy.Builder
Retention policy properties of a bucket.
Protobuf type google.storage.v2.Bucket.RetentionPolicy
Bucket.SoftDeletePolicy
Soft delete policy properties of a bucket.
Protobuf type google.storage.v2.Bucket.SoftDeletePolicy
Bucket.SoftDeletePolicy.Builder
Soft delete policy properties of a bucket.
Protobuf type google.storage.v2.Bucket.SoftDeletePolicy
Bucket.Versioning
Properties of a bucket related to versioning. For more on Cloud Storage versioning, see https://cloud.google.com/storage/docs/object-versioning .
Protobuf type google.storage.v2.Bucket.Versioning
Bucket.Versioning.Builder
Properties of a bucket related to versioning. For more on Cloud Storage versioning, see https://cloud.google.com/storage/docs/object-versioning .
Protobuf type google.storage.v2.Bucket.Versioning
Bucket.Website
Properties of a bucket related to accessing the contents as a static website. For more on hosting a static website via Cloud Storage, see https://cloud.google.com/storage/docs/hosting-static-website .
Protobuf type google.storage.v2.Bucket.Website
Bucket.Website.Builder
Properties of a bucket related to accessing the contents as a static website. For more on hosting a static website via Cloud Storage, see https://cloud.google.com/storage/docs/hosting-static-website .
Protobuf type google.storage.v2.Bucket.Website
BucketAccessControl
An access-control entry.
Protobuf type google.storage.v2.BucketAccessControl
BucketAccessControl.Builder
An access-control entry.
Protobuf type google.storage.v2.BucketAccessControl
BucketName
BucketName.Builder
Builder for projects/{project}/buckets/{bucket}.
CancelResumableWriteRequest
Message for canceling an in-progress resumable upload. upload_id
mustbe set.
Protobuf type google.storage.v2.CancelResumableWriteRequest
CancelResumableWriteRequest.Builder
Message for canceling an in-progress resumable upload. upload_id
mustbe set.
Protobuf type google.storage.v2.CancelResumableWriteRequest
CancelResumableWriteResponse
Empty response message for canceling an in-progress resumable upload, will be extended as needed.
Protobuf type google.storage.v2.CancelResumableWriteResponse
CancelResumableWriteResponse.Builder
Empty response message for canceling an in-progress resumable upload, will be extended as needed.
Protobuf type google.storage.v2.CancelResumableWriteResponse
ChecksummedData
Message used to convey content being read or written, along with an optional checksum.
Protobuf type google.storage.v2.ChecksummedData
ChecksummedData.Builder
Message used to convey content being read or written, along with an optional checksum.
Protobuf type google.storage.v2.ChecksummedData
CommonObjectRequestParams
Parameters that can be passed to any object request.
Protobuf type google.storage.v2.CommonObjectRequestParams
CommonObjectRequestParams.Builder
Parameters that can be passed to any object request.
Protobuf type google.storage.v2.CommonObjectRequestParams
ComposeObjectRequest
Request message for ComposeObject.
Protobuf type google.storage.v2.ComposeObjectRequest
ComposeObjectRequest.Builder
Request message for ComposeObject.
Protobuf type google.storage.v2.ComposeObjectRequest
ComposeObjectRequest.SourceObject
Description of a source object for a composition request.
Protobuf type google.storage.v2.ComposeObjectRequest.SourceObject
ComposeObjectRequest.SourceObject.Builder
Description of a source object for a composition request.
Protobuf type google.storage.v2.ComposeObjectRequest.SourceObject
ComposeObjectRequest.SourceObject.ObjectPreconditions
Preconditions for a source object of a composition request.
Protobuf type google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions
ComposeObjectRequest.SourceObject.ObjectPreconditions.Builder
Preconditions for a source object of a composition request.
Protobuf type google.storage.v2.ComposeObjectRequest.SourceObject.ObjectPreconditions
ContentRange
Specifies a requested range of bytes to download.
Protobuf type google.storage.v2.ContentRange
ContentRange.Builder
Specifies a requested range of bytes to download.
Protobuf type google.storage.v2.ContentRange
CreateBucketRequest
Request message for CreateBucket.
Protobuf type google.storage.v2.CreateBucketRequest
CreateBucketRequest.Builder
Request message for CreateBucket.
Protobuf type google.storage.v2.CreateBucketRequest
CreateHmacKeyRequest
Request message for CreateHmacKey.
Protobuf type google.storage.v2.CreateHmacKeyRequest
CreateHmacKeyRequest.Builder
Request message for CreateHmacKey.
Protobuf type google.storage.v2.CreateHmacKeyRequest
CreateHmacKeyResponse
Create hmac response. The only time the secret for an HMAC will be returned.
Protobuf type google.storage.v2.CreateHmacKeyResponse
CreateHmacKeyResponse.Builder
Create hmac response. The only time the secret for an HMAC will be returned.
Protobuf type google.storage.v2.CreateHmacKeyResponse
CreateNotificationConfigRequest
Request message for CreateNotificationConfig.
Protobuf type google.storage.v2.CreateNotificationConfigRequest
CreateNotificationConfigRequest.Builder
Request message for CreateNotificationConfig.
Protobuf type google.storage.v2.CreateNotificationConfigRequest
CryptoKeyName
CryptoKeyName.Builder
Builder for projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}.
CustomerEncryption
Describes the Customer-Supplied Encryption Key mechanism used to store an Object's data at rest.
Protobuf type google.storage.v2.CustomerEncryption
CustomerEncryption.Builder
Describes the Customer-Supplied Encryption Key mechanism used to store an Object's data at rest.
Protobuf type google.storage.v2.CustomerEncryption
DeleteBucketRequest
Request message for DeleteBucket.
Protobuf type google.storage.v2.DeleteBucketRequest
DeleteBucketRequest.Builder
Request message for DeleteBucket.
Protobuf type google.storage.v2.DeleteBucketRequest
DeleteHmacKeyRequest
Request object to delete a given HMAC key.
Protobuf type google.storage.v2.DeleteHmacKeyRequest
DeleteHmacKeyRequest.Builder
Request object to delete a given HMAC key.
Protobuf type google.storage.v2.DeleteHmacKeyRequest
DeleteNotificationConfigRequest
Request message for DeleteNotificationConfig.
Protobuf type google.storage.v2.DeleteNotificationConfigRequest
DeleteNotificationConfigRequest.Builder
Request message for DeleteNotificationConfig.
Protobuf type google.storage.v2.DeleteNotificationConfigRequest
DeleteObjectRequest
Message for deleting an object. bucket
and object
mustbe set.
Protobuf type google.storage.v2.DeleteObjectRequest
DeleteObjectRequest.Builder
Message for deleting an object. bucket
and object
mustbe set.
Protobuf type google.storage.v2.DeleteObjectRequest
GetBucketRequest
Request message for GetBucket.
Protobuf type google.storage.v2.GetBucketRequest
GetBucketRequest.Builder
Request message for GetBucket.
Protobuf type google.storage.v2.GetBucketRequest
GetHmacKeyRequest
Request object to get metadata on a given HMAC key.
Protobuf type google.storage.v2.GetHmacKeyRequest
GetHmacKeyRequest.Builder
Request object to get metadata on a given HMAC key.
Protobuf type google.storage.v2.GetHmacKeyRequest
GetNotificationConfigRequest
Request message for GetNotificationConfig.
Protobuf type google.storage.v2.GetNotificationConfigRequest
GetNotificationConfigRequest.Builder
Request message for GetNotificationConfig.
Protobuf type google.storage.v2.GetNotificationConfigRequest
GetObjectRequest
Request message for GetObject.
Protobuf type google.storage.v2.GetObjectRequest
GetObjectRequest.Builder
Request message for GetObject.
Protobuf type google.storage.v2.GetObjectRequest
GetServiceAccountRequest
Request message for GetServiceAccount.
Protobuf type google.storage.v2.GetServiceAccountRequest
GetServiceAccountRequest.Builder
Request message for GetServiceAccount.
Protobuf type google.storage.v2.GetServiceAccountRequest
HmacKeyMetadata
Hmac Key Metadata, which includes all information other than the secret.
Protobuf type google.storage.v2.HmacKeyMetadata
HmacKeyMetadata.Builder
Hmac Key Metadata, which includes all information other than the secret.
Protobuf type google.storage.v2.HmacKeyMetadata
ListBucketsRequest
Request message for ListBuckets.
Protobuf type google.storage.v2.ListBucketsRequest
ListBucketsRequest.Builder
Request message for ListBuckets.
Protobuf type google.storage.v2.ListBucketsRequest
ListBucketsResponse
The result of a call to Buckets.ListBuckets
Protobuf type google.storage.v2.ListBucketsResponse
ListBucketsResponse.Builder
The result of a call to Buckets.ListBuckets
Protobuf type google.storage.v2.ListBucketsResponse
ListHmacKeysRequest
Request to fetch a list of HMAC keys under a given project.
Protobuf type google.storage.v2.ListHmacKeysRequest
ListHmacKeysRequest.Builder
Request to fetch a list of HMAC keys under a given project.
Protobuf type google.storage.v2.ListHmacKeysRequest
ListHmacKeysResponse
Hmac key list response with next page information.
Protobuf type google.storage.v2.ListHmacKeysResponse
ListHmacKeysResponse.Builder
Hmac key list response with next page information.
Protobuf type google.storage.v2.ListHmacKeysResponse
ListNotificationConfigsRequest
Request message for ListNotifications.
Protobuf type google.storage.v2.ListNotificationConfigsRequest
ListNotificationConfigsRequest.Builder
Request message for ListNotifications.
Protobuf type google.storage.v2.ListNotificationConfigsRequest
ListNotificationConfigsResponse
The result of a call to ListNotificationConfigs
Protobuf type google.storage.v2.ListNotificationConfigsResponse
ListNotificationConfigsResponse.Builder
The result of a call to ListNotificationConfigs
Protobuf type google.storage.v2.ListNotificationConfigsResponse
ListObjectsRequest
Request message for ListObjects.
Protobuf type google.storage.v2.ListObjectsRequest
ListObjectsRequest.Builder
Request message for ListObjects.
Protobuf type google.storage.v2.ListObjectsRequest
ListObjectsResponse
The result of a call to Objects.ListObjects
Protobuf type google.storage.v2.ListObjectsResponse
ListObjectsResponse.Builder
The result of a call to Objects.ListObjects
Protobuf type google.storage.v2.ListObjectsResponse
LockBucketRetentionPolicyRequest
Request message for LockBucketRetentionPolicyRequest.
Protobuf type google.storage.v2.LockBucketRetentionPolicyRequest
LockBucketRetentionPolicyRequest.Builder
Request message for LockBucketRetentionPolicyRequest.
Protobuf type google.storage.v2.LockBucketRetentionPolicyRequest
NotificationConfig
A directive to publish Pub/Sub notifications upon changes to a bucket.
Protobuf type google.storage.v2.NotificationConfig
NotificationConfig.Builder
A directive to publish Pub/Sub notifications upon changes to a bucket.
Protobuf type google.storage.v2.NotificationConfig
NotificationConfigName
NotificationConfigName.Builder
Builder for projects/{project}/buckets/{bucket}/notificationConfigs/{notification_config}.
Object
An object.
Protobuf type google.storage.v2.Object
Object.Builder
An object.
Protobuf type google.storage.v2.Object
ObjectAccessControl
An access-control entry.
Protobuf type google.storage.v2.ObjectAccessControl
ObjectAccessControl.Builder
An access-control entry.
Protobuf type google.storage.v2.ObjectAccessControl
ObjectChecksums
Message used for storing full (not subrange) object checksums.
Protobuf type google.storage.v2.ObjectChecksums
ObjectChecksums.Builder
Message used for storing full (not subrange) object checksums.
Protobuf type google.storage.v2.ObjectChecksums
Owner
The owner of a specific resource.
Protobuf type google.storage.v2.Owner
Owner.Builder
The owner of a specific resource.
Protobuf type google.storage.v2.Owner
ProjectName
ProjectName.Builder
Builder for projects/{project}.
ProjectTeam
Represents the Viewers, Editors, or Owners of a given project.
Protobuf type google.storage.v2.ProjectTeam
ProjectTeam.Builder
Represents the Viewers, Editors, or Owners of a given project.
Protobuf type google.storage.v2.ProjectTeam
QueryWriteStatusRequest
Request object for QueryWriteStatus
.
Protobuf type google.storage.v2.QueryWriteStatusRequest
QueryWriteStatusRequest.Builder
Request object for QueryWriteStatus
.
Protobuf type google.storage.v2.QueryWriteStatusRequest
QueryWriteStatusResponse
Response object for QueryWriteStatus
.
Protobuf type google.storage.v2.QueryWriteStatusResponse
QueryWriteStatusResponse.Builder
Response object for QueryWriteStatus
.
Protobuf type google.storage.v2.QueryWriteStatusResponse
ReadObjectRequest
Request message for ReadObject.
Protobuf type google.storage.v2.ReadObjectRequest
ReadObjectRequest.Builder
Request message for ReadObject.
Protobuf type google.storage.v2.ReadObjectRequest
ReadObjectResponse
Response message for ReadObject.
Protobuf type google.storage.v2.ReadObjectResponse
ReadObjectResponse.Builder
Response message for ReadObject.
Protobuf type google.storage.v2.ReadObjectResponse
RestoreObjectRequest
Message for restoring an object. bucket
, object
, and generation
mustbe set.
Protobuf type google.storage.v2.RestoreObjectRequest
RestoreObjectRequest.Builder
Message for restoring an object. bucket
, object
, and generation
mustbe set.
Protobuf type google.storage.v2.RestoreObjectRequest
RewriteObjectRequest
Request message for RewriteObject. If the source object is encrypted using a Customer-Supplied Encryption Key the key information must be provided in the copy_source_encryption_algorithm, copy_source_encryption_key_bytes, and copy_source_encryption_key_sha256_bytes fields. If the destination object should be encrypted the keying information should be provided in the encryption_algorithm, encryption_key_bytes, and encryption_key_sha256_bytes fields of the common_object_request_params.customer_encryption field.
Protobuf type google.storage.v2.RewriteObjectRequest
RewriteObjectRequest.Builder
Request message for RewriteObject. If the source object is encrypted using a Customer-Supplied Encryption Key the key information must be provided in the copy_source_encryption_algorithm, copy_source_encryption_key_bytes, and copy_source_encryption_key_sha256_bytes fields. If the destination object should be encrypted the keying information should be provided in the encryption_algorithm, encryption_key_bytes, and encryption_key_sha256_bytes fields of the common_object_request_params.customer_encryption field.
Protobuf type google.storage.v2.RewriteObjectRequest
RewriteResponse
A rewrite response.
Protobuf type google.storage.v2.RewriteResponse
RewriteResponse.Builder
A rewrite response.
Protobuf type google.storage.v2.RewriteResponse
ServiceAccount
A service account, owned by Cloud Storage, which may be used when taking action on behalf of a given project, for example to publish Pub/Sub notifications or to retrieve security keys.
Protobuf type google.storage.v2.ServiceAccount
ServiceAccount.Builder
A service account, owned by Cloud Storage, which may be used when taking action on behalf of a given project, for example to publish Pub/Sub notifications or to retrieve security keys.
Protobuf type google.storage.v2.ServiceAccount
ServiceConstants
Shared constants.
Protobuf type google.storage.v2.ServiceConstants
ServiceConstants.Builder
Shared constants.
Protobuf type google.storage.v2.ServiceConstants
StartResumableWriteRequest
Request message StartResumableWrite.
Protobuf type google.storage.v2.StartResumableWriteRequest
StartResumableWriteRequest.Builder
Request message StartResumableWrite.
Protobuf type google.storage.v2.StartResumableWriteRequest
StartResumableWriteResponse
Response object for StartResumableWrite
.
Protobuf type google.storage.v2.StartResumableWriteResponse
StartResumableWriteResponse.Builder
Response object for StartResumableWrite
.
Protobuf type google.storage.v2.StartResumableWriteResponse
StorageClient
Service Description: ## API Overview and Naming Syntax
The Cloud Storage gRPC API allows applications to read and write data through the abstractions of buckets and objects. For a description of these abstractions please see https://cloud.google.com/storage/docs .
Resources are named as follows: - Projects are referred to as they are defined by the Resource
Manager API, using strings like projects/123456
or projects/my-string-id
. - Buckets are named
using string names of the form: projects/{project}/buckets/{bucket}
For globally unique
buckets, _
may be substituted for the project. - Objects are uniquely identified by their name
along with the name of the bucket they belong to, as separate strings in this API. For example:
ReadObjectRequest { bucket: 'projects/_/buckets/my-bucket' object: 'my-object' } Note that
object names can contain /
characters, which are treated as any other character (no special
directory semantics).
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try
(
StorageClient
storageClient
=
StorageClient
.
create
())
{
BucketName
name
=
BucketName
.
of
(
"[PROJECT]"
,
"[BUCKET]"
);
storageClient
.
deleteBucket
(
name
);
}
Note: close() needs to be called on the StorageClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
DeleteBucket
Permanently deletes an empty bucket.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
-
deleteBucket(DeleteBucketRequest request)
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
-
deleteBucket(BucketName name)
-
deleteBucket(String name)
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
-
deleteBucketCallable()
GetBucket
Returns metadata for the specified bucket.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
-
getBucket(GetBucketRequest request)
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
-
getBucket(BucketName name)
-
getBucket(String name)
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
-
getBucketCallable()
CreateBucket
Creates a new bucket.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
-
createBucket(CreateBucketRequest request)
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
-
createBucket(ProjectName parent, Bucket bucket, String bucketId)
-
createBucket(String parent, Bucket bucket, String bucketId)
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
-
createBucketCallable()
ListBuckets
Retrieves a list of buckets for a given project.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
-
listBuckets(ListBucketsRequest request)
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
-
listBuckets(ProjectName parent)
-
listBuckets(String parent)
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
-
listBucketsPagedCallable()
-
listBucketsCallable()
LockBucketRetentionPolicy
Locks retention policy on a bucket.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
-
lockBucketRetentionPolicy(LockBucketRetentionPolicyRequest request)
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
-
lockBucketRetentionPolicy(BucketName bucket)
-
lockBucketRetentionPolicy(String bucket)
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
-
lockBucketRetentionPolicyCallable()
GetIamPolicy
Gets the IAM policy for a specified bucket. The resource
field in the request should be projects/ /buckets/{bucket}
.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
-
getIamPolicy(GetIamPolicyRequest request)
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
-
getIamPolicy(ResourceName resource)
-
getIamPolicy(String resource)
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
-
getIamPolicyCallable()
SetIamPolicy
Updates an IAM policy for the specified bucket. The resource
field in the request should be projects//buckets/{bucket}
.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
-
setIamPolicy(SetIamPolicyRequest request)
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
-
setIamPolicy(ResourceName resource, Policy policy)
-
setIamPolicy(String resource, Policy policy)
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
-
setIamPolicyCallable()
TestIamPermissions
Tests a set of permissions on the given bucket or object to see which, if any, are held by the caller. The resource
field in the request should be projects/ /buckets/{bucket}
for a bucket or projects//buckets/{bucket}/objects/{object}
for an object.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
-
testIamPermissions(TestIamPermissionsRequest request)
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
-
testIamPermissions(ResourceName resource, List<String> permissions)
-
testIamPermissions(String resource, List<String> permissions)
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
-
testIamPermissionsCallable()
UpdateBucket
Updates a bucket. Equivalent to JSON API's storage.buckets.patch method.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
-
updateBucket(UpdateBucketRequest request)
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
-
updateBucket(Bucket bucket, FieldMask updateMask)
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
-
updateBucketCallable()
DeleteNotificationConfig
Permanently deletes a NotificationConfig.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
-
deleteNotificationConfig(DeleteNotificationConfigRequest request)
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
-
deleteNotificationConfig(NotificationConfigName name)
-
deleteNotificationConfig(String name)
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
-
deleteNotificationConfigCallable()
GetNotificationConfig
View a NotificationConfig.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
-
getNotificationConfig(GetNotificationConfigRequest request)
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
-
getNotificationConfig(NotificationConfigName name)
-
getNotificationConfig(String name)
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
-
getNotificationConfigCallable()
CreateNotificationConfig
Creates a NotificationConfig for a given bucket. These NotificationConfigs, when triggered, publish messages to the specified Pub/Sub topics. See https://cloud.google.com/storage/docs/pubsub-notifications .
Request object method variants only take one parameter, a request object, which must be constructed before the call.
-
createNotificationConfig(CreateNotificationConfigRequest request)
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
-
createNotificationConfig(BucketName parent, NotificationConfig notificationConfig)
-
createNotificationConfig(String parent, NotificationConfig notificationConfig)
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
-
createNotificationConfigCallable()
ListNotificationConfigs
Retrieves a list of NotificationConfigs for a given bucket.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
-
listNotificationConfigs(ListNotificationConfigsRequest request)
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
-
listNotificationConfigs(BucketName parent)
-
listNotificationConfigs(String parent)
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
-
listNotificationConfigsPagedCallable()
-
listNotificationConfigsCallable()
ComposeObject
Concatenates a list of existing objects into a new object in the same bucket.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
-
composeObject(ComposeObjectRequest request)
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
-
composeObjectCallable()
DeleteObject
Deletes an object and its metadata.
Deletions are normally permanent when versioning is disabled or whenever the generation parameter is used. However, if soft delete is enabled for the bucket, deleted objects can be restored using RestoreObject until the soft delete retention period has passed.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
-
deleteObject(DeleteObjectRequest request)
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
-
deleteObject(BucketName bucket, String object)
-
deleteObject(String bucket, String object)
-
deleteObject(BucketName bucket, String object, long generation)
-
deleteObject(String bucket, String object, long generation)
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
-
deleteObjectCallable()
RestoreObject
Restores a soft-deleted object.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
-
restoreObject(RestoreObjectRequest request)
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
-
restoreObject(BucketName bucket, String object, long generation)
-
restoreObject(String bucket, String object, long generation)
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
-
restoreObjectCallable()
CancelResumableWrite
Cancels an in-progress resumable upload.
Any attempts to write to the resumable upload after cancelling the upload will fail.
The behavior for currently in progress write operations is not guaranteed - they could either complete before the cancellation or fail if the cancellation completes first.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
-
cancelResumableWrite(CancelResumableWriteRequest request)
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
-
cancelResumableWrite(String uploadId)
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
-
cancelResumableWriteCallable()
GetObject
Retrieves an object's metadata.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
-
getObject(GetObjectRequest request)
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
-
getObject(BucketName bucket, String object)
-
getObject(String bucket, String object)
-
getObject(BucketName bucket, String object, long generation)
-
getObject(String bucket, String object, long generation)
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
-
getObjectCallable()
ReadObject
Reads an object's data.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
-
readObjectCallable()
UpdateObject
Updates an object's metadata. Equivalent to JSON API's storage.objects.patch.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
-
updateObject(UpdateObjectRequest request)
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
-
updateObject(Object object, FieldMask updateMask)
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
-
updateObjectCallable()
WriteObject
Stores a new object and metadata.
An object can be written either in a single message stream or in a resumable sequence of message streams. To write using a single stream, the client should include in the first message of the stream an WriteObjectSpec
describing the destination bucket, object, and any preconditions. Additionally, the final message must set 'finish_write' to true, or else it is an error.
For a resumable write, the client should instead call StartResumableWrite()
, populating a WriteObjectSpec
into that request. They should then attach the returned upload_id
to the first message of each following call to WriteObject
. If the stream is closed before finishing the upload (either explicitly by the client or due to a network error or an error response from the server), the client should do as follows: - Check the result Status of the stream, to determine if writing can be resumed on this stream or must be restarted from scratch (by calling StartResumableWrite()
). The resumable errors are DEADLINE_EXCEEDED, INTERNAL, and UNAVAILABLE. For each case, the client should use binary exponential backoff before retrying. Additionally, writes can be resumed after RESOURCE_EXHAUSTED errors, but only after taking appropriate measures, which may include reducing aggregate send rate across clients and/or requesting a quota increase for your project. - If the call to WriteObject
returns ABORTED
, that indicates concurrent attempts to update the resumable write, caused either by multiple racing clients or by a single client where the previous request was timed out on the client side but nonetheless reached the server. In this case the client should take steps to prevent further concurrent writes (e.g., increase the timeouts, stop using more than one process to perform the upload, etc.), and then should follow the steps below for resuming the upload. - For resumable errors, the client should call QueryWriteStatus()
and then continue writing from the returned persisted_size
. This may be less than the amount of data the client previously sent. Note also that it is acceptable to send data starting at an offset earlier than the returned persisted_size
; in this case, the service will skip data at offsets that were already persisted (without checking that it matches the previously written data), and write only the data starting from the persisted offset. Even though the data isn't written, it may still incur a performance cost over resuming at the correct write offset. This behavior can make client-side handling simpler in some cases. - Clients must only send data that is a multiple of 256 KiB per message, unless the object is being finished with finish_write
set to true
.
The service will not view the object as complete until the client has sent a WriteObjectRequest
with finish_write
set to true
. Sending any requests on a stream after sending a request with finish_write
set to true
will cause an error. The client **should** check the response it receives to determine how much data the service was able to commit and whether the service views the object as complete.
Attempting to resume an already finalized object will result in an OK status, with a WriteObjectResponse containing the finalized object's metadata.
Alternatively, the BidiWriteObject operation may be used to write an object with controls over flushing and the ability to fetch the ability to determine the current persisted size.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
-
writeObjectCallable()
BidiWriteObject
Stores a new object and metadata.
This is similar to the WriteObject call with the added support for manual flushing of persisted state, and the ability to determine current persisted size without closing the stream.
The client may specify one or both of the state_lookup
and flush
fields in each BidiWriteObjectRequest. If flush
is specified, the data written so far will be persisted to storage. If state_lookup
is specified, the service will respond with a BidiWriteObjectResponse that contains the persisted size. If both flush
and state_lookup
are specified, the flush will always occur before a state_lookup
, so that both may be set in the same request and the returned state will be the state of the object post-flush. When the stream is closed, a BidiWriteObjectResponse will always be sent to the client, regardless of the value of state_lookup
.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
-
bidiWriteObjectCallable()
ListObjects
Retrieves a list of objects matching the criteria.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
-
listObjects(ListObjectsRequest request)
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
-
listObjects(BucketName parent)
-
listObjects(String parent)
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
-
listObjectsPagedCallable()
-
listObjectsCallable()
RewriteObject
Rewrites a source object to a destination object. Optionally overrides metadata.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
-
rewriteObject(RewriteObjectRequest request)
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
-
rewriteObjectCallable()
StartResumableWrite
Starts a resumable write. How long the write operation remains valid, and what happens when the write operation becomes invalid, are service-dependent.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
-
startResumableWrite(StartResumableWriteRequest request)
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
-
startResumableWriteCallable()
QueryWriteStatus
Determines the persisted_size
for an object that is being written, which can then be used as the write_offset
for the next Write()
call.
If the object does not exist (i.e., the object has been deleted, or the first Write()
has not yet reached the service), this method returns the error NOT_FOUND
.
The client **may** call QueryWriteStatus()
at any time to determine how much data has been processed for this object. This is useful if the client is buffering data and needs to know which data can be safely evicted. For any sequence of QueryWriteStatus()
calls for a given object name, the sequence of returned persisted_size
values will be non-decreasing.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
-
queryWriteStatus(QueryWriteStatusRequest request)
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
-
queryWriteStatus(String uploadId)
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
-
queryWriteStatusCallable()
GetServiceAccount
Retrieves the name of a project's Google Cloud Storage service account.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
-
getServiceAccount(GetServiceAccountRequest request)
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
-
getServiceAccount(ProjectName project)
-
getServiceAccount(String project)
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
-
getServiceAccountCallable()
CreateHmacKey
Creates a new HMAC key for the given service account.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
-
createHmacKey(CreateHmacKeyRequest request)
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
-
createHmacKey(ProjectName project, String serviceAccountEmail)
-
createHmacKey(String project, String serviceAccountEmail)
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
-
createHmacKeyCallable()
DeleteHmacKey
Deletes a given HMAC key. Key must be in an INACTIVE state.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
-
deleteHmacKey(DeleteHmacKeyRequest request)
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
-
deleteHmacKey(String accessId, ProjectName project)
-
deleteHmacKey(String accessId, String project)
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
-
deleteHmacKeyCallable()
GetHmacKey
Gets an existing HMAC key metadata for the given id.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
-
getHmacKey(GetHmacKeyRequest request)
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
-
getHmacKey(String accessId, ProjectName project)
-
getHmacKey(String accessId, String project)
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
-
getHmacKeyCallable()
ListHmacKeys
Lists HMAC keys under a given project with the additional filters provided.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
-
listHmacKeys(ListHmacKeysRequest request)
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
-
listHmacKeys(ProjectName project)
-
listHmacKeys(String project)
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
-
listHmacKeysPagedCallable()
-
listHmacKeysCallable()
UpdateHmacKey
Updates a given HMAC key state between ACTIVE and INACTIVE.
Request object method variants only take one parameter, a request object, which must be constructed before the call.
-
updateHmacKey(UpdateHmacKeyRequest request)
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
-
updateHmacKey(HmacKeyMetadata hmacKey, FieldMask updateMask)
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
-
updateHmacKeyCallable()
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of StorageSettings to create(). For example:
To customize credentials:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
StorageSettings
storageSettings
=
StorageSettings
.
newBuilder
()
.
setCredentialsProvider
(
FixedCredentialsProvider
.
create
(
myCredentials
))
.
build
();
StorageClient
storageClient
=
StorageClient
.
create
(
storageSettings
);
To customize the endpoint:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
StorageSettings
storageSettings
=
StorageSettings
.
newBuilder
().
setEndpoint
(
myEndpoint
).
build
();
StorageClient
storageClient
=
StorageClient
.
create
(
storageSettings
);
Please refer to the GitHub repository's samples for more quickstart code snippets.
StorageClient.ListBucketsFixedSizeCollection
StorageClient.ListBucketsPage
StorageClient.ListBucketsPagedResponse
StorageClient.ListHmacKeysFixedSizeCollection
StorageClient.ListHmacKeysPage
StorageClient.ListHmacKeysPagedResponse
StorageClient.ListNotificationConfigsFixedSizeCollection
StorageClient.ListNotificationConfigsPage
StorageClient.ListNotificationConfigsPagedResponse
StorageClient.ListObjectsFixedSizeCollection
StorageClient.ListObjectsPage
StorageClient.ListObjectsPagedResponse
StorageGrpc
API Overview and Naming Syntax
The Cloud Storage gRPC API allows applications to read and write data through the abstractions of buckets and objects. For a description of these abstractions please see https://cloud.google.com/storage/docs . Resources are named as follows:
- Projects are referred to as they are defined by the Resource Manager API,
using strings like
projects/123456
orprojects/my-string-id
. - Buckets are named using string names of the form:
projects/{project}/buckets/{bucket}
For globally unique buckets,_
may be substituted for the project. - Objects are uniquely identified by their name along with the name of the
bucket they belong to, as separate strings in this API. For example:
ReadObjectRequest {
bucket: 'projects/_/buckets/my-bucket'
object: 'my-object'
}
Note that object names can contain
/
characters, which are treated as any other character (no special directory semantics).
StorageGrpc.StorageBlockingStub
A stub to allow clients to do synchronous rpc calls to service Storage.
API Overview and Naming Syntax
The Cloud Storage gRPC API allows applications to read and write data through the abstractions of buckets and objects. For a description of these abstractions please see https://cloud.google.com/storage/docs . Resources are named as follows:
- Projects are referred to as they are defined by the Resource Manager API,
using strings like
projects/123456
orprojects/my-string-id
. - Buckets are named using string names of the form:
projects/{project}/buckets/{bucket}
For globally unique buckets,_
may be substituted for the project. - Objects are uniquely identified by their name along with the name of the
bucket they belong to, as separate strings in this API. For example:
ReadObjectRequest {
bucket: 'projects/_/buckets/my-bucket'
object: 'my-object'
}
Note that object names can contain
/
characters, which are treated as any other character (no special directory semantics).
StorageGrpc.StorageFutureStub
A stub to allow clients to do ListenableFuture-style rpc calls to service Storage.
API Overview and Naming Syntax
The Cloud Storage gRPC API allows applications to read and write data through the abstractions of buckets and objects. For a description of these abstractions please see https://cloud.google.com/storage/docs . Resources are named as follows:
- Projects are referred to as they are defined by the Resource Manager API,
using strings like
projects/123456
orprojects/my-string-id
. - Buckets are named using string names of the form:
projects/{project}/buckets/{bucket}
For globally unique buckets,_
may be substituted for the project. - Objects are uniquely identified by their name along with the name of the
bucket they belong to, as separate strings in this API. For example:
ReadObjectRequest {
bucket: 'projects/_/buckets/my-bucket'
object: 'my-object'
}
Note that object names can contain
/
characters, which are treated as any other character (no special directory semantics).
StorageGrpc.StorageImplBase
Base class for the server implementation of the service Storage.
API Overview and Naming Syntax
The Cloud Storage gRPC API allows applications to read and write data through the abstractions of buckets and objects. For a description of these abstractions please see https://cloud.google.com/storage/docs . Resources are named as follows:
- Projects are referred to as they are defined by the Resource Manager API,
using strings like
projects/123456
orprojects/my-string-id
. - Buckets are named using string names of the form:
projects/{project}/buckets/{bucket}
For globally unique buckets,_
may be substituted for the project. - Objects are uniquely identified by their name along with the name of the
bucket they belong to, as separate strings in this API. For example:
ReadObjectRequest {
bucket: 'projects/_/buckets/my-bucket'
object: 'my-object'
}
Note that object names can contain
/
characters, which are treated as any other character (no special directory semantics).
StorageGrpc.StorageStub
A stub to allow clients to do asynchronous rpc calls to service Storage.
API Overview and Naming Syntax
The Cloud Storage gRPC API allows applications to read and write data through the abstractions of buckets and objects. For a description of these abstractions please see https://cloud.google.com/storage/docs . Resources are named as follows:
- Projects are referred to as they are defined by the Resource Manager API,
using strings like
projects/123456
orprojects/my-string-id
. - Buckets are named using string names of the form:
projects/{project}/buckets/{bucket}
For globally unique buckets,_
may be substituted for the project. - Objects are uniquely identified by their name along with the name of the
bucket they belong to, as separate strings in this API. For example:
ReadObjectRequest {
bucket: 'projects/_/buckets/my-bucket'
object: 'my-object'
}
Note that object names can contain
/
characters, which are treated as any other character (no special directory semantics).
StorageProto
StorageSettings
Settings class to configure an instance of StorageClient .
The default instance has everything set to sensible defaults:
- The default service address (storage.googleapis.com) and default port (443) are used.
- Credentials are acquired automatically through Application Default Credentials.
- Retries are configured for idempotent methods but not for non-idempotent methods.
The builder of this class is recursive, so contained classes are themselves builders. When build() is called, the tree of builders is called to create the complete settings object.
For example, to set the total timeout of deleteBucket to 30 seconds:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
StorageSettings
.
Builder
storageSettingsBuilder
=
StorageSettings
.
newBuilder
();
storageSettingsBuilder
.
deleteBucketSettings
()
.
setRetrySettings
(
storageSettingsBuilder
.
deleteBucketSettings
()
.
getRetrySettings
()
.
toBuilder
()
.
setTotalTimeout
(
Duration
.
ofSeconds
(
30
))
.
build
());
StorageSettings
storageSettings
=
storageSettingsBuilder
.
build
();
StorageSettings.Builder
Builder for StorageSettings.
UpdateBucketRequest
Request for UpdateBucket method.
Protobuf type google.storage.v2.UpdateBucketRequest
UpdateBucketRequest.Builder
Request for UpdateBucket method.
Protobuf type google.storage.v2.UpdateBucketRequest
UpdateHmacKeyRequest
Request object to update an HMAC key state. HmacKeyMetadata.state is required and the only writable field in UpdateHmacKey operation. Specifying fields other than state will result in an error.
Protobuf type google.storage.v2.UpdateHmacKeyRequest
UpdateHmacKeyRequest.Builder
Request object to update an HMAC key state. HmacKeyMetadata.state is required and the only writable field in UpdateHmacKey operation. Specifying fields other than state will result in an error.
Protobuf type google.storage.v2.UpdateHmacKeyRequest
UpdateObjectRequest
Request message for UpdateObject.
Protobuf type google.storage.v2.UpdateObjectRequest
UpdateObjectRequest.Builder
Request message for UpdateObject.
Protobuf type google.storage.v2.UpdateObjectRequest
WriteObjectRequest
Request message for WriteObject.
Protobuf type google.storage.v2.WriteObjectRequest
WriteObjectRequest.Builder
Request message for WriteObject.
Protobuf type google.storage.v2.WriteObjectRequest
WriteObjectResponse
Response message for WriteObject.
Protobuf type google.storage.v2.WriteObjectResponse
WriteObjectResponse.Builder
Response message for WriteObject.
Protobuf type google.storage.v2.WriteObjectResponse
WriteObjectSpec
Describes an attempt to insert an object, possibly over multiple requests.
Protobuf type google.storage.v2.WriteObjectSpec
WriteObjectSpec.Builder
Describes an attempt to insert an object, possibly over multiple requests.
Protobuf type google.storage.v2.WriteObjectSpec
Interfaces
BidiWriteObjectRequestOrBuilder
BidiWriteObjectResponseOrBuilder
Bucket.AutoclassOrBuilder
Bucket.BillingOrBuilder
Bucket.CorsOrBuilder
Bucket.CustomPlacementConfigOrBuilder
Bucket.EncryptionOrBuilder
Bucket.IamConfig.UniformBucketLevelAccessOrBuilder
Bucket.IamConfigOrBuilder
Bucket.Lifecycle.Rule.ActionOrBuilder
Bucket.Lifecycle.Rule.ConditionOrBuilder
Bucket.Lifecycle.RuleOrBuilder
Bucket.LifecycleOrBuilder
Bucket.LoggingOrBuilder
Bucket.RetentionPolicyOrBuilder
Bucket.SoftDeletePolicyOrBuilder
Bucket.VersioningOrBuilder
Bucket.WebsiteOrBuilder
BucketAccessControlOrBuilder
BucketOrBuilder
CancelResumableWriteRequestOrBuilder
CancelResumableWriteResponseOrBuilder
ChecksummedDataOrBuilder
CommonObjectRequestParamsOrBuilder
ComposeObjectRequest.SourceObject.ObjectPreconditionsOrBuilder
ComposeObjectRequest.SourceObjectOrBuilder
ComposeObjectRequestOrBuilder
ContentRangeOrBuilder
CreateBucketRequestOrBuilder
CreateHmacKeyRequestOrBuilder
CreateHmacKeyResponseOrBuilder
CreateNotificationConfigRequestOrBuilder
CustomerEncryptionOrBuilder
DeleteBucketRequestOrBuilder
DeleteHmacKeyRequestOrBuilder
DeleteNotificationConfigRequestOrBuilder
DeleteObjectRequestOrBuilder
GetBucketRequestOrBuilder
GetHmacKeyRequestOrBuilder
GetNotificationConfigRequestOrBuilder
GetObjectRequestOrBuilder
GetServiceAccountRequestOrBuilder
HmacKeyMetadataOrBuilder
ListBucketsRequestOrBuilder
ListBucketsResponseOrBuilder
ListHmacKeysRequestOrBuilder
ListHmacKeysResponseOrBuilder
ListNotificationConfigsRequestOrBuilder
ListNotificationConfigsResponseOrBuilder
ListObjectsRequestOrBuilder
ListObjectsResponseOrBuilder
LockBucketRetentionPolicyRequestOrBuilder
NotificationConfigOrBuilder
ObjectAccessControlOrBuilder
ObjectChecksumsOrBuilder
ObjectOrBuilder
OwnerOrBuilder
ProjectTeamOrBuilder
QueryWriteStatusRequestOrBuilder
QueryWriteStatusResponseOrBuilder
ReadObjectRequestOrBuilder
ReadObjectResponseOrBuilder
RestoreObjectRequestOrBuilder
RewriteObjectRequestOrBuilder
RewriteResponseOrBuilder
ServiceAccountOrBuilder
ServiceConstantsOrBuilder
StartResumableWriteRequestOrBuilder
StartResumableWriteResponseOrBuilder
StorageGrpc.AsyncService
API Overview and Naming Syntax
The Cloud Storage gRPC API allows applications to read and write data through the abstractions of buckets and objects. For a description of these abstractions please see https://cloud.google.com/storage/docs . Resources are named as follows:
- Projects are referred to as they are defined by the Resource Manager API,
using strings like
projects/123456
orprojects/my-string-id
. - Buckets are named using string names of the form:
projects/{project}/buckets/{bucket}
For globally unique buckets,_
may be substituted for the project. - Objects are uniquely identified by their name along with the name of the
bucket they belong to, as separate strings in this API. For example:
ReadObjectRequest {
bucket: 'projects/_/buckets/my-bucket'
object: 'my-object'
}
Note that object names can contain
/
characters, which are treated as any other character (no special directory semantics).
UpdateBucketRequestOrBuilder
UpdateHmacKeyRequestOrBuilder
UpdateObjectRequestOrBuilder
WriteObjectRequestOrBuilder
WriteObjectResponseOrBuilder
WriteObjectSpecOrBuilder
Enums
BidiWriteObjectRequest.DataCase
BidiWriteObjectRequest.FirstMessageCase
BidiWriteObjectResponse.WriteStatusCase
QueryWriteStatusResponse.WriteStatusCase
ServiceConstants.Values
A collection of constant values meaningful to the Storage API.
Protobuf enum google.storage.v2.ServiceConstants.Values