FortiManager
FortiManager supports network operations use cases for centralized management, best practices compliance, and workflow automation to provide better protection against breaches.
akaratas
Staff
Staff
Article Id 351372
Description

 

This article describes how to add a FortiGate as a real device to FortiManager using API query. This can help while recovering FortiManager to synchronize old configuration with new configuration.

 

Scope

 

FortiManager, FortiManager Cloud.

 

Solution

 

The following example shows how to add test1 in the demo ADOM.

API query Request:

 

{

  "id": 3,

  "method": "exec",

  "params": [

    {

      "data": {

        "adom": "demo",

        "device": {

          "adm_pass": "fortinet",

          "adm_usr": "admin",

          "ip": "10.10.10.10",

          "mgmt_mode": "fmg",

          "name": "test1"

        },

        "flags": [

          "create_task"

        ]

      },

      "url": "/dvm/cmd/add/device"

    }

  ],

  "session": "{{session}}"

}

 

Note:

  • If this API request is blocked, the system responds only once the device will be added within FortiManager.
  • The create_task flag can help FortiManager create a task that can be referred to in case the add device operation fails.
  • To get a non-blocking operation, it needs to be added the nonblocking flag:

 

"flags": [

"create_task",

"nonblocking"

]

 

Troubleshooting:

The below commands can be used on FortiMAnager CLI to debug the API Calls:

 

diagnose debug service httpd 255

diagnose debug service main 255

diagnose debug service task 255

 

Related article:

Technical Tip: Managing the JSON API call with Postman and how to delete, create and update an ADOM ...