FortiManager
FortiManager supports network operations use cases for centralized management, best practices compliance, and workflow automation to provide better protection against breaches.
farhanahmed
Staff
Staff
Article Id 419365
Description This article describes how to fetch the total number of revisions, including the data and time of the first and the latest revision, for all managed devices in FortiManager using JSON API and POSTMAN.
Scope FortiManager, Postman.
Solution
  • To fetch all revisions of a single device, the following API Request is used:

 

{
    "id": 1,
    "method": "exec",
    "params": [
        {
            "data": {
                "device": "<Device_Name>"
            },
            "url": "/deployment/get/device/revision"
        }
    ],
    "session": "{{session}}",
    "verbose": 1
}

 

  • Postman Scripts can be used to fetch the total number of all devices.

 

scrpi.png

 

 

This script executes the entire workflow:

 

  1. Fetches the device list using the API Request below:

 

{
   "method": "get",
   "params": [
      {
         "url": "/dvmdb/device"
      }
   ],
   "session": "{{session}}",
   "verbose": 1,
   "id": 1
}

 

  1. Loops through each device, making a new asynchronous API call to fetch revision history.

While the script is executing, Postman shows a blinking gray dot labeled Running scripts. When execution finishes, the dot disappears and the Visualization tab renders the final report.

 

scrpt_running.png

 

  1. Aggregates all results, sorts them, and renders the final output under the Visualization tab.

 

revisions.png

 

  • The API collection can be imported into Postman (tested with v11.71.7) using the attached file.
  • Under the 'Variables' tab of the collection, the following variables are required:
    • host: IP address of FortiManager.
    • ADMIN: FortiManager Admin user.
    • PASSWORD: Admin user password.


Related documents: