Query OCP Agent processes on a host

2025-01-10 06:15:54  Updated

Description

You can call this operation to query OCP Agent processes on a host.

Call description

Prerequisite

You have the HOST_VIEWER permissions.

Request path

GET /compute/hosts/{hostId}/agent/processes

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 requested data.
├─ contents Array The HostAgentProcess array. For more information about its data structure, see the following table.
├─ page Object The page information.
├─ totalElements Integer The total number of records.
├─ totalPage Integer The total number of pages.
├─ number Integer The number of the current page.
├─ size Integer The size of the current page.
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

GET /compute/hosts/10/agent/processes?page=1&size=10

Sample response

{
    "data": {
        "contents": [
            {
                "alias": "ocp_mgragent",
                "createTime": "2024-07-30T10:30:54+08:00",
                "elapsedTime": 2073545,
                "hostId": 5,
                "id": 94,
                "lastActiveTime": "2024-08-23T10:29:47+08:00",
                "logFilePattern": "/home/admin/ocp_agent/log/mgragent.log*",
                "operable": false,
                "pid": 88902,
                "ports": "62888",
                "startCommand": "/home/admin/ocp_agent/bin/ocp_mgragent",
                "status": "STARTED",
                "updateTime": "2024-07-30T10:30:54+08:00",
                "user": "root"
            },
            {
                "alias": "ocp_monagent",
                "createTime": "2024-07-30T10:30:54+08:00",
                "elapsedTime": 2073545,
                "hostId": 5,
                "id": 95,
                "lastActiveTime": "2024-08-23T10:29:47+08:00",
                "logFilePattern": "/home/admin/ocp_agent/log/monagent.log*",
                "operable": false,
                "pid": 88901,
                "ports": "62889",
                "startCommand": "/home/admin/ocp_agent/bin/ocp_monagent",
                "status": "STARTED",
                "updateTime": "2024-07-30T10:30:54+08:00",
                "user": "root"
            },
            {
                "alias": "ocp_agentd",
                "createTime": "2024-07-30T10:30:54+08:00",
                "elapsedTime": 2073546,
                "hostId": 5,
                "id": 96,
                "lastActiveTime": "2024-08-23T10:29:47+08:00",
                "logFilePattern": "/home/admin/ocp_agent/log/agentd.log*",
                "operable": false,
                "pid": 88882,
                "ports": null,
                "startCommand": "/home/admin/ocp_agent/bin/ocp_agentd -c /home/admin/ocp_agent/conf/agentd.yaml",
                "status": "STARTED",
                "updateTime": "2024-07-30T10:30:54+08:00",
                "user": "root"
            }
        ],
        "page": {
            "number": 1,
            "size": 10,
            "totalElements": 3,
            "totalPages": 1
        }
    },
    "duration": 30,
    "server": "a83ad33525",
    "status": 200,
    "successful": true,
    "timestamp": "2024-08-23T10:29:49.999+08:00",
    "traceId": "0e7f94ec86ea652d"
}

Contact Us