Creates a 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-xkx6vujuhay0****

The ID of the Container Registry instance.

RegionId String Yes cn-shanghai

The ID of the region.

RepoId String Yes crr-xwvi3osiy4ff****

The ID of the repository.

TriggerName String Yes trigger1

The name of the trigger that you want to create.

TriggerTag String Yes [1]

The image tag based on which the trigger is set.

Note
  • If TriggerType is set to ALL, TriggerTag can be set to a string or array, for example, *.
  • If TriggerType is set to TAG_LIST, TriggerTag must be set to an array, for example, [1].
  • If TriggerType is set to TAG_REG_EXP, TriggerTag must be set to a string, for example, *.
TriggerType String Yes ALL

The type of the trigger. Valid values:

  • ALL: a trigger that supports both tags and regular expressions.
  • TAG_LIST: a tag trigger.
  • TAG_REG_EXP: a regular expression trigger.
TriggerUrl String Yes http://www.mysite.com

The URL of the trigger.

Response parameters

Parameter Type Example Description
Code String success

The return value.

IsSuccess Boolean true

Indicates whether the API call is successful.

RequestId String B79F5E0E-8770-407D-BCB6-ECF4BA9C****

The ID of the request.

TriggerId String crw-0z4pf81pgz35****

The ID of the trigger.

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateRepoTrigger
&InstanceId=cri-xkx6vujuhay0****
&RegionId=cn-shanghai
&RepoId=crr-xwvi3osiy4ff****
&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-ECF4BA9C****</RequestId>
<TriggerId>crw-0z4pf81pgz35****</TriggerId>
<Code>success</Code>

JSON format

{
    "IsSuccess": true,
    "RequestId": "B79F5E0E-8770-407D-BCB6-ECF4BA9C****",
    "TriggerId": "crw-0z4pf81pgz35****",
    "Code": "success"
}

Error codes

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