创建巡检任务
创建巡检任务。
将巡检策略和巡检对象关联,巡检模块就会根据巡检策略巡检关联的对象。
接口URL
/api/v1/observe/inspect/inspections/create
请求方式
POST
Content-Type
application/json
请求Body参数
{
"target": "tidb-5ea28a75",
"policyID": "none",
"status": "enable",
"creator": "admin",
"description": "创建巡检"
}
认证方式
Bearer auth
成功响应示例
{
"Data": {
"ID": 3,
"CreatedAt": "2023-12-27T16:21:05.303+08:00",
"UpdatedAt": "2023-12-27T16:21:05.303+08:00",
"InspectID": "ispt-f898632643e16acc",
"Target": "tidb-5ea28a75",
"PolicyID": "test_policy",
"Status": "enable",
"Creator": "admin",
"Description": "创建巡检",
"NextTime": "2023-12-28T02:00:00+08:00",
"DeletedAt": 0
},
"Success": true
}
参数名 | 示例值 | 参数类型 | 参数描述 |
---|---|---|---|
Data | - | Object | - |
Data.ID | 3 | Integer | - |
Data.CreatedAt | 2023-12-27T16:21:05.303+08:00 | String | - |
Data.UpdatedAt | 2023-12-27T16:21:05.303+08:00 | String | - |
Data.InspectID | ispt-f898632643e16acc | String | - |
Data.Target | tidb-5ea28a75 | String | - |
Data.PolicyID | test_policy | String | - |
Data.Status | enable | String | - |
Data.Creator | admin | String | - |
Data.Description | 创建巡检 | String | - |
Data.NextTime | 2023-12-28T02:00:00+08:00 | String | - |
Data.DeletedAt | 0 | Integer | - |
Success | true | Boolean | - |
错误响应示例
{
"Data": null,
"Message": "policy does not exist or not enable,record not found",
"Code": "get policy failed",
"Success": false
}
参数名 | 示例值 | 参数类型 | 参数描述 |
---|---|---|---|
Data | null | Null | - |
Message | policy does not exist or not enable,record not found | String | - |
Code | get policy failed | String | - |
Success | false | Boolean | - |