Object Storage API, gRPC: BucketService.Create
Creates a bucket in the specified folder.
gRPC request
rpc Create (CreateBucketRequest) returns (operation.Operation)
CreateBucketRequest
{
"name": "string",
"folder_id": "string",
"default_storage_class": "string",
"max_size": "int64",
"anonymous_access_flags": {
"read": "google.protobuf.BoolValue",
"list": "google.protobuf.BoolValue",
"config_read": "google.protobuf.BoolValue"
},
"acl": {
"grants": [
{
"permission": "Permission",
"grant_type": "GrantType",
"grantee_id": "string"
}
]
},
"tags": [
{
"key": "string",
"value": "string"
}
],
"encryption": {
"rules": [
{
"kms_master_key_id": "string",
"sse_algorithm": "string"
}
]
},
"versioning": "Versioning",
"allowed_private_endpoints": {
"enabled": "bool",
"private_endpoints": [
"string"
],
"force_cloud_console_access": "bool"
},
"disabled_statickey_auth": "bool",
"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",
"newer_noncurrent_versions": "google.protobuf.Int64Value"
},
"noncurrent_transitions": [
{
"noncurrent_days": "google.protobuf.Int64Value",
"storage_class": "string",
"newer_noncurrent_versions": "google.protobuf.Int64Value"
}
],
"noncurrent_delete_markers": {
"noncurrent_days": "google.protobuf.Int64Value"
}
}
]
}
|
Field |
Description |
|
name |
string Required field. Name of the bucket. |
|
folder_id |
string Required field. ID of the folder to create a bucket in. The maximum string length in characters is 50. |
|
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. |
|
anonymous_access_flags |
Flags for configuring public (anonymous) access to the bucket's content and settings. |
|
acl |
Access control list (ACL) of the bucket. |
|
tags[] |
List of tags for the bucket. |
|
encryption |
Configuration for bucket's encryption. |
|
versioning |
enum Versioning Bucket versioning status.
|
|
allowed_private_endpoints |
Configuration for bucket's allowed private endpoints. |
|
disabled_statickey_auth |
bool An option to disable static key auth for a bucket. |
|
lifecycle_rules[] |
Configuration for bucket's lifecycle rules. |
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 The maximum string length in characters is 100. |
Tag
|
Field |
Description |
|
key |
string Key of the bucket tag. |
|
value |
string Value of the bucket tag. |
Encryption
|
Field |
Description |
|
rules[] |
Rules |
EncryptionRule
|
Field |
Description |
|
kms_master_key_id |
string KMS master key ID |
|
sse_algorithm |
string SSE algorithm |
BucketAllowedPrivateEndpoints
|
Field |
Description |
|
enabled |
bool if true, private endpoints white list check is enabled |
|
private_endpoints[] |
string white list of private endpoints bucket accessible from |
|
force_cloud_console_access |
bool if true, cloud console will be able to access a bucket |
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. |
|
expiration |
Expiration rule. |
|
transitions[] |
List of transition rules. |
|
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 |
|
noncurrent_transitions[] |
List of transition rules for non-current versions of objects in a bucket with versioning enabled |
|
noncurrent_delete_markers |
Expiration rule for non-current delete markers of an objects in a bucket with versioning |
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. |
And
|
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 than. |
|
tag[] |
Tags that the object's tag set must have for the rule to apply. |
Expiration
|
Field |
Description |
|
date |
Specific date of object expiration. |
|
days |
Time period, in number of days from the creation or modification of the object, after which an object expires. |
|
expired_object_delete_marker |
Indicates whether a delete marker of an object with no non-current versions (referred to as an expired object |
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. |
|
days |
Time period, in number of days from the creation or modification of the object, after which an object is |
|
storage_class |
string Required field. Storage class to which an object is transitioned from standard 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 |
|
newer_noncurrent_versions |
Specifies how many noncurrent versions S3 will retain. |
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. |
|
newer_noncurrent_versions |
Specifies how many noncurrent versions S3 will retain. |
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 |
operation.Operation
{
"id": "string",
"description": "string",
"created_at": "google.protobuf.Timestamp",
"created_by": "string",
"modified_at": "google.protobuf.Timestamp",
"done": "bool",
"metadata": "google.protobuf.Any",
// Includes only one of the fields `error`, `response`
"error": "google.rpc.Status",
"response": "google.protobuf.Any"
// 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. |