All Products
Search
Document Center

Container Registry:ListArtifactLifecycleRule

Last Updated:Sep 16, 2026

Lists artifact lifecycle management rules.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

cr:ListArtifactLifecycleRule

get

*Instance

acs:cr:{#regionId}:{#accountId}:instance/{#InstanceId}

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: The call was successful.

  • false: The call failed.

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.