Object Storage API, REST: Bucket.List
- HTTP request
- Query parameters
- Response
- Bucket
- AnonymousAccessFlags
- ACL
- Grant
- CorsRule
- WebsiteSettings
- Scheme
- RoutingRule
- Condition
- Redirect
- LifecycleRule
- RuleFilter
- Tag
- And
- Expiration
- Transition
- AfterDays
- NoncurrentExpiration
- NoncurrentTransition
- NoncurrentDeleteMarkers
- ObjectLock
- DefaultRetention
- Encryption
- EncryptionRule
- BucketAllowedPrivateEndpoints
Retrieves the list of buckets in the specified folder.
The following fields will not be returned for buckets in the list: Bucket.policy, Bucket.acl, Bucket.cors,
Bucket.websiteSettings, Bucket.lifecycleRules, Bucket.tags.
HTTP request
GET https://storage.api.cloud.yandex.net/storage/v1/buckets
Query parameters
Field |
Description |
folderId |
string Required field. ID of the folder to list buckets in. To get the folder ID, make a yandex.cloud.resourcemanager.v1.FolderService.List request. |
Response
HTTP Code: 200 - OK
{
"buckets": [
{
"id": "string",
"name": "string",
"folderId": "string",
"anonymousAccessFlags": {
"read": "boolean",
"list": "boolean",
"configRead": "boolean"
},
"defaultStorageClass": "string",
"versioning": "string",
"maxSize": "string",
"policy": "object",
"acl": {
"grants": [
{
"permission": "string",
"grantType": "string",
"granteeId": "string"
}
]
},
"createdAt": "string",
"cors": [
{
"id": "string",
"allowedMethods": [
"string"
],
"allowedHeaders": [
"string"
],
"allowedOrigins": [
"string"
],
"exposeHeaders": [
"string"
],
"maxAgeSeconds": "string"
}
],
"websiteSettings": {
"index": "string",
"error": "string",
"redirectAllRequests": {
"protocol": "string",
"hostname": "string"
},
"routingRules": [
{
"condition": {
"httpErrorCodeReturnedEquals": "string",
"keyPrefixEquals": "string"
},
"redirect": {
"hostname": "string",
"httpRedirectCode": "string",
"protocol": "string",
"replaceKeyPrefixWith": "string",
"replaceKeyWith": "string"
}
}
]
},
"lifecycleRules": [
{
"id": "string",
"enabled": "boolean",
"filter": {
"prefix": "string",
"objectSizeGreaterThan": "string",
"objectSizeLessThan": "string",
"tag": {
"key": "string",
"value": "string"
},
"andOperator": {
"prefix": "string",
"objectSizeGreaterThan": "string",
"objectSizeLessThan": "string",
"tag": [
{
"key": "string",
"value": "string"
}
]
}
},
"expiration": {
"date": "string",
"days": "string",
"expiredObjectDeleteMarker": "boolean"
},
"transitions": [
{
"date": "string",
"days": "string",
"storageClass": "string"
}
],
"abortIncompleteMultipartUpload": {
"daysAfterExpiration": "string"
},
"noncurrentExpiration": {
"noncurrentDays": "string"
},
"noncurrentTransitions": [
{
"noncurrentDays": "string",
"storageClass": "string"
}
],
"noncurrentDeleteMarkers": {
"noncurrentDays": "string"
}
}
],
"tags": [
{
"key": "string",
"value": "string"
}
],
"objectLock": {
"status": "string",
"defaultRetention": {
"mode": "string",
// Includes only one of the fields `days`, `years`
"days": "string",
"years": "string"
// end of the list of possible fields
}
},
"encryption": {
"rules": [
{
"kmsMasterKeyId": "string",
"sseAlgorithm": "string"
}
]
},
"allowedPrivateEndpoints": {
"enabled": "boolean",
"privateEndpoints": [
"string"
]
}
}
]
}
Field |
Description |
buckets[] |
List of buckets in the specified folder. |
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 |
folderId |
string ID of the folder that the bucket belongs to. |
anonymousAccessFlags |
Flags for configuring public (anonymous) access to the bucket's content and settings. |
defaultStorageClass |
string Default storage class for objects in the bucket. Supported classes are standard storage ( |
versioning |
enum (Versioning) Bucket versioning status.
|
maxSize |
string (int64) Maximum size of the bucket, in bytes. |
policy |
object Bucket policies that set permissions for actions with the bucket, its objects, and groups of objects. |
acl |
Access control list (ACL) of the bucket. |
createdAt |
string (date-time) Creation timestamp. String in RFC3339 To work with values in this field, use the APIs described in the |
cors[] |
List of rules for cross-domain requests to objects in the bucket (cross-origin resource sharing, CORS). |
websiteSettings |
Configuration for hosting a static website in the bucket. |
lifecycleRules[] |
List of object lifecycle rules for the bucket. |
tags[] |
List of tags for the bucket. |
objectLock |
Configuration for object lock on the bucket. |
encryption |
Configuration for bucket's encryption |
allowedPrivateEndpoints |
Bucket allowed private endpoints. |
AnonymousAccessFlags
Field |
Description |
read |
boolean Specifies whether public (anonymous) access to read objects in the bucket is enabled. |
list |
boolean Specifies whether public (anonymous) access to the list of objects in the bucket is enabled. |
configRead |
boolean 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.
|
grantType |
enum (GrantType) Required field. The grantee type for the grant.
|
granteeId |
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. |
allowedMethods[] |
enum (Method) List of HTTP methods allowed by the CORS rule. When a client sends a CORS-preflight
|
allowedHeaders[] |
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 |
allowedOrigins[] |
string List of request origins allowed by the CORS rule. Each string in the list can contain at most one |
exposeHeaders[] |
string List of headers contained in responses to CORS requests that can be accessed by applications. |
maxAgeSeconds |
string (int64) 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. |
redirectAllRequests |
Configuration for redirecting all requests sent to the website. Either |
routingRules[] |
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 |
httpErrorCodeReturnedEquals |
string HTTP status code (number only) that must match for the redirect to apply. |
keyPrefixEquals |
string Prefix of the object key from which requests are redirected. |
Redirect
Field |
Description |
hostname |
string Hostname of the redirect URI. |
httpRedirectCode |
string HTTP status code of the redirect response. Default value: |
protocol |
enum (Protocol) Scheme of the redirect URI.
|
replaceKeyPrefixWith |
string Substitution for the prefix of the object key specified in Condition.keyPrefixEquals. At most one of |
replaceKeyWith |
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 |
string ID of the rule. Provided by the client or generated at creation time. |
enabled |
boolean 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 |
abortIncompleteMultipartUpload |
Configuration for aborting incomplete multipart uploads. |
noncurrentExpiration |
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. |
noncurrentTransitions[] |
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. |
noncurrentDeleteMarkers |
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. |
objectSizeGreaterThan |
string (int64) Size that the object must be greater. |
objectSizeLessThan |
string (int64) Size that the object must be less t. |
tag |
Tags that the object's tag set must have for the rule to apply. |
andOperator |
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 |
objectSizeGreaterThan |
string (int64) |
objectSizeLessThan |
string (int64) |
tag[] |
Expiration
Field |
Description |
date |
string (date-time) 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 String in RFC3339 To work with values in this field, use the APIs described in the |
days |
string (int64) Time period, in number of days from the creation or modification of the object, after which an object expires. Exactly one of |
expiredObjectDeleteMarker |
boolean 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 |
string (date-time) 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 String in RFC3339 To work with values in this field, use the APIs described in the |
days |
string (int64) Time period, in number of days from the creation or modification of the object, after which an object is At most one of |
storageClass |
string Required field. Storage class to which an object is transitioned from standard storage. The only supported class is cold storage ( |
AfterDays
Field |
Description |
daysAfterExpiration |
string (int64) Time period, in number of days from the start of the multipart upload, after which the incomplete upload is |
NoncurrentExpiration
Field |
Description |
noncurrentDays |
string (int64) 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 |
noncurrentDays |
string (int64) Time period, in number of days since the version of an object was classified as non-current, after which the |
storageClass |
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 |
noncurrentDays |
string (int64) 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)
|
defaultRetention |
DefaultRetention
Default lock configuration for added objects
Field |
Description |
mode |
enum (Mode)
|
days |
string (int64) Number of days for locking Includes only one of the fields |
years |
string (int64) Number of years for locking Includes only one of the fields |
Encryption
Field |
Description |
rules[] |
EncryptionRule
Field |
Description |
kmsMasterKeyId |
string |
sseAlgorithm |
string |
BucketAllowedPrivateEndpoints
Field |
Description |
enabled |
boolean if true, private endpoints white list check is enabled |
privateEndpoints[] |
string white list of private endpoints bucket accessible from |