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 336862
Description This article describes how to use JSON API to retrieve FortiGate configuration in FortiManager.
Scope FortiManager, FortiGate, API.
Solution
  • Create the below request to initiate the config retrieve:

 

{
   "id" : "1",
   "method" : "exec",
   "params" : [
      {
         "url" : "dvm/cmd/reload/dev-list",
         "data": {
            "adom" : "root",
            "flags" : [ "create_task", "nonblocking" ],
            "reload-dev-member-list" :  [
                {
                    "name" : "FORTIGATE-NAME",
                    "vdom": "root"
                }
            ],
            "tag" : "Retrieve via API",
            "from" : "dvm"
            }
      }
   ],
   "session" : "{{session}}"
}

 

  • Sample output:

 

1.png

 

This creates a Task in FortiManager -> System Settings -> Task Monitor:

 

1.png

 

  • Verify the revision using below API Call:

 

{
    "id": 1,
    "method": "exec",
    "params": [
        {
            "data": {
                "device": "FORTIGATE-NAME"
            },
            "url": "/deployment/get/device/revision"
        }
    ],
    "session" : "{{session}}"
}

 

  • Output:

 

1.png

 

  • Verify in FortiManager GUI: Device Manager -> Device & Groups -> Managed FortiGate -> Select the FortiGate -> Dashboard -> Summary -> Configuration & Installation widget, select the Revision History icon:

 

1.png

 

  • GUI shows the newly created revision using an API call.

 

For a complete list of FortiManager API calls and details, refer to Fortinet Development Network (FNDN).

 

Related documents:

Technical Tip: Using FortiManager API

Fortinet Development Network (FNDN) - FortiManager

Technical Tip: Getting Revision History for FortiGates and reverting them using FortiManager API Cal...