FortiADC
FortiADC enhances the scalability, performance, and security of your applications whether they are hosted on premises or in the cloud.
shafiq23
Staff & Editor
Staff & Editor
Article Id 353131
Description This article describes how to use Postman/curl to export FortiADC system debug files through REST API.
Scope FortiADC, FortiADC VM.
Solution
  1. Create a REST API administrator or regenerate the API key if there is an existing REST API administrator.

 

1.png

2.png

 4.png

 

  1. Note down the API key in a notepad.

     

 

3.PNG

 

Prepare cURL commands that meet the required format specifications for the request.

 

  • Request Method: GET.
  • Host header: FortiADC MGMT IP.
  • Authorization header: APITOKEN.
  • API URL path: /api/system/debug/state_download.
  • Parameter: name.

 

A sample of the cURL command would look like below:

 

curl -ik -X GET -H ‘Accept: application/json’ -H ‘APITOKEN: <token>’ https://<FADC-IP>/api/system/debug/state_download?name=<debugfilename>

 

Steps to perform in Postman:

 

  • Open Postman.
  • Select the Import tab on the upper left side.

 

5.png

 

  • Paste the cURL command into the import window.
  • Select 'Send and Download' to post the request.

 

6.png

 

  • The debug file will be saved in the local folder.

 

To generate a system debug file:

Method: POST.

URL: /api/system/debug/save_state.

 

To get a list of available debug files:

Method: GET.

URL: /api/system/debug/get_statefile_list.

 

Note: The cURL command can also be used in a terminal when cURL is installed.

 

curl -ik -X GET -H ‘Accept: application/json’ -H ‘APITOKEN: <token>’ https://<FADC-IP>/api/system/debug/state_download?name=<debugfilename> > <dest-filename>

 

cURL Manual 

 

For more information, refer to FortiADC RESTful API Reference:

FortiADC REST API documentation