未验证 提交 7b0b4c12 编写于 作者: T Tq 提交者: GitHub

[Bug] [Website-9764]add http alert doc and change body param to unnecessary (#9792)

* add http alert doc and change body param to unnecessary

* submit http en doc and fix doc

* fix http doc
上级 d2fe85d7
......@@ -245,6 +245,11 @@ export default {
title: 'Script',
link: '/en-us/docs/dev/user_doc/guide/alert/script.html',
},
,
{
title: 'Http',
link: '/en-us/docs/dev/user_doc/guide/alert/http.html',
},
],
},
{
......@@ -567,6 +572,10 @@ export default {
title: '脚本告警',
link: '/zh-cn/docs/dev/user_doc/guide/alert/script.html',
},
{
title: 'Http告警',
link: '/zh-cn/docs/dev/user_doc/guide/alert/http.html',
},
],
},
{
......
# HTTP
If you need to use `Http script` for alerting, create an alert instance in the alert instance management and select the `Http` plugin.
## Parameter Configuration
* URL
> The `Http` request URL needs to contain protocol, host, path and parameters if the method is `GET`
* Request Type
> Select the request type from `POST` or `GET`
* Headers
> The headers of the `Http` request in JSON format
* Body
> The request body of the `Http` request in JSON format, when using `POST` method to alert
* Content Field
> The field name to place the alert information
## Send Type
Using `POST` and `GET` method to send `Http` request in the `Request Type`.
### GET Http
Send alert information by `Http` GET method.
The following shows the `GET` configuration example:
![enterprise-wechat-app-msg-config](/img/alert/http-get-example.png)
### POST Http
Send alert information inside `Http` body by `Http` POST method.
The following shows the `POST` configuration example:
![enterprise-wechat-app-msg-config](/img/alert/http-post-example.png)
\ No newline at end of file
# HTTP告警
如果您需要使用到`Http`(GET或POST)进行告警,请在告警实例管理里创建告警实例,选择`Http`插件。
## 参数配置
* URL
> 访问的`Http`连接URL,需要包含协议、Host、路径,如果是GET方法可以添加参数
* 请求方式
> 选择该请求为POST或GET方法
* 请求头
> `Http`请求的完整请求头,以JSON为格式
* 请求体
> `Http`请求的完整请求体,以JSON为格式,GET方法不需要写该参数
* 内容字段
> 放置本次告警告警信息的字段名称
## 发送类型
其中`Request Type`分别对应使用`POST`方法和`GET`方法进行`Http`告警。
### GET Http告警
GET `Http`告警指将告警结果作为参数通过`Http` GET方法进行请求。
下图是GET告警配置的示例:
![enterprise-wechat-app-msg-config](/img/alert/http-get-example.png)
### POST Http告警
POST `Http`告警指将告警结果作为`BODY`参数通过`Http`POST方法进行请求。
下图是POST告警配置的示例:
![enterprise-wechat-app-msg-config](/img/alert/http-post-example.png)
......@@ -55,7 +55,7 @@ public final class HttpAlertChannelFactory implements AlertChannelFactory {
InputParam bodyParams = InputParam.newBuilder(HttpAlertConstants.NAME_BODY_PARAMS, HttpAlertConstants.BODY_PARAMS)
.setPlaceholder("input request body as JSON format ")
.addValidate(Validate.newBuilder()
.setRequired(true)
.setRequired(false)
.build())
.build();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册