API helper playbooks for FortiGate and FortiManager
Reusable sub-playbooks that call the FortiGate REST and FortiManager JSON-RPC APIs with a username and password, no connector needed.
fortigate-fortimanager-api-helpers-1.0.1.json
Sanitized by the pipeline and shipped inactive. Follow the before turning it on.
Two collections of small, reusable sub-playbooks that call the FortiGate REST API and the FortiManager JSON-RPC API directly with an admin username and password. They don't need a connector. Call them from your own playbooks with a Reference step.
FortiGate (FOS) helpers: log in and out through /api/v2/authentication, a general-purpose API call, get firmware and interfaces, create an API user and key, save, list and restore configuration revisions (by ID or by comment), and point a FortiGate at a FortiManager (central management bootstrap, with cmdb and legacy monitor variants). Manual buttons wrap the revision and bootstrap actions for use from a record.
FortiManager (FMG) helpers: log in and out over JSON-RPC, a general-purpose API call, get the device table, and set the scope of a firmware template.
Setup:
- Every helper takes the device address, username and password as inputs. Nothing is stored in the playbooks.
- The FortiManager admin needs
set rpc-permit read-writefor JSON-RPC logins. - "create api-user and apikey" uses a code step and creates a
super_adminAPI user namedlabenv. Change both before using it outside a lab.