You need to enable JavaScript to run this app.
Torch Object Storage

Torch Object Storage

Copy page
Download PDF
Bucket Lifecycle
GetBucketLifecycle
Copy page
Download PDF
GetBucketLifecycle
Description​
This API is used to get the lifecycle rules of a specified bucket.​
Request syntax​
​
GET /?lifecycle HTTP/1.1​
Host: bucket-name.tos-cn-beijing.volces.com​
Date: GMT Date​
Authorization: authorization string​
​
Request parameters and headers​
For common request headers, see Common parameters.​
​
Name​
Location​
Type​
Required​
Sample value​
Description​
lifecycle​
Query​
String​
Yes​
-​
Identifies a GetBucketLifecycle request.​
​
Request body elements​
No elements are used.​
Response headers​
For common response headers, see Common parameters.​
Response body elements​
Common elements​
​
Name​
Type​
Sample value​
Description​
Rules​
Array​
-​
The lifecycle rule information.​
ID​
String​
id​
The unique identifier of the rule.​
Prefix​
String​
prefix1/​
Specifies the prefix to which the rule applies. Overlapping prefixes are disallowed.​
  • If a prefix is specified, the rule applies only to objects in the bucket that have a matching prefix.​
  • If no prefix is specified, the rule applies to all objects in the bucket.​
Status​
String​
Enabled​
Specifies whether the rule is enabled. Valid values:​
  • Enabled: The rule is enabled and executed by TOS regularly.​
  • Disabled: The rule is not enabled and is ignored by TOS.​
Tags​
Array​
-​
You can configure lifecycle rules for objects with specific tags. You can configure up to 10 tags. For more information on tags, see Managing object tags.​
Child nodes: Key, Value​
Key​
String​
tag​
The key of the object tag.​
Parent node: Tags​
Value​
String​
value​
The value of the object tag.​
Parent node: Tags​
Filter​
Container​
-​
The filtering conditions that specify when rules take effect currently only apply within a specified range of object sizes.​
Child nodes: ObjectSizeGreaterThan, GreaterThanIncludeEqual, ObjectSizeLessThan, LessThanIncludeEqual​
ObjectSizeGreaterThan​
Integer​
65536​
The rule applies to objects larger than the specified size, in bytes.​
Parent node: Filter​
GreaterThanIncludeEqual​
String​
Enabled​
Whether to enable the equal condition. It can only be set to Enabled or Disabled. If not configured, it defaults to Disabled. The values are explained as follows:​
  • Enabled: Enable equal conditions, i.e. greater than or equal to.​
  • Disabled: Not enabling the equal condition, i.e., greater than.​
Parent node: Filter​
ObjectSizeLessThan​
Integer​
65536​
Set rules to apply to objects smaller than the specified size, in bytes.​
Parent node: Filter​
LessThanIncludeEqual​
String​
Enabled​
Whether to enable the equal condition. The possible values are Enabled and Disabled, with Disabled being the default if not configured. The values are as follows:​
  • Enabled: Enable equal conditions, i.e. less than or equal to.​
  • Disabled: Indicate not to enable the equal condition, i.e. less than.​
