FortiManager
FortiManager supports network operations use cases for centralized management, best practices compliance, and workflow automation to provide better protection against breaches.
tnesh
Staff & Editor
Staff & Editor
Article Id 330351
Description This article describes how to get and update firewall addresses using JSON API.
Scope FortiManager.
Solution
  • All objects have prefix '/pm/config/global/obj/' or '/pm/config/adom/obj/' for the Global or ADOM level.
  • API URL for 'Firewall Address':

    "url": /pm/config/adom/<adom_name>/obj/firewall/address"

 

 

Get Firewall Address:

 

  • Sample JSON-API by filter specific firewall address:

     

    {
      "method": "get",
      "params": [ {
              "url": "/pm/config/adom/root/obj/firewall/address",
              "filter": [ "name","==","testt-firewall-address"]
              } ],
      "session":"{{session}}",
      "id": 1
    }

 

  • Sample output:

 

firewall-add-api-get.png

 

Update Firewall Address:

 

  • Sample JSON-API to update specific firewall address -> Subnet:


    {
      "method": "update",
      "params": [ {
        "data": [ {
              "name": "testt-firewall-address",
              "subnet": [
                        "220.110.110.110",
                        "255.255.255.255"
                        ]
              } ],
        "url": "/pm/config/adom/root/obj/firewall/address"
        } ],
      "session":"{{session}}",
      "id": 1
    }

 

  • Sample output:

 

firewall-add-api-update.png

 

Troubleshooting:

  • The following commands can be used on FortiManager CLI to debug the REST API Calls for ADOM objects:

     

    diagnose debug service main 255

    diagnose debug service cdb 255

    diagnose debug enable

 

Related documents:

Technical Tip: Using FortiManager API

Fortinet Development Network (FNDN) - FortiManager

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

API admin setup

Technical Tip: Using Firmware Manager CLI and API

Technical Tip: Managing the JSON API call with cURL under Linux/Gnu and how to get, delete and creat...

Technical Tip: How to run a proxy API call from FortiManager to a managed FortiGate

Technical Tip: API requests by using the API token authentication method with Postman

Technical Tip: FortiManager API troubleshooting using browser developer tools

Contributors