All Products
Search
Document Center

CreateRepoWebhook

Last Updated: Jan 22, 2020

Description

You can call this operation to create a trigger for an image repository.

Request information

Request line

  1. PUT /repos/[RepoNamespace]/[RepoName]/webhooks HTTP/1.1

Request parameters

Parameter Type Required Description
RepoNamespace String Yes The namespace to which the image repository belongs.
RepoName String Yes The name of the image repository.

Custom request headers

None.

Request body

  1. Request Body:
  2. {
  3. "Webhook": {
  4. "WebhookName": "String" #Required.
  5. "WebhookUrl": "String" #Required.
  6. "TriggerType": "String" #Required. enumerate(ALL TAG_REG_EXP TAG_LIST),
  7. }
  8. }

Request body description

Parameter Type Required Description
WebhookName String Yes The name of the trigger.
WebhookUrl String Yes The URL of the trigger.
TriggerType String Yes The type of the trigger. You can choose to invoke the trigger by image version (TAG_LIST), regular expression (TAG_REG_EXP), or both (ALL).

Response information

Response line

  1. HTTP/1.1 200 OK

Custom response headers

None.

Response body

  1. {
  2. "data": {
  3. "webhookId": "String"
  4. },
  5. "requestId": "String"
  6. }

Examples

Sample requests

  1. PUT /repos/[RepoNamespace]/[RepoName]/webhooks HTTP/1.1
  2. <Common request headers>
  3. {
  4. "Webhook": {
  5. "WebhookName": "MyTrigger",
  6. "WebhookUrl": "https://www.****.com",
  7. "TriggerType": "ALL"
  8. }
  9. }

Sample responses

  1. HTTP/1.1 200 OK
  2. <Common response headers>
  3. {
  4. "data": {
  5. "webhookId": "39762"
  6. },
  7. "requestId": "3666F8EA-1468-4BEA-883B-FC60A651A609"
  8. }