Fortinet Document Library

Version:

Version:

Version:


Table of Contents

Administration Guide

Download PDF
Copy Link

Troubleshooting REST API

Test from Linux

Use your browser or another REST tool to test querying, deleting or updating using REST API. Below are some sample commands.

curl -k -i -u <uname>:<passwd> -H "Accept: application/xml" -X GET https://<servername>:8443/api

curl -k -i -u <uname>:<passwd> -H "Accept: application/xml" -X GET https://<servername>:8443/api/host

curl -k -i -u <uname>:<passwd> -H "Accept: application/xml" -X GET https://<servername>:8443/api/host/320

curl -k -i -u <uname>:<passwd> -H "Accept: application/xml" -X DELETE https://<servername>:8443/api/host/320

curl -k -i -u <uname>:<passwd> -H "Accept: application/xml" -X POST -d "mac=00:00:1D:33:44:55" -d "os=Windows" https://<servername>:8443/api/host/update

Enable debug

To enable debug, uncomment the following in the jersey servlet configuration in
/bsc/campusMgr/ui/ROOT/WEB-INF/web.xml:

<!--

<init-param>

<param-name>com.sun.jersey.config.feature.Trace</param-name>

<param-value>true</param-value>

</init-param>

<init-param>

<param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>

<param-value>com.sun.jersey.api.container.filter.LoggingFilter</param-value>

</init-param>

<init-param>

<param-name>com.sun.jersey.spi.container.ContainerResponseFilters</param-name>

<param-value>com.sun.jersey.api.container.filter.LoggingFilter</param-value>

</init-param>

-->

To restart tomcat-admin, run service tomcat-admin restart.

The debug file can be found in /bsc/logs/tomcat-admin/catalina.out.

Troubleshooting REST API

Test from Linux

Use your browser or another REST tool to test querying, deleting or updating using REST API. Below are some sample commands.

curl -k -i -u <uname>:<passwd> -H "Accept: application/xml" -X GET https://<servername>:8443/api

curl -k -i -u <uname>:<passwd> -H "Accept: application/xml" -X GET https://<servername>:8443/api/host

curl -k -i -u <uname>:<passwd> -H "Accept: application/xml" -X GET https://<servername>:8443/api/host/320

curl -k -i -u <uname>:<passwd> -H "Accept: application/xml" -X DELETE https://<servername>:8443/api/host/320

curl -k -i -u <uname>:<passwd> -H "Accept: application/xml" -X POST -d "mac=00:00:1D:33:44:55" -d "os=Windows" https://<servername>:8443/api/host/update

Enable debug

To enable debug, uncomment the following in the jersey servlet configuration in
/bsc/campusMgr/ui/ROOT/WEB-INF/web.xml:

<!--

<init-param>

<param-name>com.sun.jersey.config.feature.Trace</param-name>

<param-value>true</param-value>

</init-param>

<init-param>

<param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>

<param-value>com.sun.jersey.api.container.filter.LoggingFilter</param-value>

</init-param>

<init-param>

<param-name>com.sun.jersey.spi.container.ContainerResponseFilters</param-name>

<param-value>com.sun.jersey.api.container.filter.LoggingFilter</param-value>

</init-param>

-->

To restart tomcat-admin, run service tomcat-admin restart.

The debug file can be found in /bsc/logs/tomcat-admin/catalina.out.