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 351371
Description

 

This article describes how device list information can be taken from FortiManager for all ADOMs and specific ADOMs using an API query.

 

Scope

 

FortiManager, FortiManager Cloud.

 

Solution

 

The following example below explains how to get managed devices for test1 ADOM:

 

API Request is below:

 

{

  "id": 3,

  "method": "get",

  "params": [

    {

      "fields": [

        "name",

        "sn"

      ],

      "option": [

        "no loadsub"

      ],

      "url": "/dvmdb/adom/test1/device"

    }

  ],

  "session": "{{session}}",

  "verbose": 1

}

 

Note:

'no  loadsub option' and 'fields attributes' need to be used to decrease the number of returned data.

 

 

How to get a list of managed devices for all ADOMs.

API Request is below:

 

{

  "id": 3,

  "method": "get",

  "params": [

    {

      "expand member": [

        {

          "fields": [

            "name",

            "sn"

          ],

          "url": "device"

        }

      ],

      "fields": [

        "name",

      ],

      "filter": [

        "restricted_prds",

        "==",

        "fos"

      ],

      "option": [

        "no loadsub"

      ],

      "url": "/dvmdb/adom/"

    }

  ],

  "session": "{{session}}",

  "verbose": 1

}

 

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

 

Related article:

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