查看分派策略¶
该接口基于分派策略名称查询分派信息。
示例¶
请求URl
curl --location --request GET 'https://caweb.aiops.com/api/alert/rest/api/v1/escalation?current=1&size=10' \ --user 'email@example.com:<access_token>' \ --header 'Accept: application/json'
参数说明¶
| 参数 | 类型 | 说明 |
|---|---|---|
| current | Number | 必填,当前页码 默认1 |
| size | Number | 必填,每页返回的记录数 默认10 |
| description | string | 非必填,可分派策略名称 |
access_token如何获取请参考文档 api令牌
提示
• 示例邮箱应替换为用户注册所用邮箱
• access_token应替换为您手动获取的access_token
• 如需对请求进行加密处理:请将
--user 'email@example.com:access_token' \
--header 'Accept: application/json'
替换为:
--header 'Authorization: Basic Z2FveWluaW5nOTk5NUAxNjMuY29tOmt1WWl6bmljZ3oxN0JBVjk=' \
--header 'Content-Type: application/json'
• 替换步骤请参考加密步骤
响应报文¶
{
"result": "success",
"message": "ok",
"data":
{
"records":
[
{
"id": "test--uuid",
"description": "测试分派",
"username": "768215042",
"isDefault": 0,
"createTime": 1733987210066,
"updateTime": 1733987210066,
"deleted": 0,
"status": "ACTIVE",
"ruleId": null,
"cycles": 0,
"workId": null,
"workName": null,
"policies": [ ... ],
"entities": [],
"triggers": [ ... ]
}
],
"total": 1,
"size": 10,
"current": 1,
"orders": [],
"searchCount": true,
"pages": 1
},
"totalCount": 1,
"code": 200
}
响应参数¶
| 字段名 | 类型 | 说明 |
|---|---|---|
| result | string | 请求结果,可能值:success 或 failed |
| message | string | 请求状态描述 |
| data | 可忽略默认null | |
| totalCount | int | 可忽略通常为 1 |
| code | int | HTTP 状态码(成功为 200) |
data结果集¶
| 参数 | 类型 | 说明 |
|---|---|---|
| id | string | 分派策略唯一标识 |
| description | string | 描述信息 |
| username | string | 用户名 |
| isDefault | Integer | 是否为默认分派(0:否,1:是) |
| createTime | Long | 创建时间(毫秒时间戳) |
| updateTime | Long | 更新时间(毫秒时间戳) |
| deleted | Integer | 是否被删除(0:否,1:是) |
| status | string | 状态(如 "ACTIVE", "DISABLED") |
| ruleId | string | 规则 ID |
| cycles | Integer | 循环次数 |
| workId | string | 工作空间ID |
| workName | string | 工作空间名称 |
| policies | Array | 策略列表,每个元素为对象 |
| entities | Array | 实体列表,通常为空 |
| triggers | Array | 触发器列表,每个元素为对象 |
错误响应¶
{
"result": "failed",
"message": "失败,请检查参数.",
"data": null,
"totalCount": 0,
"code": 400
}
错误响应码¶
| 错误码 | 说明 |
|---|---|
| 200 | 成功 |
| 400 | 失败,传入的参数有问题 |
| 401 | 认证失败,用户名密码错误 |
| 403 | 权限失败,用户没有权限做此操作 |