Agent Management API

The agent management API has commands for managing agents, plugins, tracing, and user-defined endpoints. The API URL for an Insight Agent begins with insight_url/services/agent-management/.

Subtopics

agents

GET /services/agent-management/agents

Returns a list of agents and their attributes.

Parameters

Table 5. Command Options

ParameterDescriptionDefault
pageNumPage number to return, first page is 1.

(Optional)

1
pageSizeSize of each page.

(Optional)

20

Example Request

GET http://localhost:8080/insight/services/agent-management/agents
{
    "agents": [
        {
            "name": "tal-ubuntu.local-27889",
            "id": "42fbe22c-864d-408c-8d29-d0803a06020d",
            "roles": ["AGENT", "ANALYZER", "DASHBOARD"],
            "version": "1.9.0-CI-SNAPSHOT",
            "status": "on",
            "heartbeat": 15,
            "licensed": true,
            "sameVersionAsDashboard": true,
            "througput": 200,
            "lastHeartBeat": 1339331100771,
            "clockSkew": 0,
            "installPath": "/work/env/apache-tomcat-6.0.33",
            "containerName": "Tomcat",
            "containerVersion": "6.0.33",
            "toggleUrl": "/services/agent-management/agents/status",
            "toggleMethod": "PUT",
            "toggleBody": "{\"status\":\"off\",\"agentId\":\"42fbe22c-864d-408c-8d29-d0803a06020d\"}"
        }
    ]
}

Notes

  • You can use the properties prefaced by toggle to start or stop an agent.

  • If you use the paging options, the results include page data:

    {
        "agents": [
            {
                "name": "tal-ubuntu.local-27889",
                 ...
            }],
        "currentPage": 2,
        "totalPages": 20,
        "pageSize": 10,
        "nextPage": "/services/agent-management/agents?pageSize=10&pageNum=3"
        "prevPage": "/services/agent-management/agents?pageSize=10&pageNum=1"
    }

GET /services/agent-management/agents/{agent id}

Returns the details for one agent.

Example Request

GET http://localhost:8080/insight/services/agent-management/agents/42fbe22c-864d-408c-8d29-d0803a06020d
{
    "name": "tal-ubuntu.local-27889",
    "id": "42fbe22c-864d-408c-8d29-d0803a06020d",
    "roles": ["AGENT", "ANALYZER", "DASHBOARD"],
    "version": "1.9.0-CI-SNAPSHOT",
    "status": "on",
    "heartbeat": 15,
    "licensed": true,
    "sameVersionAsDashboard": true,
    "througput": 200,
    "lastHeartBeat": 1339331160771,
    "clockSkew": 0,
    "installPath": "/work/env/apache-tomcat-6.0.33",
    "containerName": "Tomcat",
    "containerVersion": "6.0.33",
    "toggleUrl": "/services/agent-management/agents/status",
    "toggleMethod": "PUT",
    "toggleBody": "{\"status\":\"off\",\"agentId\":\"42fbe22c-864d-408c-8d29-d0803a06020d\"}"
}

Notes:

  • You can use the properties prefaced by toggle to start or stop an agent.

PUT /services/agent-management/agents/status

Turns an agent on or off.

Example Request

PUT http://localhost:8080/insight/services/agent-management/agents/status

Put body:

{"status":"on","agentId":"42fbe22c-864d-408c-8d29-d0803a06020d"}

Response

200 for success; otherwise 500.

Setting multiple agents' status

Set the value of multiple agents with one call to /agents/status by sending a list of statuses in the PUT body. This is especially useful for batch operations in UI grids.

[{"status":"off","agentId":"123"}, {"status":"on","agentId":"456"}]