Object Storage API, gRPC: BucketService.Update
- gRPC request
- UpdateBucketRequest
- AnonymousAccessFlags
- CorsRule
- WebsiteSettings
- Scheme
- RoutingRule
- Condition
- Redirect
- LifecycleRule
- RuleFilter
- Tag
- And
- Expiration
- Transition
- AfterDays
- NoncurrentExpiration
- NoncurrentTransition
- NoncurrentDeleteMarkers
- ACL
- Grant
- ObjectLock
- DefaultRetention
- Encryption
- EncryptionRule
- operation.Operation
- UpdateBucketMetadata
- Bucket
- AnonymousAccessFlags
- ACL
- Grant
- CorsRule
- WebsiteSettings
- Scheme
- RoutingRule
- Condition
- Redirect
- LifecycleRule
- RuleFilter
- Tag
- And
- Expiration
- Transition
- AfterDays
- NoncurrentExpiration
- NoncurrentTransition
- NoncurrentDeleteMarkers
- ObjectLock
- DefaultRetention
- Encryption
- EncryptionRule
Updates the specified bucket.
In most cases, storage.editor
role (see documentation) should be enough
to update a bucket, subject to its policy.
gRPC request
rpc Update (UpdateBucketRequest) returns (operation.Operation)
UpdateBucketRequest
{
"name": "string",
"update_mask": "google.protobuf.FieldMask",
"anonymous_access_flags": {
"read": "google.protobuf.BoolValue",
"list": "google.protobuf.BoolValue",
"config_read": "google.protobuf.BoolValue"
},
"default_storage_class": "string",
"max_size": "int64",
"cors": [
{
"id": "string",
"allowed_methods": [
"Method"
],
"allowed_headers": [
"string"
],
"allowed_origins": [
"string"
],
"expose_headers": [
"string"
],
"max_age_seconds": "google.protobuf.Int64Value"
}
],
"website_settings": {
"index": "string",
"error": "string",
"redirect_all_requests": {
"protocol": "Protocol",
"hostname": "string"
},
"routing_rules": [
{
"condition": {
"http_error_code_returned_equals": "string",
"key_prefix_equals": "string"
},
"redirect": {
"hostname": "string",
"http_redirect_code": "string",
"protocol": "Protocol",
"replace_key_prefix_with": "string",
"replace_key_with": "string"
}
}
]
},
"versioning": "Versioning",
"lifecycle_rules": [
{
"id": "google.protobuf.StringValue",
"enabled": "bool",
"filter": {
"prefix": "string",
"object_size_greater_than": "google.protobuf.Int64Value",
"object_size_less_than": "google.protobuf.Int64Value",
"tag": {
"key": "string",
"value": "string"
},
"and_operator": {
"prefix": "string",
"object_size_greater_than": "google.protobuf.Int64Value",
"object_size_less_than": "google.protobuf.Int64Value",
"tag": [
{
"key": "string",
"value": "string"
}
]
}
},
"expiration": {
"date": "google.protobuf.Timestamp",
"days": "google.protobuf.Int64Value",
"expired_object_delete_marker": "google.protobuf.BoolValue"
},
"transitions": [
{
"date": "google.protobuf.Timestamp",
"days": "google.protobuf.Int64Value",
"storage_class": "string"
}
],
"abort_incomplete_multipart_upload": {
"days_after_expiration": "google.protobuf.Int64Value"
},
"noncurrent_expiration": {
"noncurrent_days": "google.protobuf.Int64Value"
},
"noncurrent_transitions": [
{
"noncurrent_days": "google.protobuf.Int64Value",
"storage_class": "string"
}
],
"noncurrent_delete_markers": {
"noncurrent_days": "google.protobuf.Int64Value"
}
}
],
"policy": "google.protobuf.Struct",
"acl": {
"grants": [
{
"permission": "Permission",
"grant_type": "GrantType",
"grantee_id": "string"
}
]
},
"tags": [
{
"key": "string",
"value": "string"
}
],
"object_lock": {
"status": "ObjectLockStatus",
"default_retention": {
"mode": "Mode",
// Includes only one of the fields `days`, `years`
"days": "int64",
"years": "int64"
// end of the list of possible fields
}
},
"encryption": {
"rules": [
{
"kms_master_key_id": "string",
"sse_algorithm": "string"
}
]
}
}
Field |
Description |
name |
string Required field. Name of the bucket to update. The name cannot be updated. To get the bucket name, make a BucketService.List request. |
update_mask |
Required field. Update mask that specifies which attributes of the bucket should be updated. |
anonymous_access_flags |
Flags for configuring public (anonymous) access to the bucket's content and settings. |
default_storage_class |
string Default storage class for objects in the bucket. Supported classes are standard storage ( |
max_size |
int64 Maximum size of the bucket, in bytes. |
cors[] |
List of rules for cross-domain requests to objects in the bucket (cross-origin resource sharing, CORS). |
website_settings |
Configuration for hosting a static website in the bucket. |
versioning |
enum Versioning Bucket versioning status.
|
lifecycle_rules[] |
List of object lifecycle rules for the bucket. |
policy |
Bucket policies that set permissions for actions with the bucket, its objects, and groups of objects. |
acl |
Access control list (ACL) of the bucket. |
tags[] |
List of tags for the bucket. |
object_lock |
Configuration for object lock on the bucket. |
encryption |
Configuration for bucket's encryption |
AnonymousAccessFlags
Field |
Description |
read |
Specifies whether public (anonymous) access to read objects in the bucket is enabled. |
list |
Specifies whether public (anonymous) access to the list of objects in the bucket is enabled. |
config_read |
Specifies whether public (anonymous) access to read CORS, |
CorsRule
A CORS rule resource.
For details about the concept, see documentation.
Field |
Description |
id |
string ID of the CORS rule. |
allowed_methods[] |
enum Method List of HTTP methods allowed by the CORS rule. When a client sends a CORS-preflight
|
allowed_headers[] |
string List of HTTP headers allowed by the CORS rule. When a client sends a CORS-preflight Each string in the list can contain at most one |
allowed_origins[] |
string List of request origins allowed by the CORS rule. Each string in the list can contain at most one |
expose_headers[] |
string List of headers contained in responses to CORS requests that can be accessed by applications. |
max_age_seconds |
Time in seconds that a client can cache the response to a CORS-preflight request as identified by the |
WebsiteSettings
Field |
Description |
index |
string Key of the index page object that is returned when a response is made to the root of the website. Either If specified, the index page object must be located in the root of the bucket. |
error |
string Key of the error page object that is returned when an error occurs. |
redirect_all_requests |
Configuration for redirecting all requests sent to the website. Either |
routing_rules[] |
List of redirect rules. |
Scheme
A configuration resource for redirecting all requests sent to the website.
Field |
Description |
protocol |
enum Protocol Scheme of the redirect URI.
|
hostname |
string Hostname of the redirect URI. |
RoutingRule
List of redirect rules.
Field |
Description |
condition |
Redirect condition. |
redirect |
Redirect instructions. |
Condition
Field |
Description |
http_error_code_returned_equals |
string HTTP status code (number only) that must match for the redirect to apply. |
key_prefix_equals |
string Prefix of the object key from which requests are redirected. |
Redirect
Field |
Description |
hostname |
string Hostname of the redirect URI. |
http_redirect_code |
string HTTP status code of the redirect response. Default value: |
protocol |
enum Protocol Scheme of the redirect URI.
|
replace_key_prefix_with |
string Substitution for the prefix of the object key specified in Condition.key_prefix_equals. At most one of |
replace_key_with |
string New object key. At most one of |
LifecycleRule
An object lifecycle rule resource for the bucket.
For details about the concept, see documentation.
Field |
Description |
id |
ID of the rule. Provided by the client or generated at creation time. |
enabled |
bool Indicates whether the rule is in effect. |
filter |
Filter that identifies the objects to which the rule applies. If not specified, the rule applies to all objects in the bucket. |
expiration |
Expiration rule. The expiration of an object is described as follows. For the unversioned bucket (Bucket.versioning is For the bucket with versioning enabled (Bucket.versioning is For the bucket with versioning suspended (Bucket.versioning is |
transitions[] |
List of transition rules. The transition of an object is described as follows. For the unversioned bucket (Bucket.versioning is For the bucket with versioning enabled (Bucket.versioning is |
abort_incomplete_multipart_upload |
Configuration for aborting incomplete multipart uploads. |
noncurrent_expiration |
Expiration rule for non-current versions of objects in a bucket with versioning enabled (Bucket.versioning is At expiration, the non-current version of the object is deleted and cannot be recovered. |
noncurrent_transitions[] |
List of transition rules for non-current versions of objects in a bucket with versioning enabled At transition, the non-current version of the object is transitioned to the specified storage class. |
noncurrent_delete_markers |
Expiration rule for non-current delete markers of an objects in a bucket with versioning At expiration, the non-current delete marker of the object is deleted and cannot be recovered. |
RuleFilter
Field |
Description |
prefix |
string Key prefix that the object must have in order for the rule to apply. |
object_size_greater_than |
Size that the object must be greater. |
object_size_less_than |
Size that the object must be less t. |
tag |
Tags that the object's tag set must have for the rule to apply. |
and_operator |
Apply a logical AND to all of the predicates configured inside the And operator. |
Tag
Field |
Description |
key |
string Key of the bucket tag. |
value |
string Value of the bucket tag. |
And
Field |
Description |
prefix |
string |
object_size_greater_than |
|
object_size_less_than |
|
tag[] |
Expiration
Field |
Description |
date |
Specific date of object expiration. The rule continues to apply even after the date has passed, i.e. any new objects created in the bucket expire Exactly one of |
days |
Time period, in number of days from the creation or modification of the object, after which an object expires. Exactly one of |
expired_object_delete_marker |
Indicates whether a delete marker of an object with no non-current versions (referred to as an expired object Exactly one of |
Transition
List of transition rules.
The transition of an object is described as follows.
For the unversioned bucket (Bucket.versioning is VERSIONING_DISABLED
), the object is transitioned to the
specified storage class.
For the bucket with versioning enabled (Bucket.versioning is VERSIONING_ENABLED
) or suspended
(VERSIONING_SUSPENDED
), the current version of the object is transitioned to the specified storage class.
Field |
Description |
date |
Specific date of object transition. The rule continues to apply even after the date has passed, i.e. any new objects created in the bucket are At most one of |
days |
Time period, in number of days from the creation or modification of the object, after which an object is At most one of |
storage_class |
string Required field. Storage class to which an object is transitioned from standard storage. The only supported class is cold storage ( |
AfterDays
Field |
Description |
days_after_expiration |
Time period, in number of days from the start of the multipart upload, after which the incomplete upload is |
NoncurrentExpiration
Field |
Description |
noncurrent_days |
Time period, in number of days since the version of an object was classified as non-current, after which the |
NoncurrentTransition
List of transition rules for non-current versions of objects in a bucket with versioning enabled
(Bucket.versioning is VERSIONING_ENABLED
) or suspended (VERSIONING_SUSPENDED
).
At transition, the non-current version of the object is transitioned to the specified storage class.
Field |
Description |
noncurrent_days |
Time period, in number of days since the version of an object was classified as non-current, after which the |
storage_class |
string Required field. Storage class to which a non-current version of an object is transitioned from standard storage. The only supported class is cold storage ( |
NoncurrentDeleteMarkers
Field |
Description |
noncurrent_days |
Time period, in number of days since the version of a delete marker was classified as non-current, after which |
ACL
Field |
Description |
grants[] |
List of permissions granted and the grantees. |
Grant
A grant resource, used to specify the permission granted and the grantee.
Field |
Description |
permission |
enum Permission Required field. Permission granted by the grant.
|
grant_type |
enum GrantType Required field. The grantee type for the grant.
|
grantee_id |
string ID of the account who is a grantee. Required when the |
ObjectLock
A resource for Object Lock configuration of a bucket.
For details about the concept, see documentation.
Field |
Description |
status |
enum ObjectLockStatus
|
default_retention |
DefaultRetention
Default lock configuration for added objects
Field |
Description |
mode |
enum Mode
|
days |
int64 Number of days for locking Includes only one of the fields |
years |
int64 Number of years for locking Includes only one of the fields |
Encryption
Field |
Description |
rules[] |
EncryptionRule
Field |
Description |
kms_master_key_id |
string |
sse_algorithm |
string |
operation.Operation
{
"id": "string",
"description": "string",
"created_at": "google.protobuf.Timestamp",
"created_by": "string",
"modified_at": "google.protobuf.Timestamp",
"done": "bool",
"metadata": {
"name": "string"
},
// Includes only one of the fields `error`, `response`
"error": "google.rpc.Status",
"response": {
"id": "string",
"name": "string",
"folder_id": "string",
"anonymous_access_flags": {
"read": "google.protobuf.BoolValue",
"list": "google.protobuf.BoolValue",
"config_read": "google.protobuf.BoolValue"
},
"default_storage_class": "string",
"versioning": "Versioning",
"max_size": "int64",
"policy": "google.protobuf.Struct",
"acl": {
"grants": [
{
"permission": "Permission",
"grant_type": "GrantType",
"grantee_id": "string"
}
]
},
"created_at": "google.protobuf.Timestamp",
"cors": [
{
"id": "string",
"allowed_methods": [
"Method"
],
"allowed_headers": [
"string"
],
"allowed_origins": [
"string"
],
"expose_headers": [
"string"
],
"max_age_seconds": "google.protobuf.Int64Value"
}
],
"website_settings": {
"index": "string",
"error": "string",
"redirect_all_requests": {
"protocol": "Protocol",
"hostname": "string"
},
"routing_rules": [
{
"condition": {
"http_error_code_returned_equals": "string",
"key_prefix_equals": "string"
},
"redirect": {
"hostname": "string",
"http_redirect_code": "string",
"protocol": "Protocol",
"replace_key_prefix_with": "string",
"replace_key_with": "string"
}
}
]
},
"lifecycle_rules": [
{
"id": "google.protobuf.StringValue",
"enabled": "bool",
"filter": {
"prefix": "string",
"object_size_greater_than": "google.protobuf.Int64Value",
"object_size_less_than": "google.protobuf.Int64Value",
"tag": {
"key": "string",
"value": "string"
},
"and_operator": {
"prefix": "string",
"object_size_greater_than": "google.protobuf.Int64Value",
"object_size_less_than": "google.protobuf.Int64Value",
"tag": [
{
"key": "string",
"value": "string"
}
]
}
},
"expiration": {
"date": "google.protobuf.Timestamp",
"days": "google.protobuf.Int64Value",
"expired_object_delete_marker": "google.protobuf.BoolValue"
},
"transitions": [
{
"date": "google.protobuf.Timestamp",
"days": "google.protobuf.Int64Value",
"storage_class": "string"
}
],
"abort_incomplete_multipart_upload": {
"days_after_expiration": "google.protobuf.Int64Value"
},
"noncurrent_expiration": {
"noncurrent_days": "google.protobuf.Int64Value"
},
"noncurrent_transitions": [
{
"noncurrent_days": "google.protobuf.Int64Value",
"storage_class": "string"
}
],
"noncurrent_delete_markers": {
"noncurrent_days": "google.protobuf.Int64Value"
}
}
],
"tags": [
{
"key": "string",
"value": "string"
}
],
"object_lock": {
"status": "ObjectLockStatus",
"default_retention": {
"mode": "Mode",
// Includes only one of the fields `days`, `years`
"days": "int64",
"years": "int64"
// end of the list of possible fields
}
},
"encryption": {
"rules": [
{
"kms_master_key_id": "string",
"sse_algorithm": "string"
}
]
}
}
// end of the list of possible fields
}
An Operation resource. For more information, see Operation.
Field |
Description |
id |
string ID of the operation. |
description |
string Description of the operation. 0-256 characters long. |
created_at |
Creation timestamp. |
created_by |
string ID of the user or service account who initiated the operation. |
modified_at |
The time when the Operation resource was last modified. |
done |
bool If the value is |
metadata |
Service-specific metadata associated with the operation. |
error |
The error result of the operation in case of failure or cancellation. Includes only one of the fields The operation result. |
response |
The normal response of the operation in case of success. Includes only one of the fields The operation result. |
UpdateBucketMetadata
Field |
Description |
name |
string Name of the bucket that is being updated. |
Bucket
A bucket resource.
For details about the concept, see documentation.
Field |
Description |
id |
string ID of the bucket. Always equal to |
name |
string Name of the bucket. The name is unique within the platform. For naming limitations and rules, see |
folder_id |
string ID of the folder that the bucket belongs to. |
anonymous_access_flags |
Flags for configuring public (anonymous) access to the bucket's content and settings. |
default_storage_class |
string Default storage class for objects in the bucket. Supported classes are standard storage ( |
versioning |
enum Versioning Bucket versioning status.
|
max_size |
int64 Maximum size of the bucket, in bytes. |
policy |
Bucket policies that set permissions for actions with the bucket, its objects, and groups of objects. |
acl |
Access control list (ACL) of the bucket. |
created_at |
Creation timestamp. |
cors[] |
List of rules for cross-domain requests to objects in the bucket (cross-origin resource sharing, CORS). |
website_settings |
Configuration for hosting a static website in the bucket. |
lifecycle_rules[] |
List of object lifecycle rules for the bucket. |
tags[] |
List of tags for the bucket. |
object_lock |
Configuration for object lock on the bucket. |
encryption |
Configuration for bucket's encryption |
AnonymousAccessFlags
Field |
Description |
read |
Specifies whether public (anonymous) access to read objects in the bucket is enabled. |
list |
Specifies whether public (anonymous) access to the list of objects in the bucket is enabled. |
config_read |
Specifies whether public (anonymous) access to read CORS, |
ACL
Field |
Description |
grants[] |
List of permissions granted and the grantees. |
Grant
A grant resource, used to specify the permission granted and the grantee.
Field |
Description |
permission |
enum Permission Required field. Permission granted by the grant.
|
grant_type |
enum GrantType Required field. The grantee type for the grant.
|
grantee_id |
string ID of the account who is a grantee. Required when the |
CorsRule
A CORS rule resource.
For details about the concept, see documentation.
Field |
Description |
id |
string ID of the CORS rule. |
allowed_methods[] |
enum Method List of HTTP methods allowed by the CORS rule. When a client sends a CORS-preflight
|
allowed_headers[] |
string List of HTTP headers allowed by the CORS rule. When a client sends a CORS-preflight Each string in the list can contain at most one |
allowed_origins[] |
string List of request origins allowed by the CORS rule. Each string in the list can contain at most one |
expose_headers[] |
string List of headers contained in responses to CORS requests that can be accessed by applications. |
max_age_seconds |
Time in seconds that a client can cache the response to a CORS-preflight request as identified by the |
WebsiteSettings
Field |
Description |
index |
string Key of the index page object that is returned when a response is made to the root of the website. Either If specified, the index page object must be located in the root of the bucket. |
error |
string Key of the error page object that is returned when an error occurs. |
redirect_all_requests |
Configuration for redirecting all requests sent to the website. Either |
routing_rules[] |
List of redirect rules. |
Scheme
A configuration resource for redirecting all requests sent to the website.
Field |
Description |
protocol |
enum Protocol Scheme of the redirect URI.
|
hostname |
string Hostname of the redirect URI. |
RoutingRule
List of redirect rules.
Field |
Description |
condition |
Redirect condition. |
redirect |
Redirect instructions. |
Condition
Field |
Description |
http_error_code_returned_equals |
string HTTP status code (number only) that must match for the redirect to apply. |
key_prefix_equals |
string Prefix of the object key from which requests are redirected. |
Redirect
Field |
Description |
hostname |
string Hostname of the redirect URI. |
http_redirect_code |
string HTTP status code of the redirect response. Default value: |
protocol |
enum Protocol Scheme of the redirect URI.
|
replace_key_prefix_with |
string Substitution for the prefix of the object key specified in Condition.key_prefix_equals. At most one of |
replace_key_with |
string New object key. At most one of |
LifecycleRule
An object lifecycle rule resource for the bucket.
For details about the concept, see documentation.
Field |
Description |
id |
ID of the rule. Provided by the client or generated at creation time. |
enabled |
bool Indicates whether the rule is in effect. |
filter |
Filter that identifies the objects to which the rule applies. If not specified, the rule applies to all objects in the bucket. |
expiration |
Expiration rule. The expiration of an object is described as follows. For the unversioned bucket (Bucket.versioning is For the bucket with versioning enabled (Bucket.versioning is For the bucket with versioning suspended (Bucket.versioning is |
transitions[] |
List of transition rules. The transition of an object is described as follows. For the unversioned bucket (Bucket.versioning is For the bucket with versioning enabled (Bucket.versioning is |
abort_incomplete_multipart_upload |
Configuration for aborting incomplete multipart uploads. |
noncurrent_expiration |
Expiration rule for non-current versions of objects in a bucket with versioning enabled (Bucket.versioning is At expiration, the non-current version of the object is deleted and cannot be recovered. |
noncurrent_transitions[] |
List of transition rules for non-current versions of objects in a bucket with versioning enabled At transition, the non-current version of the object is transitioned to the specified storage class. |
noncurrent_delete_markers |
Expiration rule for non-current delete markers of an objects in a bucket with versioning At expiration, the non-current delete marker of the object is deleted and cannot be recovered. |
RuleFilter
Field |
Description |
prefix |
string Key prefix that the object must have in order for the rule to apply. |
object_size_greater_than |
Size that the object must be greater. |
object_size_less_than |
Size that the object must be less t. |
tag |
Tags that the object's tag set must have for the rule to apply. |
and_operator |
Apply a logical AND to all of the predicates configured inside the And operator. |
Tag
Field |
Description |
key |
string Key of the bucket tag. |
value |
string Value of the bucket tag. |
And
Field |
Description |
prefix |
string |
object_size_greater_than |
|
object_size_less_than |
|
tag[] |
Expiration
Field |
Description |
date |
Specific date of object expiration. The rule continues to apply even after the date has passed, i.e. any new objects created in the bucket expire Exactly one of |
days |
Time period, in number of days from the creation or modification of the object, after which an object expires. Exactly one of |
expired_object_delete_marker |
Indicates whether a delete marker of an object with no non-current versions (referred to as an expired object Exactly one of |
Transition
List of transition rules.
The transition of an object is described as follows.
For the unversioned bucket (Bucket.versioning is VERSIONING_DISABLED
), the object is transitioned to the
specified storage class.
For the bucket with versioning enabled (Bucket.versioning is VERSIONING_ENABLED
) or suspended
(VERSIONING_SUSPENDED
), the current version of the object is transitioned to the specified storage class.
Field |
Description |
date |
Specific date of object transition. The rule continues to apply even after the date has passed, i.e. any new objects created in the bucket are At most one of |
days |
Time period, in number of days from the creation or modification of the object, after which an object is At most one of |
storage_class |
string Required field. Storage class to which an object is transitioned from standard storage. The only supported class is cold storage ( |
AfterDays
Field |
Description |
days_after_expiration |
Time period, in number of days from the start of the multipart upload, after which the incomplete upload is |
NoncurrentExpiration
Field |
Description |
noncurrent_days |
Time period, in number of days since the version of an object was classified as non-current, after which the |
NoncurrentTransition
List of transition rules for non-current versions of objects in a bucket with versioning enabled
(Bucket.versioning is VERSIONING_ENABLED
) or suspended (VERSIONING_SUSPENDED
).
At transition, the non-current version of the object is transitioned to the specified storage class.
Field |
Description |
noncurrent_days |
Time period, in number of days since the version of an object was classified as non-current, after which the |
storage_class |
string Required field. Storage class to which a non-current version of an object is transitioned from standard storage. The only supported class is cold storage ( |
NoncurrentDeleteMarkers
Field |
Description |
noncurrent_days |
Time period, in number of days since the version of a delete marker was classified as non-current, after which |
ObjectLock
A resource for Object Lock configuration of a bucket.
For details about the concept, see documentation.
Field |
Description |
status |
enum ObjectLockStatus
|
default_retention |
DefaultRetention
Default lock configuration for added objects
Field |
Description |
mode |
enum Mode
|
days |
int64 Number of days for locking Includes only one of the fields |
years |
int64 Number of years for locking Includes only one of the fields |
Encryption
Field |
Description |
rules[] |
EncryptionRule
Field |
Description |
kms_master_key_id |
string |
sse_algorithm |
string |