Search Agent Information
The Agent Information API enables you to retrieve information about all agents by invoking the following endpoint:
POST /api/v2/AgentInfo/search
FortiCNAPP highly recommends specifying a time range. Without a specified time range, the request uses the default time range of 24 hours prior to the current time. The maximum time range per API request is 7 days. To use the current time as the end time, exclude the endTime field.
You can optionally filter the information returned by agent status, agent version, IP address, and more. For details about what agent information is available, see AGENT_MANAGEMENT_V View.
Here are some example body payloads:
- { "timeFilter": { "startTime" : "2022-04-28T00:00:00Z", "endTime": "2022-04-28T18:00:00Z"},
- { "timeFilter": { "startTime": " 2022-04-28T00:00:00Z", "endTime": "2022-04-28T18:00:00Z"},
"filters" : [ { "field": "status", "expression": "eq", "value": "ACTIVE" }, { "field": "tags.VmProvider", "expression": "eq", "value" : "AWS" } ],
"returns": [ "hostname", "ipAddr", "os" , "agentVersion", "status" ] }
Within request bodies, nested field names that contain one or more special characters—e.g., dot ("."), colon (":"), or slash ("/")—must be enclosed in escaped double quotes. For example, the field name aws:ec2launchtemplate:version nested under the tags field would be rendered as follows:
"tags.\"aws:ec2launchtemplate:version\""
In a filter, the example would appear as follows:
{ "field": "tags.\"aws:ec2launchtemplate:version\"", "expression": "eq", "value": "3" }
In addition, forward slash characters within field names must be escaped with a backslash, as in the following example:
"tags.\"kubernetes.io\/cluster\/prod1\""
Headers
Bearer Access Token. For example, "Bearer {YourAPIToken}"
application/json
Request body
Response
No Error (List of Agent Information)