You can call this operation to create a 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 path to Dockerfile.

DockerfileName String Yes Dockerfile

The name of Dockerfile.

ImageTag String Yes 2

The version of the image.

InstanceId String Yes cri-xkx6vujuhay0tqas

The ID of the instance.

PushName String Yes master

The name of the push.

PushType String Yes GIT_BRANCH

The type of the push. Valid values: GIT_TAG and GIT_BRANCH.

RegionId String Yes cn-shanghai

The region where the image repository is deployed.

RepoId String Yes crr-8dz3aedjqlmkrasd

The ID of the image repository.

Response parameters

Parameter Type Example Description
BuildRuleId String crbr-rbfghsymk0qs7aaa

The ID of the build rule that was created.

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

XML format

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

JSON format

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

Error codes

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