Lists artifact lifecycle management rules.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cr:ListArtifactLifecycleRule |
get |
*Instance
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
The ID of the Enterprise instance. |
cri-eztul9ucz76q**** |
| PageNo |
integer |
No |
The page number. |
1 |
| PageSize |
integer |
No |
The number of entries per page. Maximum value: 100. If the specified value exceeds 100, the system returns a parameter error or uses 100 as the actual maximum number of entries returned. |
10 |
| EnableDeleteTag |
boolean |
No |
Specifies whether lifecycle management is enabled. |
true |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Code |
string |
The return code. |
success |
| IsSuccess |
boolean |
Indicates whether the call was successful. Valid values:
|
true |
| PageNo |
integer |
The page number. |
1 |
| PageSize |
integer |
The page size. |
10 |
| RequestId |
string |
The request ID. |
F92D82F9-A4C4-5A4A-97B9-E495BF1B**** |
| Rules |
array<object> |
The list of rules. |
|
|
array<object> |
|||
| Auto |
boolean |
Indicates whether the rule is automatically executed. |
false |
| CreateTime |
integer |
The creation time. The value is a UNIX timestamp in milliseconds. |
1638187989000 |
| DryRun |
boolean |
Indicates whether DryRun mode is enabled. When DryRun mode is enabled, only lifecycle task scanning is performed and no actual data cleanup is executed. This mode is disabled by default. |
false |
| EnableDeleteTag |
boolean |
Indicates whether lifecycle management is enabled. Only one of this parameter and EnableDeleteUntaggedManifest can be set to true. |
true |
| EnableDeleteUntaggedManifest |
boolean |
Indicates whether artifact cleanup is enabled. Only one of this parameter and EnableDeleteTag can be set to true. |
false |
| InstanceId |
string |
The instance ID. |
cri-brlg4cbj2yl**** |
| ModifiedTime |
integer |
The modification time. The value is a UNIX timestamp in milliseconds. |
1678341923385 |
| NamespaceName |
string |
The namespace name. |
test-ns |
| NextTime |
integer |
The next execution time. The value is a UNIX timestamp in milliseconds. |
1638187989000 |
| Policies |
array<object> |
The list of lifecycle policies. |
|
|
array<object> |
|||
| Condition |
object |
The trigger condition of the lifecycle policy. |
|
| LastPullOlderThanDays |
integer |
The number of days since the last pull. |
0 |
| LastPushOlderThanDays |
integer |
The number of days since the last push. |
0 |
| LatestTagCount |
integer |
The number of latest image versions to retain. |
0 |
| Filter |
object |
The image version filter condition. |
|
| TagWildcard |
string |
The wildcard used to match image versions. |
|
| Type |
string |
The lifecycle policy type. |
|
| RepoName |
string |
The repository name. |
test_1 |
| RetentionTagCount |
integer |
The number of retained images. |
30 |
| RuleId |
string |
The rule ID. |
cralr-yqx1q5sir6d**** |
| ScheduleTime |
string |
The execution cycle. |
WEEK |
| Scope |
string |
The cleanup scope. |
INSTANCE |
| TagRegexp |
string |
The regular expression for retaining image versions. |
.*-alpine |
| TotalCount |
integer |
The total number of entries. |
39 |
Examples
Success response
JSON format
{
"Code": "success",
"IsSuccess": true,
"PageNo": 1,
"PageSize": 10,
"RequestId": "F92D82F9-A4C4-5A4A-97B9-E495BF1B****",
"Rules": [
{
"Auto": false,
"CreateTime": 1638187989000,
"DryRun": false,
"EnableDeleteTag": true,
"EnableDeleteUntaggedManifest": false,
"InstanceId": "cri-brlg4cbj2yl****",
"ModifiedTime": 1678341923385,
"NamespaceName": "test-ns",
"NextTime": 1638187989000,
"Policies": [
{
"Condition": {
"LastPullOlderThanDays": 0,
"LastPushOlderThanDays": 0,
"LatestTagCount": 0
},
"Filter": {
"TagWildcard": ""
},
"Type": ""
}
],
"RepoName": "test_1",
"RetentionTagCount": 30,
"RuleId": "cralr-yqx1q5sir6d****",
"ScheduleTime": "WEEK",
"Scope": "INSTANCE",
"TagRegexp": ".*-alpine\n"
}
],
"TotalCount": 39
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 500 | SystemError | A system error occurred. | An unknown error occurred. |
| 403 | NoPrivilege | Access is denied for the user. | The user is not authorized. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.