Tagged: FMG API From Scratch
9 posts · browse all tags
-
FMG API From Scratch Part 9: The Finished Tool, and Hardening It
Put the series together into one small command-line tool: render locally, push, stage, preview and install FortiManager scripts, with dry runs by default, a version guard, an audit trail that never holds content, and tests that fail when a safety is removed.
-
FMG API From Scratch Part 8: Install, Preview First, Commit Second
Install is the step that reaches the live device. Build the preview diff the way the GUI does, hash it, and refuse to install anything you have not read.
-
FMG API From Scratch Part 7: Stage and Inspect, or Was Anything Actually Written?
A staged script returns a task id, then a log that says success. Neither proves anything was written. Poll the task, read the log by the id the task gives you, and check the Device Database before and after.
-
FMG API From Scratch Part 6: Pushing Configuration, and the Jinja Trap
Create a CLI script object through the FortiManager API and stage it against one device, without touching the live unit. Includes the endpoint that moved in 7.6.5, the Jinja trap that reports success while writing nothing installable, and a target field that ignores typos.
-
FMG API From Scratch Part 5: Discovery, or Finding What the Documentation Doesn't Tell You
The FortiManager API is huge and the reference is not a map. Survey your own box safely: probe endpoints by shape without leaking values, learn the URL trees, and read a response for what it teaches before you build on it.
-
FMG API From Scratch Part 4: A Service Account That Can Do the Job and Nothing Else
Build the FortiManager API account the client logs in with, then audit it through the API, prove its fences hold, pin a self-signed certificate instead of disabling TLS checks, and stop secrets leaking out of reads and logs.
-
FMG API From Scratch Part 3: Your First API Call, and Why "OK" Isn't Enough
Log in to FortiManager, read a device's DNS from its Device Database, and log out, first as raw JSON, then with a small Python client that never trusts a bare OK. Covers failed logins, how set and update really behave, and the tests.
-
FMG API From Scratch Part 2: ADOM Database, Device Database and the Live Device
FortiManager keeps two databases and installs the difference, not your config. The three places a configuration lives, how an install really flows, where each script type can run, and how the API's URL prefixes map onto all of it.
-
FMG API From Scratch Part 1: Why FortiManager, and Not Straight to FortiOS
Before the first API call, the design question: why drive FortiGates through FortiManager's JSON-RPC API instead of calling FortiOS directly? What FMG adds, what it costs, where the documentation runs out, and the roadmap.