This is an automated email from the ASF dual-hosted git repository.
mikexue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/eventmesh-site.git
The following commit(s) were added to refs/heads/master by this push:
new a3340017 [ISSUE #113] Optimize Webhook doc and add updateWebHookConfig
endpoint (#118)
a3340017 is described below
commit a3340017aa938f777d5b3b16784492124b665c04
Author: Pil0tXia <[email protected]>
AuthorDate: Mon Aug 28 10:25:11 2023 +0800
[ISSUE #113] Optimize Webhook doc and add updateWebHookConfig endpoint
(#118)
* Remove redundant zh doc files.
* Fix webhook zh doc not displayed (need translation)
* Optimize Webhook zh doc format and typos
* Optimize Webhook en doc
* Add updateWebHookConfig endpoint and optimize en titles
---
.../https.md => docs/design-document/14-https.md | 0
.../{14-webhook.md => 15-webhook.md} | 103 ++++++--
.../current/design-document/04-schema-registry.md | 134 +++++++++++
.../current/design-document/15-webhook.md | 249 +++++++++++--------
.../current/design-document/webhook.md | 268 ---------------------
5 files changed, 366 insertions(+), 388 deletions(-)
diff --git
a/i18n/zh/docusaurus-plugin-content-docs/current/design-document/https.md
b/docs/design-document/14-https.md
similarity index 100%
rename from
i18n/zh/docusaurus-plugin-content-docs/current/design-document/https.md
rename to docs/design-document/14-https.md
diff --git a/docs/design-document/14-webhook.md
b/docs/design-document/15-webhook.md
similarity index 66%
rename from docs/design-document/14-webhook.md
rename to docs/design-document/15-webhook.md
index eef57159..807b1a8a 100644
--- a/docs/design-document/14-webhook.md
+++ b/docs/design-document/15-webhook.md
@@ -1,13 +1,16 @@
+# Use Webhook to subscribe events
## Webhook usage process
-#### The first step: Configure webhook related information in eventmesh and
start
-##### Configuration
+### The first step: Configure Webhook related information in eventmesh and
start
+
+Configuration:
+
```
-# Whether to start the webhook admin service
+# Whether to start the Webhook admin service
eventMesh.webHook.admin.start=true
-# webhook event configuration storage mode. But currently only supports file
and nacos
+# Webhook event configuration storage mode. But currently only supports file
and nacos
eventMesh.webHook.operationMode=file
# The file path of fileMode. If you write #{eventMeshHome}, in the eventMesh
root directory
@@ -17,13 +20,13 @@ eventMesh.webHook.fileMode.filePath=
#{eventMeshHome}/webhook
## address of nacos
eventMesh.webHook.nacosMode.serverAddr=127.0.0.1:8848
-# webhook eventcloud send mode. Same as eventMesh.connector.plugin.type
configuration
+# Webhook CloudEvent sending mode. This property is the same as the
eventMesh.storage.plugin.type configuration.
eventMesh.webHook.producer.connector=standalone
```
-#### The second step: Add webhook configuration information
+### The second step: Add Webhook configuration information
-Configuration information description
+Configuration information description:
```java
/**
@@ -44,7 +47,7 @@ Configuration information description
private String manufacturerDomain;
/**
- * webhook event name, like rep-push
+ * Webhook event name, like rep-push
*/
private String manufacturerEventName;
@@ -92,10 +95,12 @@ Configuration information description
```
-##### Add WebHook config
+#### Add WebHook config
path: /webhook/insertWebHookConfig
+
method: POST
+
contentType: application/json
input params:
@@ -128,9 +133,12 @@ E.g:
Output params: 1 for success, 0 for failure
-##### Query WebHook config by callback path
+#### Query WebHook config by callback path
+
path: /webhook/queryWebHookConfigById
+
method: POST
+
contentType: application/json
input params:
@@ -165,10 +173,12 @@ Output params:
| cloudEventName | cloudEvent name | string | Y | null |
| cloudEventIdGenerateMode | cloudEvent event object identification method,
uuid or event id | string | N | manufacturerEventId |
+#### Query WebHook config by manufacturer
-##### Query WebHook config by manufacturer
path: /webhook/queryWebHookConfigByManufacturer
+
method: POST
+
contentType: application/json
input params:
@@ -179,7 +189,6 @@ input params:
| pageNum | page number of paging query | string | Y | null |
| pageSize | page size of each page | string | Y | null |
-
E.g:
```json
@@ -206,10 +215,50 @@ Output params:
| cloudEventName | cloudEvent name | string | Y | null |
| cloudEventIdGenerateMode | cloudEvent event object identification method,
uuid or event id | string | N | manufacturerEventId |
-##### Delete WebHook config
+#### Update WebHook config
+
+path: /webhook/updateWebHookConfig
+
+method: POST
+
+contentType: application/json
+
+input params:
+
+| field | desc
| type | necessary | default |
+| ------------------------ |
------------------------------------------------------------ | ------ |
--------- | ------------------- |
+| callbackPath | call address, unique address
| string | Y | null |
+| manufacturerName | manufacturer name
| string | Y | null |
+| manufacturerDomain | manufacturer domain name
| string | Y | null |
+| manufacturerEventName | manufacturer event name
| string | Y | null |
+| contentType | http connettype
| string | N | application/json |
+| description | configuration instructions
| string | N | null |
+| secret | signature string
| string | N | null |
+| userName | username
| string | N | null |
+| password | password
| string | N | null |
+| cloudEventName | cloudEvent name
| string | Y | null |
+| cloudEventIdGenerateMode | cloudEvent event object identification method,
uuid or event id | string | N | manufacturerEventId |
+
+E.g:
+
+```json
+{
+ "callbackPath":"/webhook/github/eventmesh/all",
+ "manufacturerName":"github",
+ "manufacturerDomain":"www.github.com",
+ "manufacturerEventName":"all",
+ "cloudEventName":"github-eventmesh"
+}
+```
+
+Output params: 1 for success, 0 for failure
+
+#### Delete WebHook config
path: /webhook/deleteWebHookConfig
+
method: POST
+
contentType: application/json
input params:
@@ -219,7 +268,6 @@ input params:
| callbackPath | call address, unique address | string | Y
| null |
| manufacturerName | the caller of this callbackPath belongs to | string | Y
| null |
-
E.g:
```json
@@ -231,19 +279,18 @@ E.g:
Output params: 1 for success, 0 for failure
-#### The third step: Check if the configuration is successful
-
-1. file storage mode. Please go to the eventMesh.webHook.fileMode.filePath
directory to view. filename callbackPath.
+### The third step: Check if the configuration is successful
-2. nacos storage mode. Please go to the nacos service configured by
eventMesh.webHook.nacosMode.serverAddr to see.
+1. file storage mode. Please go to the eventMesh.webHook.fileMode.filePath
directory to view. The Filename is callbackPath.
+2. nacos storage mode. Please go to the nacos service configured by
eventMesh.webHook.nacosMode.serverAddr to see this.
-#### The fourth step: Configure the consumer of cloudevent
+### The fourth step: Configure the consumer of cloudevent
-#### The fifth step: Configure webhook related information in the manufacturer
+### The fifth step: Configure Webhook related information in the manufacturer
-> For manufacturer's operation, please refer to [Manufacturer's webhook
operation instructions] .
+> For manufacturer's operation, please refer to [Manufacturer's Webhook
operation instructions](#Manufacturer's-Webhook-operation-instructions).
-## Manufacturer's webhook operation instructions
+## Manufacturer's Webhook operation instructions
### github sign up
@@ -257,17 +304,21 @@ Output params: 1 for success, 0 for failure

-#### The fourth step: Click on Add webhook
+#### The fourth step: Click on Add Webhook

-#### The fifth step: Fill in the webhook information
+#### The fifth step: Fill in the Webhook information

-Payload URL: Service address and pahts. [http or https]://[domain or
IP]:[port]/webhook/[callbackPath]
+Payload URL: EventMesh service address and callbackPath, which must include
the protocol header. For example, when the callback address `callbackPath` is
`/webhook/github/eventmesh/all`, the Payload URL is
`http://www.example.com:10105/webhook/github/eventmesh/all`.
+
+[http or https]://[domain or IP]:[port]/webhook/[callbackPath]
+
Content type: http header content type
-secret: signature string
+
+Secret: signature string
diff --git
a/i18n/zh/docusaurus-plugin-content-docs/current/design-document/04-schema-registry.md
b/i18n/zh/docusaurus-plugin-content-docs/current/design-document/04-schema-registry.md
new file mode 100644
index 00000000..7c5d2282
--- /dev/null
+++
b/i18n/zh/docusaurus-plugin-content-docs/current/design-document/04-schema-registry.md
@@ -0,0 +1,134 @@
+# EventMesh Schema Registry (OpenSchema)
+
+## Overview of Schema and Schema Registry
+
+### Schema
+
+A Schema stands for the description of serialization
instances(string/stream/file/...) and has two properties. First, it is also in
the format of serialization type. Second, it defines what requirements such
serialized instances should satisfy.
+
+Besides describing a serialization instance, a Schema may also be used for
validating whether an instance is legitimate. The reason is that it defines the
```type```(and other properties) of a serialized instance and inside keys.
Taking JSON Schema for example, it could not only be referred when describing a
JSON string, but also be used for validating whether a string satisfies
properties defined in the schema[[1]](#References).
+
+Commonly, there are JSON Schema, Protobuf Schema, and Avro Schema.
+
+### Schema Registry
+
+Schema Registry is a server provides RESTful interfaces. It could receive and
store Schemas from clients, as well as provide intrefaces for other clients to
retrieve Schemas from it.
+
+It could be applied to validation process and (de-)serialization process.
+
+### Comparison of Schema Registry in Different Projects
+
+Project | Application
+:---: | :---
+EMQ[[2]](#References) | Mainly in (de-)serialization process. Use "Schema
Registry" and "Rule Matching" to transfer a message from one serialization
format to another.
+Pulsar[[3]](#References) | Mainly in validation process. Use "Schema Registry"
to validate a message.
+Confluentinc[[4]](#References) | In both validation and (de-)serialization
process.
+
+## Overview of OpenSchema
+
+OpenSchema[[5]](#References) proposes a specification for data schema when
exchanging the message and event in more and more modern cloud-native
applications. It designs a RESTful interface for storing and retrieving such as
Avro, JSON Schema, and Protobuf3 schemas from three
aspects(subject/schema/compatibility).
+
+## Requirements(Goals)
+
+| Requirement ID | Requirement Description
| Comments |
+| :------------- |
------------------------------------------------------------ | ------------- |
+| F-1 | In transmission, no message needs to contain schema
information which bring efficiency. | Functionality |
+| F-2 | The message content from producer could be validated
whether serialized correctly according to schema. | Functionality |
+
+## Design Details
+
+### Architecture
+
+
+
+### Process of Transferring Messages under Schema Registry
+
+
+
+The highlevel process of messages transmission contains 10 steps as follows:
+
+- 1: Consumer subscribes "TOPIC" messages from EventMesh.
+- 2: Producer registers a schema to EventMesh.
+- 3: EventMesh registers a schema to Schema Registry.
+- 4: Schema Registry returns the id of newly created schema; EventMesh caches
such id and schema.
+- 5: EventMesh returns the id of schema to Producer.
+- 6: Producer patches the id in front of messages and send messages to
EventMesh.
+- 7: EventMesh validates the messages in the entry port and send it to
EventStore; EventMesh retrieves messages from EventStore.
+- 8: EventMesh unpatches the id and send it to Schema Registry(if such `<id,
schema>` does not exists in local cache).
+- 9: Schema Registry returns schema and EventMesh caches it.
+- 10: EventMesh patches schema in front of messages and push it to consumer.
+
+## Current Progress
+
+### Status
+
+**Current state**: Developing
+
+**Discussion thread**: ISSUE #339
+
+### Proposed Changes
+
+The proposal has two aspects.
+
+First is a separated Open Schema Registry, which includes storage and
compatibility check for schema.
+This proposal is under developing.
+
+Second is the integration of Open Schema in Eventmesh, which includes
validation for schema. This proposal is to be developed.
+
+As for the first proposal, some developing statuses are as follows.
+
+#### Status Code and Exception Code
+
+No. | Status Code | Exception Code | Description | status
+--- | :---: | :---: | :---: | :---:
+1 | 401 | 40101 | Unauthorized Exception | ✔
+2 | 404 | 40401 | Schema Non- Exception | ✔
+3 | ^ | 40402 | Subject Non-exist Exception | ✔
+4 | ^ | 40403 | Version Non-exist Exception | ✔
+5 | 409 | 40901 | Compatibility Exception | ✔
+6 | 422 | 42201 | Schema Format Exception | ✔
+7 | ^ | 42202 | Subject Format Exception | ✔
+8 | ^ | 42203 | Version Format Exception | ✔
+9 | ^ | 42204 | Compatibility Format Exception | ✔
+10 | 500 | 50001 | Storage Service Exception | ✔
+11 | ^ | 50002 | Timeout Exception | ✔
+
+#### API Development Status
+
+No. | Type | URL | response | exception | code | test
+--- | --- | --- | --- | --- | --- | ---
+1 | GET | /schemas/ids/{string: id} | `Schema.class` | 40101\40401\50001 | ✔ |
❌
+2 | GET | /schemas/ids/{string: id}/subjects | `SubjectAndVersion.class` |
40101\40401\50001 | ✔ | ❌
+3 | GET | /subjects | `List\<String>` | 40101\50001 | ✔ | ❌
+4 | GET | /subjects/{string: subject}/versions | `List\<Integer>` |
40101\40402\50001 | ✔ | ❌
+5 | DELETE | /subjects/(string: subject) | `List\<Integer>` |
40101\40402\50001 | ✔ | ❌
+6 | GET | /subjects/(string: subject) | `Subject.class` | 40101\40402\50001 |
✔ | ❌
+7 | GET | /subjects/(string: subject)/versions/(version: version)/schema |
`SubjectWithSchema.class` | 40101\40402\40403\50001 | ✔ | ❌
+8 | POST | /subjects/(string: subject)/versions | `SchemaIdResponse.class` |
40101\40901\42201\50001\50002 | - | ❌
+9 | POST | /subjects/(string: subject)/ | `Subject.class` |
40101\40901\42202\50001\50002 | ✔ | ❌
+10 | DELETE | /subjects/(string: subject)/versions/(version: version) | `int`
| 40101\40402\40403\40901\50001| - | ❌
+11 | POST | /compatibility/subjects/(string: subject)/versions/(version:
version) | `CompatibilityResultResponse.class` |
40101\40402\40403\42201\42203\50001| - | ❌
+12 | GET | /compatibility/(string: subject) | `Compatibility.class` |
40101\40402\50001 | ✔ | ❌
+13 | PUT | /compatibility/(string: subject) | `Compatibility.class` |
40101\40402\40901\42204\50001 | - | ❌
+
+#### Overall Project Structure
+
+```SchemaController.java```+```SchemaService.java``` : ```OpenSchema
7.1.1~7.1.2 (API 1~2)```
+
+```SubjectController.java```+```SubjectService.java``` : ```OpenSchema
7.2.1~7.2.8 (API 3~10)```
+
+```CompatibilityController.java```+```CompatibilityService.java``` :
```OpenSchema 7.3.1~7.3.3 (API 11~13)``` + ```Check for Compatibility```
+
+
+
+## References
+
+[1] [schema validator
(github.com)](https://github.com/search?q=schema+validator)
+
+[2] [EMQ: Schema Registry](https://www.jianshu.com/p/33e0655c642b)
+
+[3] [Pulsar: Schema
Registry](https://mp.weixin.qq.com/s/PaB66-Si00cX80py5ig5Mw)
+
+[4]
[confluentinc/schema-registry](https://github.com/confluentinc/schema-registry)
+
+[5] [openmessaging/openschema](https://github.com/openmessaging/openschema)
diff --git
a/i18n/zh/docusaurus-plugin-content-docs/current/design-document/15-webhook.md
b/i18n/zh/docusaurus-plugin-content-docs/current/design-document/15-webhook.md
index 6961725f..6d94efdf 100644
---
a/i18n/zh/docusaurus-plugin-content-docs/current/design-document/15-webhook.md
+++
b/i18n/zh/docusaurus-plugin-content-docs/current/design-document/15-webhook.md
@@ -1,14 +1,16 @@
+# 使用 Webhook 订阅事件
+## Webhook 使用流程
-## webhook使用流程
-#### 第一步:在eventmesh配置webhook相关信息并且启动
+### 第一步:在 eventmesh 配置 Webhook 相关信息并且启动
+
+配置说明:
-##### 配置说明
```
-# 是否启动webhook admin服务
+# 是否启动Webhook admin服务
eventMesh.webHook.admin.start=true
-# webhook事件配置存储模式。目前只支持file与nacos
+# Webhook事件配置存储模式。目前只支持file与nacos
eventMesh.webHook.operationMode=file
# 文件存储模式的文件存放路径,如果写上#{eventMeshHome},在eventMesh根目录
eventMesh.webHook.fileMode.filePath= #{eventMeshHome}/webhook
@@ -17,16 +19,18 @@ eventMesh.webHook.fileMode.filePath=
#{eventMeshHome}/webhook
## nacos的地址
eventMesh.webHook.nacosMode.serverAddr=127.0.0.1:8848
-# webhook eventcloud 发送模式。与eventMesh.connector.plugin.type 配置一样
+# Webhook CloudEvent 发送模式。与 eventMesh.connector.plugin.type 配置一样
eventMesh.webHook.producer.connector=standalone
```
-#### 第二步:添加webhook配置信息
-配置信息说明
+### 第二步:添加 Webhook 配置信息
+
+配置信息说明:
+
```java
/**
- * 厂商调用的path。厂商事件调用地址、 [http or https ]://[域名 or IP
【厂商可以被调用】]:[端口]/webhook/[callbackPath]
- * 比如:http://127.0.0.1:10504/webhook/test/event 需要把完整url填入callbackPath中
+ * 厂商发送事件时调用的地址。[http or https]://[domain or
IP]:[port]/webhook/[callbackPath]
+ * 在厂商的Webhook配置中需要填写完整url,比如:http://127.0.0.1:10504/webhook/test/event
* callbackPath 唯一
* manufacturer callback path
*/
@@ -46,7 +50,7 @@ eventMesh.webHook.producer.connector=standalone
/**
* 厂商的事件名
- * webhook event name ,like rep-push
+ * Webhook event name ,like rep-push
*/
private String manufacturerEventName;
@@ -83,7 +87,7 @@ eventMesh.webHook.producer.connector=standalone
/**
- * 事件发送到那个topic
+ * 事件发送到那个 topic
* roll out event name ,like topic to mq
*/
private String cloudEventName;
@@ -95,34 +99,39 @@ eventMesh.webHook.producer.connector=standalone
private String dataContentType = "application/json";
/**
- * cloudEvent事件对象唯一标识符识别方式,uuid或者manufacturerEventId(厂商id)
+ * cloudEvent 事件对象唯一标识符识别方式,uuid 或者 manufacturerEventId(厂商 id)
* id of cloudEvent ,like uuid/manufacturerEventId
*/
private String cloudEventIdGenerateMode;
```
-##### 添加接口
+#### 添加接口
+
路径: /webhook/insertWebHookConfig
-方法: POST
+
+方法:POST
+
contentType: application/json
输入参数:
-| 字段 | 说明 | 类型 | 必须 | 默认值 |
+
+| 字段 | 说明 | 类型 | 必须 | 默认值 |
| -- | -- | -- | -- | -- |
-| callbackPath | 调用地址,唯一地址 | string | 是 | null |
-| manufacturerName | 厂商名 | string | 是 | null |
-| manufacturerDomain | 厂商的域名 | string | 是 | null |
-| manufacturerEventName | 厂商事件名 | string | 是 | null |
-| contentType | http connettype | string | 否 | application/json |
-| description | 配置说明 | string | 否 | null |
-| secret | 验签密钥 | string | 否 | null |
-| userName | 用户名 | string | 否 | null |
-| password | 用户密码 | string | 否 | null |
-| cloudEventName | 事件名 | string | 是 | null |
-| cloudEventIdGenerateMode |
cloudEvent事件对象唯一标识符识别方式,uuid或者manufacturerEventId(厂商id) | string | 否 |
manufacturerEventId |
-
-列子:
+| callbackPath | 调用地址,唯一地址 | string | 是 | null |
+| manufacturerName | 厂商名 | string | 是 | null |
+| manufacturerDomain | 厂商的域名 | string | 是 | null |
+| manufacturerEventName | 厂商事件名 | string | 是 | null |
+| contentType | http connettype | string | 否 | application/json |
+| description | 配置说明 | string | 否 | null |
+| secret | 验签密钥 | string | 否 | null |
+| userName | 用户名 | string | 否 | null |
+| password | 用户密码 | string | 否 | null |
+| cloudEventName | 事件名 | string | 是 | null |
+| cloudEventIdGenerateMode | cloudEvent 事件对象唯一标识符识别方式,uuid 或者
manufacturerEventId(厂商 id) | string | 否 | manufacturerEventId |
+
+例子:
+
```json
{
"callbackPath":"/webhook/github/eventmesh/all",
@@ -132,21 +141,24 @@ contentType: application/json
"cloudEventName":"github-eventmesh"
}
```
-输出参数:1 成功,0失败
-##### 通过callbackPath查询WebHookConfig
+输出参数:1 成功,0 失败
+
+#### 通过 callbackPath 查询 WebHookConfig
+
路径: /webhook/queryWebHookConfigById
-方法: POST
+
+方法:POST
+
contentType: application/json
输入参数:
-| 字段 | 说明 | 类型 | 必须 | 默认值 |
+| 字段 | 说明 | 类型 | 必须 | 默认值 |
| -- | -- | -- | -- | -- |
-| callbackPath | 调用地址,唯一地址 | string | 是 | null |
-| manufacturerName | 调用地址的提供方 | string | 是 | null |
-
+| callbackPath | 调用地址,唯一地址 | string | 是 | null |
+| manufacturerName | 调用地址的提供方 | string | 是 | null |
-列子:
+例子:
```json
{
@@ -155,37 +167,39 @@ contentType: application/json
}
```
-
输出参数:
-| 字段 | 说明 | 类型 | 必须 | 默认值 |
+
+| 字段 | 说明 | 类型 | 必须 | 默认值 |
| -- | -- | -- | -- | -- |
-| callbackPath | 调用地址,唯一地址 | string | 是 | null |
-| manufacturerName | 厂商名 | string | 是 | null |
-| manufacturerDomain | 厂商的域名 | string | 是 | null |
-| manufacturerEventName | 厂商事件名 | string | 是 | null |
-| contentType | http connettype | string | 否 | application/json |
-| description | 配置说明 | string | 否 | null |
-| secret | 验签密钥 | string | 否 | null |
-| userName | 用户名 | string | 否 | null |
-| password | 用户密码 | string | 否 | null |
-| cloudEventName | 事件名() | string | 是 | null |
-| cloudEventIdGenerateMode |
cloudEvent事件对象唯一标识符识别方式,uuid或者manufacturerEventId(厂商id) | string | 否 |
manufacturerEventId |
-
-
-##### 通过manufacturer查询WebHookConfig列表
+| callbackPath | 调用地址,唯一地址 | string | 是 | null |
+| manufacturerName | 厂商名 | string | 是 | null |
+| manufacturerDomain | 厂商的域名 | string | 是 | null |
+| manufacturerEventName | 厂商事件名 | string | 是 | null |
+| contentType | http connettype | string | 否 | application/json |
+| description | 配置说明 | string | 否 | null |
+| secret | 验签密钥 | string | 否 | null |
+| userName | 用户名 | string | 否 | null |
+| password | 用户密码 | string | 否 | null |
+| cloudEventName | 事件名() | string | 是 | null |
+| cloudEventIdGenerateMode | cloudEvent 事件对象唯一标识符识别方式,uuid 或者
manufacturerEventId(厂商 id) | string | 否 | manufacturerEventId |
+
+#### 通过 manufacturer 查询 WebHookConfig 列表
+
路径: /webhook/queryWebHookConfigByManufacturer
-方法: POST
+
+方法:POST
+
contentType: application/json
输入参数:
-| 字段 | 说明 | 类型 | 必须 | 默认值 |
-| -- | -- | -- | -- | -- |
-| manufacturerName | 厂商名 | string | 是 | null |
-| pageNum | 分页查询中的页数 | string | 是 | null |
-| pageSize | 每一页的结果数量 | string | 是 | null |
+| 字段 | 说明 | 类型 | 必须 | 默认值 |
+| -- | -- | -- | -- | -- |
+| manufacturerName | 厂商名 | string | 是 | null |
+| pageNum | 分页查询中的页数 | string | 是 | null |
+| pageSize | 每一页的结果数量 | string | 是 | null |
-列子:
+例子:
```json
{
@@ -195,26 +209,66 @@ contentType: application/json
}
```
-
输出参数:
-| 字段 | 说明 | 类型 | 必须 | 默认值 |
+
+| 字段 | 说明 | 类型 | 必须 | 默认值 |
| -- | -- | -- | -- | -- |
-| callbackPath | 调用地址,唯一地址 | string | 是 | null |
-| manufacturerName | 厂商名 | string | 是 | null |
-| manufacturerDomain | 厂商的域名 | string | 是 | null |
-| manufacturerEventName | 厂商事件名 | string | 是 | null |
-| contentType | http connettype | string | 否 | application/json |
-| description | 配置说明 | string | 否 | null |
-| secret | 验签密钥 | string | 否 | null |
-| userName | 用户名 | string | 否 | null |
-| password | 用户密码 | string | 否 | null |
-| cloudEventName | 事件名() | string | 是 | null |
-| cloudEventIdGenerateMode |
cloudEvent事件对象唯一标识符识别方式,uuid或者manufacturerEventId(厂商id) | string | 否 |
manufacturerEventId |
-
-##### 删除接口
+| callbackPath | 调用地址,唯一地址 | string | 是 | null |
+| manufacturerName | 厂商名 | string | 是 | null |
+| manufacturerDomain | 厂商的域名 | string | 是 | null |
+| manufacturerEventName | 厂商事件名 | string | 是 | null |
+| contentType | http connettype | string | 否 | application/json |
+| description | 配置说明 | string | 否 | null |
+| secret | 验签密钥 | string | 否 | null |
+| userName | 用户名 | string | 否 | null |
+| password | 用户密码 | string | 否 | null |
+| cloudEventName | 事件名() | string | 是 | null |
+| cloudEventIdGenerateMode | cloudEvent 事件对象唯一标识符识别方式,uuid 或者
manufacturerEventId(厂商 id) | string | 否 | manufacturerEventId |
+
+#### 更新接口
+
+路径: /webhook/updateWebHookConfig
+
+方法:POST
+
+contentType: application/json
+
+输入参数:
+
+| 字段 | 说明
| 类型 | 必须 | 默认值 |
+| ------------------------ |
------------------------------------------------------------ | ------ | ---- |
------------------- |
+| callbackPath | 调用地址,唯一地址
| string | 是 | null |
+| manufacturerName | 厂商名
| string | 是 | null |
+| manufacturerDomain | 厂商的域名
| string | 是 | null |
+| manufacturerEventName | 厂商事件名
| string | 是 | null |
+| contentType | http connettype
| string | 否 | application/json |
+| description | 配置说明
| string | 否 | null |
+| secret | 验签密钥
| string | 否 | null |
+| userName | 用户名
| string | 否 | null |
+| password | 用户密码
| string | 否 | null |
+| cloudEventName | 事件名
| string | 是 | null |
+| cloudEventIdGenerateMode | cloudEvent 事件对象唯一标识符识别方式,uuid 或者
manufacturerEventId(厂商 id) | string | 否 | manufacturerEventId |
+
+例子:
+
+```json
+{
+ "callbackPath":"/webhook/github/eventmesh/all",
+ "manufacturerName":"github",
+ "manufacturerDomain":"www.github.com",
+ "manufacturerEventName":"all",
+ "cloudEventName":"github-eventmesh"
+}
+```
+
+输出参数:1 成功,0 失败
+
+#### 删除接口
路径: /webhook/deleteWebHookConfig
-方法: POST
+
+方法:POST
+
contentType: application/json
输入参数:
@@ -224,8 +278,7 @@ contentType: application/json
| callbackPath | 调用地址,唯一地址 | string | 是 | null |
| manufacturerName | 调用地址的提供方 | string | 是 | null |
-
-列子:
+例子:
```json
{
@@ -234,36 +287,44 @@ contentType: application/json
}
```
+输出参数:1 成功,0 失败
-输出参数:1 成功,0失败
+### 第三步:查看配置是否成功
-#### 第三步:查看配置是否成功
+1. file 存储模式。请到 eventMesh.webHook.fileMode.filePath 目录下查看。文件名为`/`转换为`.`的
callbackPath。
+2. nacos 存储模式。请到 eventMesh.webHook.nacosMode.serverAddr 配置的 nacos 服务中查看。
-1. file存储模式。请到eventMesh.webHook.fileMode.filePath 目录下查看。文件名为callbackPath转移后的
-2. nacos存储模式。请到eventMesh.webHook.nacosMode.serverAddr 配置的nacos服务去看
+### 第四步:配置 cloudevent 的消费者
-#### 第四步:配置cloudevent的消费者
+### 第五步:在厂商配置 Webhook 相关信息
-#### 第五步:在厂商配置webhook相关信息
-> 厂商操作请看【厂商webhook操作说明】
+> 厂商操作请看[厂商 Webhook 操作说明](#厂商-Webhook-操作说明)
+## 厂商 Webhook 操作说明
-## 厂商webhook操作说明
### github 注册
+
#### 第一步:进入对应的项目
-#### 第二步:点击setting
+
+#### 第二步:点击 setting
+

-#### 第三步:点击Webhooks
+
+#### 第三步:点击 Webhooks
+

-#### 第四步:点击 Add webhook
+
+#### 第四步:点击 Add Webhook
+

-#### 第五步: 填写webhook信息
-
-Payload URL: 服务地址以及pahts。[http or https ]://[域名 or IP
【厂商可以被调用】]:[端口]/webhook/[callbackPath]
-Content type:http header content type
-secret: 验签字符串
+#### 第五步: 填写 Webhook 信息
+
+
+Payload URL: EventMesh 服务地址和调用地址,需包含协议头。例如,当调用地址 `callbackPath` 为
`/webhook/github/eventmesh/all` 时,Payload URL 为
`http://www.example.com:10105/webhook/github/eventmesh/all`
+Content Type: http header content type
+Secret: 验签字符串
diff --git
a/i18n/zh/docusaurus-plugin-content-docs/current/design-document/webhook.md
b/i18n/zh/docusaurus-plugin-content-docs/current/design-document/webhook.md
deleted file mode 100644
index d526177c..00000000
--- a/i18n/zh/docusaurus-plugin-content-docs/current/design-document/webhook.md
+++ /dev/null
@@ -1,268 +0,0 @@
-
-
-## webhook使用流程
-#### 第一步:在eventmesh配置webhook相关信息并且启动
-
-##### 配置说明
-```
-# 是否启动webhook admin服务
-eventMesh.webHook.admin.start=true
-
-# webhook事件配置存储模式。目前只支持file与nacos
-eventMesh.webHook.operationMode=file
-# 文件存储模式的文件存放路径,如果写上#{eventMeshHome},在eventMesh根目录
-eventMesh.webHook.fileMode.filePath= #{eventMeshHome}/webhook
-
-# nacos存储模式,配置命名规则是eventMesh.webHook.nacosMode.{nacos 原生配置key} 具体的配置请看 [nacos
github
api](https://github.com/alibaba/nacos/blob/develop/api/src/main/java/com/alibaba/nacos/api/SystemPropertyKeyConst.java)
-## nacos的地址
-eventMesh.webHook.nacosMode.serverAddr=127.0.0.1:8848
-
-# webhook eventcloud 发送模式。与eventMesh.connector.plugin.type 配置一样
-eventMesh.webHook.producer.connector=standalone
-```
-
-#### 第二步:添加webhook配置信息
-配置信息说明
-```java
- /**
- * 厂商调用的path。厂商事件调用地址、 [http or https ]://[域名 or IP
【厂商可以被调用】]:[端口]/webhook/[callbackPath]
- * 比如:http://127.0.0.1:10504/webhook/test/event 需要把全完url填入厂商调用输入中
- * callbackPath 是唯一
- * manufacturer callback path
- */
- private String callbackPath;
-
- /**
- * 厂商的名字
- * manufacturer name ,like github
- */
- private String manufacturerName;
-
- /**
- * 厂商的事件名
- * webhook event name ,like rep-push
- */
- private String manufacturerEventName;
-
- /**
- *
- * http header content type
- */
- private String contentType = "application/json";
-
- /**
- * 说明
- * description of this WebHookConfig
- */
- private String description;
-
- /**
- * 有一些厂商使用验签方式,
- * secret key ,for authentication
- */
- private String secret;
-
- /**
- * 有一些厂商使用验签方式,使用账户密码方式
- * userName ,for HTTP authentication
- */
- private String userName;
-
- /**
- * 有一些厂商使用验签方式,使用账户密码方式
- * password ,for HTTP authentication
- */
- private String password;
-
-
-
- /**
- * 事件发送到那个topic
- * roll out event name ,like topic to mq
- */
- private String cloudEventName;
-
- /**
- * roll out data format -> CloudEvent serialization mode
- * If HTTP protocol is used, the request header contentType needs to be
marked
- */
- private String dataContentType = "application/json";;
-
- /**
- * source of event
- */
- private String cloudEventSource;
-
- /**
- * cloudEvent事件对象唯一标识符识别方式,uuid或者manufacturerEventId(厂商id)
- * id of cloudEvent ,like uuid/manufacturerEventId
- */
- private String cloudEventIdGenerateMode;
-
-```
-
-##### 添加接口
-路径: /webhook/insertWebHookConfig
-方法: POST
-contentType: application/json
-
-输入参数:
-| 字段 | 说明 | 类型 | 必须 | 默认值 |
-| -- | -- | -- | -- | -- |
-| callbackPath | 调用地址,唯一地址 | string | 是 | null |
-| manufacturerName | 厂商名 | string | 是 | null |
-| manufacturerEventName | 厂商事件名 | string | 是 | null |
-| contentType | http connettype | string | 否 | application/json |
-| description | 配置说明 | string | 否 | null |
-| secret | 验签密钥 | string | 否 | null |
-| userName | 用户名 | string | 否 | null |
-| password | 用户密码 | string | 否 | null |
-| cloudEventName | 事件名() | string | 是 | null |
-| cloudEventSource | 事件来源可以填写 | string | 是 | null |
-| cloudEventIdGenerateMode |
cloudEvent事件对象唯一标识符识别方式,uuid或者manufacturerEventId(厂商id) | string | 否 |
manufacturerEventId |
-
-列子:
-```json
-
-{
- "callbackPath":"/webhook/github/eventmesh/all",
- "manufacturerName":"github",
- "manufacturerEventName":"all",
- "secret":"eventmesh",
- "cloudEventName":"github-eventmesh",
- "cloudEventSource":"github"
-}
-
-```
-输出参数:1 成功,0失败
-
-##### 删除接口
-路径: /webhook/deleteWebHookConfig
-方法: POST
-contentType: application/json
-
-输入参数:
-| 字段 | 说明 | 类型 | 必须 | 默认值 |
-| -- | -- | -- | -- | -- |
-| callbackPath | 调用地址,唯一地址 | string | 是 | null |
-
-
-列子:
-
-```json
-
-{
- "callbackPath":"/webhook/github/eventmesh/all"
-}
-
-```
-
-
-输出参数:1 成功,0失败
-
-##### 通过callbackPath查询WebHookConfig
-路径: /webhook/queryWebHookConfigById
-方法: POST
-contentType: application/json
-
-输入参数:
-| 字段 | 说明 | 类型 | 必须 | 默认值 |
-| -- | -- | -- | -- | -- |
-| callbackPath | 调用地址,唯一地址 | string | 是 | null |
-
-
-列子:
-
-```json
-
-{
- "callbackPath":"/webhook/github/eventmesh/all"
-}
-
-```
-
-
-输出参数:
-| 字段 | 说明 | 类型 | 必须 | 默认值 |
-| -- | -- | -- | -- | -- |
-| callbackPath | 调用地址,唯一地址 | string | 是 | null |
-| manufacturerName | 厂商名 | string | 是 | null |
-| manufacturerEventName | 厂商事件名 | string | 是 | null |
-| contentType | http connettype | string | 否 | application/json |
-| description | 配置说明 | string | 否 | null |
-| secret | 验签密钥 | string | 否 | null |
-| userName | 用户名 | string | 否 | null |
-| password | 用户密码 | string | 否 | null |
-| cloudEventName | 事件名() | string | 是 | null |
-| cloudEventSource | 事件来源可以填写 | string | 是 | null |
-| cloudEventIdGenerateMode |
cloudEvent事件对象唯一标识符识别方式,uuid或者manufacturerEventId(厂商id) | string | 否 |
manufacturerEventId |
-
-
-##### 通过manufacturer查询WebHookConfig列表
-路径: /webhook/queryWebHookConfigByManufacturer
-方法: POST
-contentType: application/json
-
-输入参数:
-| 字段 | 说明 | 类型 | 必须 | 默认值 |
-| -- | -- | -- | -- | -- |
-| manufacturerName | 厂商名 | string | 是 | null |
-
-
-列子:
-
-```json
-
-{
- "manufacturerName":"github"
-}
-
-```
-
-
-输出参数:
-| 字段 | 说明 | 类型 | 必须 | 默认值 |
-| -- | -- | -- | -- | -- |
-| callbackPath | 调用地址,唯一地址 | string | 是 | null |
-| manufacturerName | 厂商名 | string | 是 | null |
-| manufacturerEventName | 厂商事件名 | string | 是 | null |
-| contentType | http connettype | string | 否 | application/json |
-| description | 配置说明 | string | 否 | null |
-| secret | 验签密钥 | string | 否 | null |
-| userName | 用户名 | string | 否 | null |
-| password | 用户密码 | string | 否 | null |
-| cloudEventName | 事件名() | string | 是 | null |
-| cloudEventSource | 事件来源可以填写 | string | 是 | null |
-| cloudEventIdGenerateMode |
cloudEvent事件对象唯一标识符识别方式,uuid或者manufacturerEventId(厂商id) | string | 否 |
manufacturerEventId |
-
-
-#### 第三步:查看配置是否成功
-1. file存储模式。请到eventMesh.webHook.fileMode.filePath 目录下查看。文件名为callbackPath转移后的
-2. nacos存储模式。请到eventMesh.webHook.nacosMode.serverAddr 配置的nacos服务去看
-
-#### 第四步:配置cloudevent的消费者
-
-
-#### 第五步:在厂商配置webhook相关信息
-> 厂商操作请看【厂商webhook操作说明】
-
-
-## 厂商webhook操作说明
-### github 注册
-#### 第一步:进入对应的项目
-#### 第二步:点击setting
-
-#### 第三步:点击Webhooks
-
-#### 第四步:点击 Add webhook
-
-#### 第五步: 填写webhook信息
-
-
-Payload URL: 服务地址以及pahts。[http or https ]://[域名 or IP
【厂商可以被调用】]:[端口]/webhook/[callbackPath]
-Content type:http header content type
-secret: 验签字符串
-
-
-
-
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]