Creates an image build rule for an image repository.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateRepoBuildRule

The operation that you want to perform. Set the value to CreateRepoBuildRule.

DockerfileLocation String Yes /

The directory of the Dockerfile.

DockerfileName String Yes Dockerfile

The name of the Dockerfile.

ImageTag String Yes 2

The tag of the image.

InstanceId String Yes cri-xkx6vujuhay0tqas

The ID of the instance.

PushName String Yes master

The version number of the Git repository where the Dockerfile resides.

PushType String Yes GIT_BRANCH

The version type of the Git repository where the Dockerfile resides. Valid values: GIT_TAG and GIT_BRANCH.

RegionId String Yes cn-shanghai

The ID of the region.

RepoId String Yes crr-8dz3aedjqlmkrasd

The ID of the repository.

Response parameters

Parameter Type Example Description
IsSuccess Boolean true

Indicates whether the operation is successful.

Code String success

The return value.

RequestId String 2E055A30-F4BA-4B34-BC95-276CDAF5935D

The ID of the request.

BuildRuleId String crbr-rbfghsymk0qs7aaa

The ID of the image build rule.

Examples

Sample requests

http(s)://[Endpoint]/? Action=CreateRepoBuildRule
&DockerfileLocation=/
&DockerfileName=Dockerfile
&ImageTag=2
&InstanceId=cri-xkx6vujuhay0tqas
&PushName=master
&PushType=GIT_BRANCH
&RegionId=cn-shanghai
&RepoId=crr-8dz3aedjqlmkrasd
&<Common request parameters>

Sample success responses

JSON format

{
    "IsSuccess":true,
    "BuildRuleId":"crbr-rbfghsymk0qs7aaa",
    "RequestId":"2E055A30-F4BA-4B34-BC95-276CDAF5935D",
    "Code":"success"
}

XML format

<IsSuccess>true</IsSuccess>
<BuildRuleId>crbr-rbfghsymk0qs7aaa</BuildRuleId>
<RequestId>2E055A30-F4BA-4B34-BC95-276CDAF5935D</RequestId>
<Code>success</Code>

Error codes

For a list of error codes, visit the API Error Center.