Agent Configuration Retrieval API
| Property | Value |
|---|---|
| Endpoint | POST /controller/rest/agent-management/v2/configuration/retrieve |
| HTTP Method | POST (agent IDs in request body) |
| Purpose | Retrieve configuration files from multiple agents |
| Content-Type | application/json |
| Response Format | application/json |
| Rate Limit | No specific rate limit (read-only) |
Authentication and Authorization
Request Body Structure
The request body must be a JSON object structured as follows:
{
"agentInstanceIds": ["string"],
"agentType": "enum",
"configFileNames": ["string"]
}
Field Descriptions
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
| agentInstanceIds | Array of Strings | Yes | Agent instance IDs to retrieve configuration from | Min: 1; Max: 100; All agents must be same type; duplicates allowed (deduplicated) |
| agentType | Enum | Yes | Type of agent being queried | See Supported Agent Types section |
| configFileNames | Array of Strings | No | Specific configuration file names to retrieve | If omitted, returns all files; Max: 20; no duplicate names; case-sensitive |
Supported Agent Types
agentType can be:
APP_AGENT, MACHINE_AGENT, DB_AGENT, DOT_NET_APP_AGENT, PHP_APP_AGENT, NODEJS_APP_AGENT, PYTHON_APP_AGENT, NATIVE_WEB_SERVER, SMART_AGENT
Configuration File Names
If configFileNames is omitted or empty, all configuration files are returned for each agent. If specified, only those files are returned if they exist (case-sensitive, max 20 per request, no duplicates).
Response Structure
HTTP 200 OK is returned for successful requests. The response maps agent IDs to arrays of configuration files:
{
"configs": {
"agent-instance-id-1": [
{
"fileName": "string",
"fileFormat": "string",
"fileContent": "string",
"targetPath": "string"
}
],
"agent-instance-id-2": []
}
}
Response Field Descriptions
| Field | Description |
|---|---|
| configs | Map of agent IDs to arrays of configuration files |
| configs[agentId] | Array of configuration file objects for the agent |
| fileName | Name of configuration file (e.g., "ld_preload.json") |
| fileFormat | Format of the file ("json", "yaml", "xml", "properties", "txt") |
| fileContent | Raw content of the file as a string |
| targetPath | Full path to the file on agent system |
Response Patterns and Examples
All agents have configs:
{
"configs": {
"agent-001": [
{ "fileName": "config.json", "fileFormat": "json", "fileContent": "...", "targetPath": "/path/to/config.json" }
],
"agent-002": [
{ "fileName": "config.json", "fileFormat": "json", "fileContent": "...", "targetPath": "/path/to/config.json" }
]
}
}
Some agents have no configs:
{
"configs": {
"agent-001": [
{ "fileName": "config.json", "fileFormat": "json", "fileContent": "...", "targetPath": "/path/to/config.json" }
],
"agent-002": [],
"agent-003": []
}
}
Partial file matches:
{
"configs": {
"agent-001": [
{ "fileName": "config.json", "fileFormat": "json", "fileContent": "...", "targetPath": "/path/to/config.json" }
],
"agent-002": [
{ "fileName": "config.json", "fileFormat": "json", "fileContent": "...", "targetPath": "/path/to/config.json" },
{ "fileName": "settings.yaml", "fileFormat": "yaml", "fileContent": "...", "targetPath": "/path/to/settings.yaml" }
]
}
}
Validation Rules and Constraints
Agent Validation: 1-100 agents per request. Agent IDs must be non-null, non-empty, and exist in the system. All agents must match the agentType field. Duplicates allowed and deduplicated.
File Name Validation (if provided): max 20 names, non-null, non-empty, no duplicates, case-sensitive.
Agent Type Validation: Must be a supported type listed above.
Error Responses
All error responses include errorCode and refCode for troubleshooting:
{
"errorCode": "string",
"message": "Detailed error message explaining what went wrong",
"refCode": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
| HTTP Status | Error Code | Description | Resolution |
|---|---|---|---|
| 400 Bad Request | validation-1 or validation-2 | Request validation failed | Fix validation issues as described in message |
| 403 Forbidden | auth-1 or auth-2 | Insufficient permissions | Request Viewer role from admin |
| 404 Not Found | not-found-1 or not-found-2 | Agents not found | Verify agent IDs and their existence |
| 500 Internal Server Error | server-1 or server-2 | Server error occurred | Contact support with refCode |
Examples
Retrieve all configuration files from Smart Agents:
curl -X POST "https://your-controller.saas.appdynamics.com/controller/rest/agent-management/v2/configuration/retrieve" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-d '{
"agentInstanceIds": [
"smart-agent-prod-001",
"smart-agent-prod-002",
"smart-agent-prod-003"
],
"agentType": "SMART_AGENT"
}'
{
"configs": {
"smart-agent-prod-001": [
{
"fileName": "ld_preload.json",
"fileFormat": "json",
"fileContent": "...",
"targetPath": "/opt/appdynamics/smart-agent/conf/ld_preload.json"
},
{
"fileName": "agent-config.yaml",
"fileFormat": "yaml",
"fileContent": "...",
"targetPath": "/opt/appdynamics/smart-agent/conf/agent-config.yaml"
}
],
"smart-agent-prod-002": [
{
"fileName": "ld_preload.json",
"fileFormat": "json",
"fileContent": "...",
"targetPath": "/opt/appdynamics/smart-agent/conf/ld_preload.json"
}
],
"smart-agent-prod-003": []
}
}
Troubleshooting Guide
Agents not found: Verify spelling, registration, and connectivity. Remove decommissioned agents.
Agent type mismatch: Confirm actual type and group agents by type.
Too many config files: Limit to 20 or split into multiple requests.
Duplicate file names: Ensure all file names are unique and correct case.
Too many agents: Limit to 100 per request or batch requests.
All agents return empty arrays: May be due to no configs, incorrect filters, or pending deployments. Check agent state and retry.
Partial results: Reflects actual agent state. Investigate as needed.
Best Practices
Batch queries up to 100 agents. Use file filters for performance. Cache results. Validate agent types. Audit regularly. Handle errors and retries. Secure tokens. Log refCodes. Allow for eventual consistency. Use API for compliance and drift detection.
Performance Considerations
Related APIs
POST /controller/rest/agent-management/v2/configuration/deploy: Deploy configuration files.
POST /controller/rest/agent-management/v2/configuration/deploy/multipart: Multipart deploy.
GET /controller/rest/agent-management/v2/tasks/{taskId}: Check deployment status.
POST /controller/rest/agent-management/v2/agents/query: Query agent inventory.
Differences from Deployment API
| Aspect | Retrieval API | Deployment API |
|---|---|---|
| HTTP Method | POST (body contains agent list) | POST |
| Permission | Viewer (read-only) | Admin (write) |
| Purpose | Query configuration state | Deploy new configurations |
| Rate Limiting | None | 10/minute |
| Agent Limit | 100 | 1000 |
| File Limit | 20 | 10 |
| File Size | No limit | 100KB/file |
| Response | Immediate | Task object (async) |
| Partial Results | Yes | N/A |
| Empty Results | Valid (empty arrays) | N/A |