All Products
Search
Document Center

:CreateRepoWebhook

Last Updated:Aug 31, 2022

Creates a trigger for an image repository.

Request information

Request line

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

Request line parameters

Parameter

Type

Required

Description

RepoNamespace

String

Yes

The namespace to which the repository belongs.

RepoName

String

Yes

The name of the repository.

Operation-specific request headers

None.

Request body

Request Body:
{
    "Webhook": {
        "WebhookName": "String"  //This parameter is required.
        "WebhookUrl": "String"  //This parameter is required.
        "TriggerType": "String"  //This parameter is required. Valid values: ALL, TAG_REG_EXP, and TAG_LIST.
    }
}

Request body parameters

Parameter

Type

Required

Description

WebhookName

String

Yes

The name of the trigger.

WebhookUrl

String

Yes

The URL of the trigger when an image is pushed to the repository.

TriggerType

String

Yes

The type of trigger. Valid values: ALL, TAG_REG_EXP, and TAG_LIST. The trigger type determines whether the trigger is invoked by the image version (TAG_LIST), regular expression (TAG_REG_EXP), or both (ALL), of the image that is pushed to the repository.

Response information

Response line

HTTP/1.1 200 OK

Operation-specific response headers

None.

Response body

{
    "data": {
        "webhookId": "String"
    },
    "requestId": "String"
}

Examples

Sample requests

PUT /repos/[RepoNamespace]/[RepoName]/webhooks HTTP/1.1
<Common request headers>
{
    "Webhook": {
        "WebhookName": "MyTrigger",
        "WebhookUrl": "https://www. ****.com",
        "TriggerType": "ALL"
    }
}

Sample responses

HTTP/1.1 200 OK
<Common response headers>
{
    "data": {
        "webhookId": "39762"
    },
    "requestId": "3666F8EA-1468-4BEA-883B-FC60A651A609"
}