This article describes how device list information can be taken from FortiManager for all ADOMs and specific ADOMs using an API query.
FortiManager, FortiManager Cloud.
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:
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2024 Fortinet, Inc. All Rights Reserved.