Agent Inventory API
The Agent Inventory API query allows you to retrieve a filtered and sorted list of agents from your inventory. This endpoint supports App Agents, Machine Agents, Smart Agents, and Database Agents.
API Endpoint
POST /controller/rest/v2/agent-management/inventory/query
Request Structure
{
"agentType": "<AGENT_TYPE_VALUE>",
"offset": 0,
"limit": 50,
"filters": [
{
"field": "<FIELD_NAME>",
"value": "<VALUE_OR_ARRAY_OF_VALUES>"
}
],
"sorting": [
{
"field": "<FIELD_NAME>",
"direction": "ASC|DESC"
}
]
}
Request Parameters
| Parameter | Description | Required |
|---|---|---|
| agentType | The agent type for the query. The following values are allowed:
|
Yes |
| offset | The number of records to skip before starting to return the results.
The default value is 0. |
No |
| limit | The number of results per page.
The default value is 50 and maximum limit can be 1000 |
No |
| filters | An array of filter criteria | No |
| sorting | An array of sort criteria | No |
Example Request and Response
curl -X POST "http://localhost:8080/controller/rest/v2/agent-management/inventory/query" \
-u "user1@customer1:welcome" \
-H "Content-Type: application/json" \
-d '{
"agentType": "APP_AGENT",
"offset": 0,
"limit": 2,
"filters": [
{
"field": "VERSION_STATUS",
"value": ["OutOfDate"]
}
]
}'
{
"data": [
{
"agentId": 101,
"agentType": "APP_AGENT",
"agentVersion": "24.10.0.36431",
"hostName": "5-ubuntu-dev",
"versionStatus": "OutOfDate",
"installDir": "/opt/appdynamics/java-agent/ver24.10.0.36431",
"nodeName": "01KBApp1Node1_4-ubuntu-dev_f8803d",
"componentName": "01KBTier1_39ac4b",
"applicationNames": ["01KBApp1_678de5"],
"applicationIds": [20],
"applicationComponentNodeId": 205,
"machineId": 104,
"disabled": false,
"allDisabled": false,
"managed": true,
"appHasEditPermission": true,
"appHasViewPermission": true,
"os": null,
"bit": null,
"agentInstanceId": null,
"smartAgentId": null,
"profileName": null,
"metadata": null,
"agentInstallationV2": null,
"agentInstallation": null,
"extensionCount": null,
"accountId": null,
"alive": null,
"lastAliveTs": null,
"complete": null,
"version": null,
"lastDeployment": null,
"profileId": null,
"tags": null,
"agentName": null,
"agentState": null,
"startTime": null,
"uptimeInSeconds": null,
"jvmOptions": null,
"flags": null,
"serviceName": null,
"runAsService": null,
"agentPid": null,
"serviceStatus": null
}
],
"totalCount": 1,
"offset": 0,
"limit": 2
}