首批通过分布式安全可靠测评,为关键业务系统打造
批量停止主机的 OCP Agent 的基础进程
更新时间:2023-08-10 11:45:58
功能说明
批量停止主机的 OCP Agent 的基础进程。
调用说明
接口约束
调用者需要具备 HOST_MANAGER 权限。
请求路径
POST /compute/hosts/batchStopAgents
请求参数
| 参数 | 类型 | 必选 | 示例值 | 描述 |
|---|---|---|---|---|
| hostIds | LongArray | 是 | [1001,1002] | 主机 ID 列表 |
返回结果
| 参数 | 类型 | 说明 |
|---|---|---|
| data | Object | 异步任务信息。 |
| successful | Boolean | 请求是否成功。 |
| timestamp | Datetime | 服务端完成请求的时间戳。 |
| duration | Integer | 服务端处理请求的时间(毫秒)。 |
| status | Integer | 符合 HTTP Status 规范的编码。 |
| traceId | String | 请求的 Trace ID,用于排查问题。 |
| server | String | 响应请求的应用服务的地址。 |
示例
请求示例
POST /compute/hosts/batchStopAgents
{
"hostIds": [2]
}
返回实例
{
"data": {
"context": {
"listMap": {
"host_ids": [
"2"
]
},
"parallel": false,
"parallelIdx": -1,
"stringMap": {
"prohibit_rollback": "false"
}
},
"creator": "admin",
"executor": "xxx.xxx.xxx.xxx",
"id": 31173,
"name": "Batch stop OCP agent",
"operation": "EXECUTE",
"startTime": "2021-09-03T15:01:10.636+08:00",
"status": "RUNNING",
"subtasks": [
{
"className": "com.alipay.ocp.service.task.business.WaitNode",
"description": "Wait node",
"downstreams": [
32855
],
"id": 32854,
"name": "Wait node",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"runTime": 1,
"seriesId": 1,
"status": "PENDING",
"timeout": 30,
"upstreams": [
32857
]
},
{
"className": "com.alipay.ocp.service.task.business.WaitNode",
"description": "Wait node",
"downstreams": [
32857
],
"id": 32856,
"name": "Wait node",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"runTime": 1,
"seriesId": 0,
"status": "PENDING",
"timeout": 30,
"upstreams": [
32858
]
},
{
"className": "com.alipay.ocp.service.task.business.obagent.PrepareStopOcpAgentTask",
"description": "Prepare stop OCP agent",
"downstreams": [
32856
],
"id": 32858,
"name": "Prepare stop OCP agent",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": 0,
"prohibitRollback": false,
"runTime": 1,
"seriesId": 4,
"status": "READY",
"timeout": 60,
"upstreams": []
},
{
"className": "com.alipay.ocp.service.task.business.obagent.StopAllOcpAgentProcessesTask",
"description": "Stop all OCP agent processes",
"downstreams": [
32854
],
"id": 32857,
"name": "Stop all OCP agent processes",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": 0,
"prohibitRollback": false,
"runTime": 1,
"seriesId": 3,
"status": "PENDING",
"timeout": 600,
"upstreams": [
32856
]
},
{
"className": "com.alipay.ocp.service.task.business.obagent.FinishOcpAgentOperationTask",
"description": "Finish OCP agent operation",
"downstreams": [],
"id": 32855,
"name": "Finish OCP agent operation",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": 0,
"prohibitRollback": false,
"runTime": 1,
"seriesId": 2,
"status": "PENDING",
"timeout": 60,
"upstreams": [
32854
]
}
],
"taskDefinitionId": -1,
"type": "MANUAL"
},
"duration": 40,
"server": "a83ad33525",
"status": 200,
"successful": true,
"timestamp": "2021-09-03T15:01:10.645+08:00",
"traceId": "688d3147a10b45e8"
}