Updates an image build rule for a repository.

Request information

Request line

POST /repos/[RepoNamespace]/[RepoName]/rules/[BuildRuleId] HTTP/1.1

Request line parameters

Parameter Type Required Description
RepoNamespace String Yes The name of the namespace.
RepoName String Yes The name of the repository.
BuildRuleId Integer Yes The ID of the image build rule.

Operation-specific request headers

None.

Request body

{
   "BuildRule": {
      "PushType": String,
      "PushName": String,
      "DockerfileLocation": String,
      "DockerfileName": String,
      "ImageTag": String,
      "Tag": String
   }
}

Request body parameters

Parameter Type Required Description
PushType String Yes The type of push.
PushName String Yes The name of the push.
DockerfileLocation String Yes The location of the Dockerfile.
DockerfileName String Yes The name of the Dockerfile.
ImageTag String Yes The tag of the container image.
Tag String Yes The tag of the source code.

Response information

Response line

HTTP/1.1 200 OK

Operation-specific response headers

None.

Response body

{
    "data": {
        "buildRuleId": Int
    },
    "requestId": "String"
}

Response body parameters

Parameter Type Required Description
buildRuleId Int Yes The ID of the image build rule.

Examples

Sample requests

POST /repos/[RepoNamespace]/[RepoName]/rules/[BuildRuleId] HTTP/1.1
<Common request headers>

{
   "BuildRule": {
      "PushType": "GIT_BRANCH",
      "PushName": "master",
      "DockerfileLocation": "/",
      "DockerfileName": "Dockerfile",
      "ImageTag": "v0.1",
      "Tag": "v0.1"
   }
}

Sample responses

HTTP/1.1 200 OK
<Common response headers>

{
    "data": {
        "buildRuleId": 127741
    },
    "requestId": "8DBD3292-A232-44F6-93DC-B30D70AF54E9"
}