Octri

webhooks create

添加一个 webhook,将你选择的事件发送到指定地址。它会输出 webhook 的签名密钥,你可以用它来验证投递。密钥只显示一次,请立即保存。

bash
octri webhooks create <url> --events <events> [--type <type>] [--label <label>]

参数

<url>string必填

投递目标地址。必须是 https。

标志

--events <events>list必填

以逗号分隔的事件名称,取自 octri webhooks events;或使用 all 表示全部事件。

--type <type>string默认值:generic

投递内容的格式。

值含义
generic签名的 JSON 正文,适用于你自己的端点
slackSlack 消息,适用于 Slack incoming webhook
discordDiscord 消息,适用于 Discord webhook
--label <label>string默认值:the address's hostname

用于区分 webhook 的名称。

--disableboolean

创建时将其设为关闭状态。

示例

将规范和 SDK 事件发送到你的端点

bash
octri webhooks create https://hooks.acme.com/octri --events spec.ingested,sdk.published --label Acme
Output
✔ Creating webhook Acme
✔ Webhook Acme created 6aedf2582a01dd8b2cad73b5
  signing secret  09181ad996c569edb6e65b17389507f04d21706aec3bb6f78b00b600adc3fa7a
▲ Store the signing secret now. It is not shown again.