Creates a webhook for a 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
InstanceId String Yes cri-xkx6vujuhay0tp12

The ID of the instance.

RegionId String Yes cn-shanghai

The ID of the region.

RepoId String Yes crr-xwvi3osiy4ffoqwe

The ID of the image repository.

TriggerName String Yes trigger1

The name of the webhook.

TriggerTag String Yes 1

The image tag that triggers the webhook.

TriggerType String Yes ALL

The type of webhook. Valid values: ALL, TAG_LIST, and TAG_REG_EXP.

TriggerUrl String Yes http://www.mysite.com

The URL of the webhook.

Response parameters

Parameter Type Example Description
IsSuccess Boolean true

Indicates whether the operation is successful.

Code String success

The return value.

RequestId String B79F5E0E-8770-407D-BCB6-ECF4BA9CDC26

The ID of the request.

TriggerId String crw-0z4pf81pgz35s5aa

The ID of the webhook.

Examples

Sample requests

http(s)://[Endpoint]/? Action=CreateRepoTrigger
&InstanceId=cri-xkx6vujuhay0tp12
&RegionId=cn-shanghai
&RepoId=crr-xwvi3osiy4ffoqwe
&TriggerName=trigger1
&TriggerTag=1
&TriggerType=ALL
&TriggerUrl=http://www.mysite.com
&<Common request parameters>

Sample success responses

XML format

<IsSuccess>true</IsSuccess>
<RequestId>B79F5E0E-8770-407D-BCB6-ECF4BA9CDC26</RequestId>
<TriggerId>crw-0z4pf81pgz35s5aa</TriggerId>
<Code>success</Code>

JSON format

{
    "IsSuccess":true,
    "RequestId":"B79F5E0E-8770-407D-BCB6-ECF4BA9CDC26",
    "TriggerId":"crw-0z4pf81pgz35s5aa",
    "Code":"success"
}

Error codes

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