All Products
Search
Document Center

Container Registry:ListRepoBuildRule

Last Updated:Mar 01, 2024

Queries image building rules of an image repository.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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
cr:ListRepositoryBuildRuleRead
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
InstanceIdstringYes

The ID of the instance.

cri-kmsiwlxxdcva****
RepoIdstringYes

The ID of the image repository.

crr-tquyps22md8****
PageNointegerNo

The number of the page to return.

1
PageSizeintegerNo

The number of entries to return on each page.

30

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request.

42D782C8-E8F6-4A32-BEA0-6A6AC854C22A
Codestring

The return value.

success
PageNointeger

The page number of the returned page.

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 returned per page.

30
TotalCountstring

The total number of returned entries.

1
BuildRulesobject []

The list of image building rules.

DockerfileLocationstring

The directory of the Dockerfile.

/
BuildRuleIdstring

The ID of the image building rule.

crbr-khys0nd3asbe****
PushTypestring

The type of the push that triggers the image building rule. Valid values:

  • GIT_BRANCH: branch push
  • GIT_TAG: tag push
GIT_BRANCH
PushNamestring

The name of the push that triggers the building rule.

v0.1
ImageTagstring

The tag of the image.

v0.1
DockerfileNamestring

The name of the Dockerfile.

Dockerfile
Platformsarray
string

The operating system and platform of the image.

linux/amd64
BuildArgsarray
string

Building arguments.

http_proxy=127.0.0.1

Examples

Sample success responses

JSONformat

{
  "RequestId": "42D782C8-E8F6-4A32-BEA0-6A6AC854C22A",
  "Code": "success",
  "PageNo": 1,
  "IsSuccess": true,
  "PageSize": 30,
  "TotalCount": "1",
  "BuildRules": [
    {
      "DockerfileLocation": "/",
      "BuildRuleId": "crbr-khys0nd3asbe****",
      "PushType": "GIT_BRANCH",
      "PushName": "v0.1",
      "ImageTag": "v0.1",
      "DockerfileName": "Dockerfile",
      "Platforms": [
        "linux/amd64"
      ],
      "BuildArgs": [
        "http_proxy=127.0.0.1 "
      ]
    }
  ]
}

Error codes

HTTP status codeError codeError message
403NoPrivilegeAccess denied for this user.
500SystemErrorUnknown error.

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