Creates an image trigger 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
Action String Yes CreateRepoTrigger

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

InstanceId String Yes cri-xkx6vujuhay0tp12

The ID of the instance.

RegionId String Yes cn-shanghai

The ID of the region where the instance resides.

RepoId String Yes crr-xwvi3osiy4ffoqwe

The ID of the image repository.

TriggerName String Yes trigger1

The name of the trigger.

TriggerTag String Yes 1

The image tag that invokes the trigger.

TriggerType String Yes ALL

The type of expression used to filter image tags that can invoke the trigger. Valid values: ALL, TAG_LIST, and TAG_REG_EXP.

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

The target URL of the trigger.

Response parameters

Parameter Type Example Description
IsSuccess Boolean true

Indicates whether the operation is successful.

Code String success

The code returned for the request.

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

The ID of the request.

TriggerId String crw-0z4pf81pgz35s5aa

The ID of the trigger.

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

JSON format

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

XML format

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

Error codes

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