发送告警消息

最近更新时间:11/9/2023, 4:16:02 PM作者:andrewren(任豪)

接口描述

接口请求域名 http://iam-api.{工业环境域名}

接口类型:OpenAPI

接口请求方式:POST

接口名:SubmitAlert

本接口用于发送消息。

输入参数

参数名称 必选 类型 描述
Action String openapi公共参数,本接口取值:SubmitAlert
AlertId string 告警消息ID,请确保唯一,重复ID不加载
AlertMessage string 告警消息
AlertStatus string 告警状态 firing-告警,resolved-解除
AlertDate string 告警时间 时间格式RFC3339
AlertType string 告警类型 generally-一般 early-预警 critical-紧急 warning-重要
AlertSource string 告警来源 填写你的系统名称
AlertWebhook string 告警回调地址 ,必须外网可访问

输出参数

Response

参数名称 类型 描述
RequestId String 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId

示例

告警消息

openAPI Test

输入示例

{
"AlertId": 1,
"AlertMessage": "服务频繁重启",
"AlertStatus": "firing",
"AlertDate":"2006-01-02T15:04:05Z07:00",
"AlertType":"critical",
"AlertSource"   :"IAM",
"AlertWebhook"  :"www.test.com"
}

响应

{
  "Response": {
    "RequestId": "c49ec74f-21ca-46b1-80ca-c75c60235f6d"
}
}

错误码

以下仅列出了接口业务逻辑相关的错误码

错误码 描述