install_package
Deploy a firewall policy package to specified managed devices; use a verified preview to confirm the target before applying changes and monitor the task.
Instructions
Install a policy package to managed devices.
Deploys firewall policies and configurations from a policy package to the specified devices. This is an asynchronous operation - use wait_for_task() to monitor completion.
By default (FMG_INSTALL_SAFETY=strict) a real install requires a verified preview first: run preview_install for the same ADOM, package, and devices and review its result (on FortiManager builds older than 7.6.7 / 8.0.2, preview_install returns a task: wait_for_task on it and read get_preview_result). Each preview authorizes one install, and only while the package is unchanged — if the package was edited after the preview, the install is refused (preview_stale) and a fresh preview is required. A preview that found nothing to install authorizes nothing.
Args: adom: ADOM name package: Policy package name devices: Target devices [{"name": "FGT1", "vdom": "root"}, ...] preview: If True, run preview_install instead: nothing is installed (default: False). Changed in 1.13.0: this used to stage the install and return at once, leaving the devices held by an install-wizard session; it now runs the same full preview as preview_install, returns its result, and like it authorizes one install of the same target.
Returns:
dict: Installation result with keys:
- status: "success" or "error"
- task_id: Task ID for monitoring (if successful)
- message: Status or error message
With preview=True: the preview_install response plus
preview: True.
Example: >>> # Install to single device >>> result = await install_package( ... adom="root", ... package="default", ... devices=[{"name": "FGT-HQ", "vdom": "root"}] ... ) >>> if result["status"] == "success": ... await wait_for_task(result["task_id"])
>>> # Preview installation first
>>> result = await install_package(
... adom="root",
... package="default",
... devices=[{"name": "FGT-HQ", "vdom": "root"}],
... preview=True
... )
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": {
"adom": "<adom>",
"package": "<package>",
"devices": "<devices>"
},
"name": "install_package"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| adom | Yes | ||
| devices | Yes | ||
| package | Yes | ||
| preview | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||