Description
You can call this operation to stop the OCP Agent process on a host.
Call description
Prerequisite
You have the HOST_MANAGER permissions.
Request path
POST /compute/hosts/{hostId}/agent/stop
Request parameters
| Parameter | Type | Required | Example value | Description |
|---|---|---|---|---|
| hostId | Long | Yes | 100 | The ID of the host. |
Response parameters
| Parameter | Type | Description |
|---|---|---|
| data | Object | The information about the asynchronous DAG task. |
| successful | Boolean | Indicates whether the request was successful. |
| timestamp | Datetime | The timestamp when the server completed the request. |
| duration | Integer | The time taken by the server to process the request, in milliseconds. |
| status | Integer | An HTTP status code. |
| traceId | String | The trace ID of the request. This trace ID is used for troubleshooting. |
| server | String | The address of the application server that responded to the request. |
Examples
Sample request
POST /compute/hosts/2/agent/stop
Sample response
{
"data": {
"context": {
"listMap": {},
"parallel": false,
"parallelIdx": -1,
"stringMap": {
"prohibit_rollback": "false",
"host_id": "2"
}
},
"creator": "admin",
"executor": "xxx.xxx.xxx.xxx",
"hostId": 2,
"id": 30443,
"name": "Stop OCP agent",
"operation": "EXECUTE",
"startTime": "2021-09-03T14:27:59.687+08:00",
"status": "RUNNING",
"subtasks": [
{
"className": "com.alipay.ocp.service.task.business.obagent.PrepareStopOcpAgentTask",
"description": "Prepare stop OCP agent",
"downstreams": [
32073
],
"id": 32074,
"name": "Prepare stop OCP agent",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"runTime": 1,
"seriesId": 2,
"status": "READY",
"timeout": 60,
"upstreams": []
},
{
"className": "com.alipay.ocp.service.task.business.obagent.FinishOcpAgentOperationTask",
"description": "Finish OCP agent operation",
"downstreams": [],
"id": 32072,
"name": "Finish OCP agent operation",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"runTime": 1,
"seriesId": 0,
"status": "PENDING",
"timeout": 60,
"upstreams": [
32073
]
},
{
"className": "com.alipay.ocp.service.task.business.obagent.StopAllOcpAgentProcessesTask",
"description": "Stop all OCP agent processes",
"downstreams": [
32072
],
"id": 32073,
"name": "Stop all OCP agent processes",
"nodeType": "JAVA_TASK",
"operation": "EXECUTE",
"parallelIdx": -1,
"prohibitRollback": false,
"runTime": 1,
"seriesId": 1,
"status": "PENDING",
"timeout": 600,
"upstreams": [
32074
]
}
],
"taskDefinitionId": -1,
"type": "MANUAL"
},
"duration": 37,
"server": "a83ad33525",
"status": 200,
"successful": true,
"timestamp": "2021-09-03T14:27:59.694+08:00",
"traceId": "ecdbec1dad22451b"
}