Parent node: Filter​
Not​
Array​
-​
Set this lifecycle rule to ignore objects with the specified prefix and tags.​
Prefix​
String​
prefix123​
Specify the object prefix to which Not applies instead of configuration.​
Parent node: Not​
Tags​
Array​
-​
Specify the object tag to which Not applies.​
Child nodes: Key, Value​
Key​
String​
key1​
Specify the tag key to which the Not configuration applies.​
Parent node: Tags​
Value​
String​
value1​
Specify the object tag value to which the Not configuration applies.​
Parent node: Tags​
​
Elements related to lifecycle rules based on last modification time​
​
Name​
Type​
Sample value​
Description​
Expiration​
Container​
-​
Removes the expired properties of the latest version of the object from the lifecycle rule based on the last modification time. For Buckets with versioning enabled, the specified expiration time is only valid for the current version of the object.​
Child nodes: Days, Date​
Days​
Integer​
120​
The number of days the latest version of the object in the lifecycle rule expired and deleted based on the last modification time.​
Parent Node: Expiration​
Date​
String​
2024-01-31T00:00:00.000Z​
The specific date on which the latest version of the object in the lifecycle rule expires and is deleted based on the last modification time. According to the ISO 8601 standard, it is the zero point of UTC.​
Parent Node: Expiration​
NoncurrentVersionExpiration​
Container​
-​
Removes the expired property of the historical version object from the lifecycle rule based on the last modification time. Effective only for buckets with version control turned on or suspended, and only for historical versions of objects.​
Child nodes: NoncurrentDays, NonCurrentDate​
NoncurrentDays​
String​
30​
The number of days in the lifecycle rule based on the last modification time for the historical version object to expire and be deleted.​
Parent Node: NoncurrentVersionExpiration​
NonCurrentDate​
String​
2024-01-31T00:00:00.000Z​
The specific date on which the historical version object expired and was deleted in the lifecycle rule based on the last modification time. According to the ISO 8601 standard, it is the zero point of UTC.​
Parent Node: NoncurrentVersionExpiration​
AbortIncompleteMultipartUpload​
Container​
-​
Specifies the expired property of incomplete multipart uploads (parts).​
Child nodes: DaysAfterInitiation​
DaysAfterInitiation​
Integer​
30​
Specifies the lifecycle rule for incomplete multipart uploads (parts), the number of days after multipart uploads have been initialized.​
Parent Node: AbortIncompleteMultipartUpload​
Transitions​
Array​
-​
The expiration property of the latest version of the object is settled in the lifetime rule based on the last modification time. For Buckets with versioning enabled, the specified expiration time is only valid for the current version of the object.​
warning​
If you set up auto-transition to Infrequent Access Storage, Intelligent Tiering, Flashback Archive, Archive, Cold Archive, Deep Cold Archive and Delete Objects at the same time, the transition time must meet: Infrequent Access Storage < Intelligent Tiering < Flashback Archive < Archive < Cold Archive < Deep Cold Archive < Delete Objects.​
Child nodes: StorageClass, Days, Date​
StorageClass​
String​
IA​
The storage type of the latest version of the object settlement in the lifecycle rule based on the last modification time. For detailed information, please refer to Storage type.​
Parent Node: Transitions​
Days​
Integer​
120​
The number of days in which the latest version of the object in the lifecycle rule based on the last modification time has expired and settled must be a positive integer.​
Parent Node: Transitions​
Date​
String​
2024-01-31T00:00:00.000Z​
The specific date on which the latest version of the object in the lifecycle rule expired and settled based on the last modification time. According to the ISO 8601 standard, it is the zero point of UTC.​
Parent Node: Transitions​
NoncurrentVersionTransitions​
Array​
-​
The expiration property of a settled version history object in the lifetime rule based on the last modification time. Effective only for buckets with version control turned on or suspended, and only for historical versions of objects.​
warning​
If you set up auto-transition to Infrequent Access Storage, Intelligent Tiering, Flashback Archive, Archive, Cold Archive, Deep Cold Archive and Delete Objects at the same time, the transition time must meet: Infrequent Access Storage < Intelligent Tiering < Flashback Archive < Archive < Cold Archive < Deep Cold Archive < Delete Objects.​
Child nodes: StorageClass, NoncurrentDays, NonCurrentDate​
StorageClass​
String​
IA​
The storage type of the historical version object settlement in the lifetime rule based on the last modification time. The storage type of the settlement. For detailed information, please refer to Storage type.​
Parent Node: NoncurrentVersionTransitions​
NoncurrentDays​
Integer​
120​
The number of days in which the historical object settled in the lifetime rule based on the last modification time must be a positive integer.​
Parent Node: NoncurrentVersionTransitions​
NoncurrentDate​
String​
2024-01-31T00:00:00.000Z​
The specific date on which the historical version object settled in the lifetime rule based on the last modification time. According to the ISO 8601 standard, it is the zero point of UTC.​
Parent Node: NoncurrentVersionTransitions​
​
Elements related to lifecycle rules based on last access time​
​
Name​
Type​
Sample value​
Description​
AccessTimeTransitions​
Array​
-​
When configuring lifecycle rules based on last access time, the expiration attribute of the most recent version of the object.​
Child nodes: StorageClass, Days​
StorageClass​
String​
IA​
When configuring lifecycle rules based on last access time, specify the storage class for the latest version objects that have been transitioned. For detailed information, please refer to Storage type.​
Parent node: AccessTimeTransitions​
Days​
Integer​
120​
When configuring lifecycle rules based on the last access time, specify the number of days for the latest version objects to expire and settle must be a positive integer.​
Parent node: AccessTimeTransitions​
NoncurrentVersionAccessTimeTransitions​
Array​
-​
In lifecycle rules based on last access time, the expiration attribute of historical version objects.​
Child nodes: StorageClass, NoncurrentDays​
StorageClass​
String​
IA​
When configuring lifecycle rules based on last access time, specify the storage class for the sinking of historical versions objects. For detailed information, please refer to Storage type.​
Parent node: NoncurrentVersionAccessTimeTransitions​
NoncurrentDays​
Integer​
60​
When configuring lifecycle rules based on last access time, the number of days specified for the expiration and transition of historical versions objects must be a positive integer.​
Parent node: NoncurrentVersionAccessTimeTransitions​
​
Sample request​
​
GET /?lifecycle HTTP/1.1​
Host: bucket-name.tos-cn-beijing.volces.com​
Date: Mon, 14 Apr 2021 01:17:29 GMT ​
Authorization: authorization string​
​
Sample response​
Sample response 1​
Lifecycle rules based on last modification time​
​
HTTP/1.1 200 OK​
Date: Fri, 30 Jul 2021 13:53:55 GMT​
Server: TosServer​
x-tos-id-2: 1e89f203jld00006-a444fd0​
x-tos-request-id: 1e89f203b2d00006-a444ed0​
Content-Length: ***​
{​
"Rules": [​
{​
"ID": "id",​
"Prefix": "prefix1/",​
"Status": "Enabled",​
"Expiration": { "Days": 120 },​
},​
{​
"ID": "id",​
"Prefix": "prefix2/",​
"Status": "Enabled",​
"AbortIncompleteMultipartUpload": { "DaysAfterInitiation": 10 }​
}]​
}​
​
Sample response 2​
Lifecycle rules based on last access time​
​
HTTP/1.1 200 OK​
Date: Fri, 03 Jan 2025 13:53:55 GMT​
Server: TosServer​
x-tos-id-2: 1e89f203jld00006-a444fd0​
x-tos-request-id: 1e89f203b2d00006-a444ed0​
Content-Length: ***​
{​
"Rules": [​
{​
"ID": "aaa",​
"Prefix": "",​
"Status": "Enabled",​
"Tags": [​
{​
"Key": "key",​
"Value": "value"​
}​
],​
"Filter": {​
"ObjectSizeGreaterThan": 1048576,​
"GreaterThanIncludeEqual": "Disabled",​
"ObjectSizeLessThan": 2072576,​
"LessThanIncludeEqual": "Disabled"​
"Not": [​
{​
"Prefix": "prefix123",​
"Tags": [{​
"Key": "key1",​
"Value": "value1"​
}]​
}​
]​
},​
"AccessTimeTransitions": [​
{​
"StorageClass": "ARCHIVE",​
"Days": 180​
}​
],​
"NoncurrentVersionAccessTimeTransitions": [​
{​
"StorageClass": "ARCHIVE",​
"NoncurrentDays": 180​
}​
]​
}​
]​
}​
​
Sample response 3​
If no lifecycle rules are set, a sample response similar to the following example is returned.​
​
{​
"Error": {​
"Code": "NoSuchLifecycleConfiguration",​
"RequestId": "936901f5f9aa32d663f5f9aa-ac192267-1pUn7K-GBL-cq-tos_front",​
"HostId": "fWBVJIQESfYijNMMUzZkucybHUTgEyaF",​
"Message": "The bucket lifecycle configuration does not exist"​
}​
}​
​
​
Last updated: 2026.08.03 10:26:25