Stop the OCP Agent process on a host

2024-08-23 10:14:19  Updated

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/processes/{agentProcessId}/stop

Request parameters

Parameter Type Required Example value Description
hostId Long Yes 100 The ID of the host.
agentProcessId Long Yes 200 The ID of the Agent process.

Response parameters

Parameter Type Description
data Object For more information, see Data structure of HostAgentProcess.
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.

Data structure of HostAgentProcess

Parameter Type Description
id Long The ID of the Agent process.
hostId Long The ID of the host.
alias String The alias of the process.
pid Integer The PID of the process.
user String The user of the process.
startCommand String The start command.
ports String The open ports.
elapsedTime Long The total active time of the process, in seconds.
lastActiveTime String The last time when the process was active.
status String The process status. Valid values: STOPPED and STARTED.
operable Boolean Indicates whether the process can be operated by the user.
logFilePattern String The template of log file names.
createTime String The creation time.
updateTime String The update time.

Examples

Sample request

POST /compute/hosts/20/agent/processes/100/stop

Sample response

{
    "data": {
        "alias": "obstat2",
        "createTime": "2021-08-03T15:02:44+08:00",
        "elapsedTime": 0,
        "hostId": 20,
        "id": 185,
        "lastActiveTime": "2021-09-03T13:01:28+08:00",
        "logFilePattern": "/home/admin/ocp_agent/log/obstat2.log*",
        "operable": true,
        "pid": 0,
        "ports": null,
        "startCommand": null,
        "status": "STOPPED",
        "updateTime": "2021-08-03T15:03:27+08:00",
        "user": null
    },
    "duration": 3481,
    "server": "a83ad33525",
    "status": 200,
    "successful": true,
    "timestamp": "2021-09-03T13:01:50.465+08:00",
    "traceId": "51b0faa7203d42db"
}

Contact Us