wait_for_task
Waits for a FortiManager task to finish by polling its status until it completes, times out, or encounters an error.
Instructions
Wait for a task to complete.
Polls the task status until it completes or times out. Useful for waiting on installation or provisioning operations.
Args: task_id: Task ID number timeout: Maximum wait time in seconds (default: 300, capped at 3600) poll_interval: Seconds between status checks (default: 5)
Returns: dict: Final task status with keys: - status: "success" or "error" - task: Final task object - completed: Whether task completed (vs timeout) - message: Status or error message
Example: >>> # Wait for policy installation >>> result = await wait_for_task(12345, timeout=600) >>> if result['completed']: ... print("Installation finished!")
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes | ||
| timeout | No | ||
| poll_interval | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||