diff_device_revision
Compare a past device DB revision against the current configuration and return a unified line diff, with optional section filtering for focused, read-only change review.
Instructions
Diff a past device DB revision against the CURRENT device DB.
FortiManager has no native diff endpoint for device DB revisions (unlike ADOM DB revisions -- see diff_adom_revision). This instead fetches both the past revision's config text (checkout) and the current device DB export, then computes a client-side unified line diff. Read-only.
Note: The checkout half of this requires the device to have at least one device DB revision on record -- see the note on list_device_revisions.
Args:
device: Managed device name
revision: Revision number to compare against current (see
list_device_revisions)
sections: Only compare these config blocks, e.g.
["router bgp", "system interface"] (the leading "config " is
optional). A block matches at any depth, so "router bgp" also
finds it under a VDOM. A full diff can reach hundreds of KB,
because a revision also lists default objects the current export
omits.
Both sides are normalised before diffing: trailing whitespace, blank
lines and # header lines (config-version, build number) are dropped,
since the checkout and the current export differ in them without any
configuration change.
Returns:
dict: status, device, revision, changed (bool), diff (unified diff
text, empty string if unchanged), and with sections also
sections_missing (requested sections found on neither side). Both
sides are redacted of known secret-bearing directives before
diffing -- see redact_config_text_secrets -- so a line whose only
change is its secret value will not show as changed.
Example: >>> result = await diff_device_revision("hub2", revision=7) >>> if result["changed"]: ... print(result["diff"])
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"device": "<device>",
"revision": "<revision>"
},
"name": "diff_device_revision"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| device | Yes | ||
| revision | Yes | ||
| sections | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||