revert_firewall_policy
Restore a firewall policy to a past change-log snapshot by updating the live policy with config captured from list_policy_revisions, then push it to devices with preview_install and install_package.
Instructions
Restore a firewall policy to a past change-log snapshot.
FortiManager has no dedicated revert-firewall-policy endpoint. The
documented mechanism (How-To 008, "How to revert a firewall policy from
a past changes?") is to capture a past change's config snapshot from
list_policy_revisions and update the live policy with it -- this tool
does exactly that. This writes a policy OBJECT inside the ADOM's policy
package; it does not touch any device. Push the reverted policy to
devices the same way any other policy edit is pushed: preview_install
then install_package.
Args: adom: ADOM name package: Policy package name config: A snapshot from list_policy_revisions' "config" field -- either the JSON string as returned, or the already-decoded dict. Must include "policyid". Any "oid" key is stripped automatically (FortiManager rejects the write if it is present). revision_note: Optional note recorded against this change
Returns: dict: status, adom, package, policyid, message
Example: >>> revisions = await list_policy_revisions("demo", "ppkg_001", policyid=14) >>> await revert_firewall_policy( ... "demo", "ppkg_001", revisions["changes"][0]["config"], ... revision_note="Revert from create time", ... )
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| adom | Yes | ||
| config | Yes | ||
| package | Yes | ||
| revision_note | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||