查看某巡检任务的执行状态和结果
更新时间:2025-04-01
请求URI
POST /api/bes/cluster/inspect/get_task
请求头参数
参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 |
---|---|---|---|---|
x-Region | String | 是 | 区域 | bd |
请求体参数
请求体字段数据结构说明
参数名称 | 参数类型 | 是否必须 | 描述 | 示例值 |
---|---|---|---|---|
clusterId | String | 是 | 集群id,超过规定18位会返回500错误 | 218185657699405824 |
taskId | String | 是 | 巡检任务id | 10 |
响应体参数
响应体字段数据结构说明
参数名称 | 参数类型 | 描述 | 示例值 |
---|---|---|---|
success | String | 请求是否成功 | true |
status | Integer | 状态码 | 200 |
result | Result | 返回信息 |
Result字段数据结构说明
参数名称 | 参数类型 | 描述 | 示例值 |
---|---|---|---|
state | String | 任务的执行状态。"doing","success",“error”,对应“执行中”、“执行成功”、“执行失败” | doing |
type | String | 巡检任务类型。"manual"、"auto",对应“手动”、“自动” | manual |
indices | String | 巡检索引,*代表全部索引 | index1 |
totalCount | Integer | 巡检项数量 | 14 |
execTime | String | 巡检任务执行时间。以北京时间表示 | 2024-07-20 18:31:42 |
groups | List |
巡检结果按照诊断等级("safe",“lowRisk”,“highRisk”,“error”)的分组。 |
GroupsItem字段数据结构说明
参数名称 | 参数类型 | 描述 | 示例值 |
---|---|---|---|
grade | String | 巡检项诊断等级。目前包括"safe","lowRisk","highRisk","error",分别对应"安全",“低风险”,“高风险”,“巡检失败” | lowRisk |
itemCount | Integer | 组内巡检项的数量 | 0 |
results | List |
当state="success",则results有内容。表示执行结果,JSON字符串。 |
ResultsItem字段数据结构说明
参数名称 | 参数类型 | 描述 | 示例值 |
---|---|---|---|
id | String | 巡检项id,即英文名 | ClusterHealth |
type | String | 巡检项类型。包括"cluster","node","index","search" | cluster |
conclusion | String | 巡检项结果 | 低风险:当前集群黄色(YELLOW) |
hasLowRiskAdvice | Boolean | 是否包含低风险的巡检建议(高低风险同时存在时为true) | false |
notExistIndex | Boolean | 巡检索引是否存在(索引级巡检项失败时用来判断是否是索引不存在导致的失败) | false |
请求示例
Plain Text
1POST /api/bes/cluster/inspect/get_task
2<公共请求头>
3x-Region: bd
4
5
6{
7 "clusterId":"218185657699405824",
8 "taskId":10
9}
响应示例
Plain Text
1HTTP/1.1 200 OK
2<公共响应头>
3
4{
5 "result" : {
6 "indices" : "index1",
7 "execTime" : "2024-07-20 18:31:42",
8 "groups" : [ {
9 "grade" : "lowRisk",
10 "results" : [ {
11 "conclusion" : "低风险:当前集群黄色(YELLOW)",
12 "notExistIndex" : false,
13 "id" : "ClusterHealth",
14 "type" : "cluster",
15 "hasLowRiskAdvice" : false
16 }, {
17 "conclusion" : "低风险:当前集群黄色(YELLOW)",
18 "notExistIndex" : false,
19 "id" : "ClusterHealth",
20 "type" : "cluster",
21 "hasLowRiskAdvice" : false
22 } ],
23 "itemCount" : 0
24 }, {
25 "grade" : "lowRisk",
26 "results" : [ {
27 "conclusion" : "低风险:当前集群黄色(YELLOW)",
28 "notExistIndex" : false,
29 "id" : "ClusterHealth",
30 "type" : "cluster",
31 "hasLowRiskAdvice" : false
32 }, {
33 "conclusion" : "低风险:当前集群黄色(YELLOW)",
34 "notExistIndex" : false,
35 "id" : "ClusterHealth",
36 "type" : "cluster",
37 "hasLowRiskAdvice" : false
38 } ],
39 "itemCount" : 0
40 } ],
41 "state" : "doing",
42 "type" : "manual",
43 "totalCount" : 14
44 },
45 "success" : "true",
46 "status" : 200
47}
错误码
请参考通用错误码