Description |
This article describes how to extract the install preview output using REST API calls for FortiManager. |
Scope |
FortiManager-VM and FortiManager. |
Solution |
Prerequisites:
In the example below, the REST API Calls will be demonstrated in Postman:
POST: https://x.x.x.x/jsonrpc x.x.x.x : FMG IP
Request:
{ "id": 1, "method": "exec", "params": [ { "data": [ { "passwd": "", "user": "admin" } ], "url": "sys/login/user" } ], "session": null, }
Response:
{ "result": [ { "status": { "code": 0, "message": "OK" }, "url": "sys/login/user" } ], "session": "BEvR3fyRHNQ5b4fE1huzRD+wfy3vk5sN6h1by7pUG+9QHdy7ywgIGfuUdtI9UYCegiqJFTNNzqgy4i3nqjybnw== ", "id": 1 }
Request:
{ "id": 1, "method": "exec", "params": [ { "data": { "adom": "root", "flags": [ "preview" ], "pkg": "Test", "scope": { "name": "brainy-fmg-esx26", "vdom": "root" }
}, "url": "/securityconsole/install/package" } ], "session": " BEvR3fyRHNQ5b4fE1huzRD+wfy3vk5sN6h1by7pUG+9QHdy7ywgIGfuUdtI9UYCegiqJFTNNzqgy4i3nqjybnw==", "verbose": 1 }
Response:
{
Request:
{ "id": 1, "method": "exec", "params": [ { "data": { "adom": "root", "device": "brainy-fmg-esx26", "flags": [ "none" ], "vdoms": "root" }, "url": "/securityconsole/install/preview" } ], "session": " BEvR3fyRHNQ5b4fE1huzRD+wfy3vk5sN6h1by7pUG+9QHdy7ywgIGfuUdtI9UYCegiqJFTNNzqgy4i3nqjybnw==", "verbose": 1 }
Response:
{
Request:
{ "id": 1, "method": "exec", "params": [ { "data": { "adom": "root", "device": "brainy-fmg-esx26" }, "url": "/securityconsole/preview/result" } ], "session": " BEvR3fyRHNQ5b4fE1huzRD+wfy3vk5sN6h1by7pUG+9QHdy7ywgIGfuUdtI9UYCegiqJFTNNzqgy4i3nqjybnw==", "verbose": 1 }
Response:
Note that the message output in the last request has been truncated for better article readability.
Troubleshooting:
The following commands can be used on FortiManagerCLI to debug the REST API Calls:
diagnose debug service httpd 255 diagnose debug service main 255
Related articles:
|
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.