Batch restart basic OCP Agent processes on a host

2023-08-15 11:20:59  Updated

Description

You can call this operation to batch restart basic OCP Agent processes on a host.

Call description

Prerequisite

You have the HOST_MANAGER permissions.

Request path

POST /compute/hosts/batchRestartAgents

Request parameters

Parameter Type Required Example value Description
hostIds LongArray Yes [1001,1002] The list of host IDs.

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/batchRestartAgents

{
  "hostids": [2]
}

Sample response

{
    "data": {
        "context": {
            "listMap": {
                "host_ids": [
                    "2"
                ]
            },
            "parallel": false,
            "parallelIdx": -1,
            "stringMap": {
                "prohibit_rollback": "false"
            }
        },
        "creator": "admin",
        "executor": "192.168.0.1",
        "id": 30283,
        "name": "Batch restart OCP agent",
        "operation": "EXECUTE",
        "startTime": "2021-09-03T14:20:26.243+08:00",
        "status": "RUNNING",
        "subtasks": [
            {
                "className": "com.alipay.ocp.service.task.business.obagent.StartAllOcpAgentProcessesTask",
                "description": "Start all OCP agent processes",
                "downstreams": [
                    31899
                ],
                "id": 31902,
                "name": "Start all OCP agent processes",
                "nodeType": "JAVA_TASK",
                "operation": "EXECUTE",
                "parallelIdx": 0,
                "prohibitRollback": false,
                "runTime": 1,
                "seriesId": 5,
                "status": "PENDING",
                "timeout": 600,
                "upstreams": [
                    31901
                ]
            },
            {
                "className": "com.alipay.ocp.service.task.business.obagent.StopAllOcpAgentProcessesTask",
                "description": "Stop all OCP agent processes",
                "downstreams": [
                    31901
                ],
           "id": 31903,
                "name": "Stop all OCP agent processes",
                "nodeType": "JAVA_TASK",
                "operation": "EXECUTE",
                "parallelIdx": 0,
                "prohibitRollback": false,
                "runTime": 1,
                "seriesId": 1,
                "status": "PENDING",
                "timeout": 600,
                "upstreams": [
                    31898
                ]
            },
            {
                "className": "com.alipay.ocp.service.task.business.obagent.FinishOcpAgentOperationTask",
                "description": "Finish OCP agent operation",
                "downstreams": [],
                "id": 31904,
                "name": "Finish OCP agent operation",
                "nodeType": "JAVA_TASK",
                "operation": "EXECUTE",
                "parallelIdx": 0,
                "prohibitRollback": false,
                "runTime": 1,
                "seriesId": 6,
                "status": "PENDING",
                "timeout": 60,
                "upstreams": [
                    31899
                ]
            },
            {
                "className": "com.alipay.ocp.service.task.business.WaitNode",
                "description": "Wait node",
                "downstreams": [
                    31903
                ],
                "id": 31898,
                "name": "Wait node",
                "nodeType": "JAVA_TASK",
                "operation": "EXECUTE",
                "parallelIdx": -1,
                "prohibitRollback": false,
                "runTime": 1,
                "seriesId": 4,
                "status": "PENDING",
                "timeout": 30,
                "upstreams": [
                    31900
                ]
            },   
            {
                "className": "com.alipay.ocp.service.task.business.WaitNode",
                "description": "Wait node",
                "downstreams": [
                    31904
                ],
                "id": 31899,
                "name": "Wait node",
                "nodeType": "JAVA_TASK",
                "operation": "EXECUTE",
                "parallelIdx": -1,
                "prohibitRollback": false,
                "runTime": 1,
                "seriesId": 3,
                "status": "PENDING",
                "timeout": 30,
                "upstreams": [
                    31902
                ]
            },
            {
                "className": "com.alipay.ocp.service.task.business.obagent.RestartPosProxyTask",
                "description": "Restart pos proxy",
                "downstreams": [
                    31898
                ],
                "id": 31900,
                "name": "Restart pos proxy",
                "nodeType": "JAVA_TASK",
                "operation": "EXECUTE",
                "parallelIdx": 0,
                "prohibitRollback": false,
                "runTime": 1,
                "seriesId": 8,
                "status": "PENDING",
                "timeout": 60,
                "upstreams": [
                    31897
                ]
            },
            {
                "className": "com.alipay.ocp.service.task.business.WaitNode",
                "description": "Wait node",
                "downstreams": [
                    31902
                ],
                "id": 31901,
                "name": "Wait node",
                "nodeType": "JAVA_TASK",
                "operation": "EXECUTE",
                "parallelIdx": -1,
                "prohibitRollback": false,
                "runTime": 1,
                "seriesId": 7,
                "status": "PENDING",
                "timeout": 30,
                "upstreams": [
                    31903
                ]
            },  
            {
                "className": "com.alipay.ocp.service.task.business.WaitNode",
                "description": "Wait node",
                "downstreams": [
                    31900
                ],
                "id": 31897,
                "name": "Wait node",
                "nodeType": "JAVA_TASK",
                "operation": "EXECUTE",
                "parallelIdx": -1,
                "prohibitRollback": false,
                "runTime": 1,
                "seriesId": 0,
                "status": "PENDING",
                "timeout": 30,
                "upstreams": [
                    31905
                ]
            },
            {
                "className": "com.alipay.ocp.service.task.business.obagent.PrepareRestartOcpAgentTask",
                "description": "Prepare restart OCP agent",
                "downstreams": [
                    31897
                ],
                "id": 31905,
                "name": "Prepare restart OCP agent",
                "nodeType": "JAVA_TASK",
                "operation": "EXECUTE",
                "parallelIdx": 0,
                "prohibitRollback": false,
                "runTime": 1,
                "seriesId": 2,
                "status": "READY",
                "timeout": 60,
                "upstreams": []
            }
        ],
        "taskDefinitionId": -1,
        "type": "MANUAL"
    },
    "duration": 584,
    "server": "192.168.0.1",
    "status": 200,
    "successful": true,
    "timestamp": "2021-09-03T14:20:26.257+08:00",
    "traceId": "135b61d1965d4be3"
}

Contact Us