ListArtifactLifecycleRule

Updated at: 2024-12-27 02:25

Queries the lifecycle management rules of an artifact.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
OperationAccess levelResource typeCondition keyAssociated operation
cr:ListArtifactLifecycleRuleget
*Instance
acs:cr:{#regionId}:{#accountId}:instance/{#InstanceId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
ParameterTypeRequiredDescriptionExample
InstanceIdstringYes

The ID of the Container Registry Enterprise Edition instance.

cri-eztul9ucz76q****
PageNointegerNo

The page number.

1
PageSizeintegerNo

The number of entries per page.

10
EnableDeleteTagbooleanNo

Specifies whether to enable lifecycle management for the artifact.

true

Response parameters

ParameterTypeDescriptionExample
ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

F92D82F9-A4C4-5A4A-97B9-E495BF1B****
Codestring

The return value.

success
PageNointeger

The page number.

1
IsSuccessboolean

Indicates whether the request is successful. Valid values:

  • true: The request is successful.
  • false: The request fails.
true
PageSizeinteger

The number of entries per page.

10
TotalCountinteger

The total number of entries returned.

39
Rulesarray<object>

_

Rulesobject

The queried lifecycle management rules.

NextTimelong

The time when the lifecycle management rule is next executed.

1638187989000
CreateTimelong

The time when the lifecycle management rule was created.

1638187989000
TagRegexpstring

The regular expression that indicates which image tags are retained.

.*-alpine
EnableDeleteTagboolean

Indicates whether lifecycle management is enabled for the artifact.

true
InstanceIdstring

The instance ID.

cri-brlg4cbj2yl****
NamespaceNamestring

The name of the namespace.

test-ns
RuleIdstring

The rule ID.

cralr-yqx1q5sir6d****
ModifiedTimelong

The time when the lifecycle management rule was last modified.

1678341923385
RetentionTagCountlong

The number of retained images.

30
Autoboolean

Indicates whether the lifecycle management rule is automatically executed.

false
ScheduleTimestring

The execution cycle of the lifecycle management rule.

WEEK
RepoNamestring

The name of the image repository.

test_1
Scopestring

The deletion scope of artifacts.

INSTANCE

Examples

Sample success responses

JSONformat

{
  "RequestId": "F92D82F9-A4C4-5A4A-97B9-E495BF1B****",
  "Code": "success",
  "PageNo": 1,
  "IsSuccess": true,
  "PageSize": 10,
  "TotalCount": 39,
  "Rules": [
    {
      "NextTime": 1638187989000,
      "CreateTime": 1638187989000,
      "TagRegexp": ".*-alpine\n",
      "EnableDeleteTag": true,
      "InstanceId": "cri-brlg4cbj2yl****",
      "NamespaceName": "test-ns",
      "RuleId": "cralr-yqx1q5sir6d****",
      "ModifiedTime": 1678341923385,
      "RetentionTagCount": 30,
      "Auto": false,
      "ScheduleTime": "WEEK",
      "RepoName": "test_1",
      "Scope": "INSTANCE"
    }
  ]
}

Error codes

HTTP status codeError codeError messageDescription
HTTP status codeError codeError messageDescription
403NoPrivilegeAccess is denied for the user.The user is not authorized.
500SystemErrorA system error occurred.An unknown error occurred.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
Change timeSummary of changesOperation
No change history
  • On this page (1)
  • Debugging
  • Authorization information
  • Request parameters
  • Response parameters
  • Examples
  • Error codes
  • Change history
Feedback
phone Contact Us

Chat now with Alibaba Cloud Customer Service to assist you in finding the right products and services to meet your needs.

alicare alicarealicarealicare