All Products
Search
Document Center

Container Registry:GetArtifactBuildRule

Last Updated:Sep 16, 2026

Retrieves an artifact build rule.

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:GetArtifactBuildRule

get

*Instance

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

None None

Request parameters

Parameter

Type

Required

Description

Example

InstanceId

string

Yes

The instance ID.

cri-xkx6vujuhay0****

ScopeType

string

No

The scope of the rule. Valid values:

  • REPOSITORY: repository level.

REPOSITORY

ScopeId

string

No

The ID of the scope in which the rule takes effect. Valid values:

  • ScopeId: the image repository ID.

crr-8dz3aedjqlmk****

ArtifactType

string

No

The type of the accelerated image. Valid values:

  • ACCELERATED_IMAGE: generates an accelerated image.

ACCELERATED_IMAGE

BuildRuleId

string

No

The build rule ID.

crabr-o2670wqz2n70****

Response elements

Element

Type

Description

Example

object

ArtifactType

string

The type of the accelerated image. Valid values:

  • ACCELERATED_IMAGE: generates an accelerated image.

ACCELERATED_IMAGE

BuildRuleId

string

The build rule ID.

crabr-o2670wqz2n70****

Code

string

The response code. Valid values:

  • 200: success.

  • Other values: error codes.

success

IsSuccess

boolean

Indicates whether the API call is successful. Valid values:

  • true: The API call is successful.

  • false: The API call failed.

true

Parameters

object

The additional parameters.

ImageIndexOnly

boolean

Indicates whether the index-only mode is enabled.

false

Priority

integer

The task priority. Valid values: [1, 5].

3

PriorityFile

string

The list of prefetch files for the accelerated image. Each line contains an absolute path. The list is Base64-encoded.

L2hvbWUvdGVzdC8=

RequestId

string

The request ID.

7A3E98F6-296C-54AC-A612-B75E7777D4C1

ScopeId

string

The ID of the scope in which the rule takes effect. Valid values:

  • ScopeId: the image repository ID.

crr-8dz3aedjqlmk****

ScopeType

string

The scope of the rule. Valid values:

  • REPOSITORY: repository level.

REPOSITORY

Examples

Success response

JSON format

{
  "ArtifactType": "ACCELERATED_IMAGE",
  "BuildRuleId": "crabr-o2670wqz2n70****\n",
  "Code": "success",
  "IsSuccess": true,
  "Parameters": {
    "ImageIndexOnly": false,
    "Priority": 3,
    "PriorityFile": "L2hvbWUvdGVzdC8="
  },
  "RequestId": "7A3E98F6-296C-54AC-A612-B75E7777D4C1",
  "ScopeId": "crr-8dz3aedjqlmk****",
  "ScopeType": "REPOSITORY"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.