Fortinet FortiGate RestoreConfig
Certified
Enterprise Edition
Restore a configuration backup on a FortiGate
Fortinet FortiGate RestoreConfig
Restore a configuration backup on a FortiGate
Uploads a backup produced by GetConfig to /api/v2/monitor/system/config/restore. FortiOS reboots after a restore unless reboot-upon-config-restore is disabled (enabled by default). The task reads that setting first and returns rebootExpected.
When a reboot is expected the task is guarded like Reload: it needs the boot time baseline (snapshot or previousBootupTimestamp) and sends nothing, returning alreadyReloaded: true, when the device already rebooted since. The restore call is sent once and never retried automatically. Do not set a task level retry on it. Follow it with WaitForReturn. Needs a direct connection and an API administrator with the super_admin profile.
A read timeout or a dropped connection while waiting for the answer counts as success when a reboot is expected. A refused connection, a TLS failure or an HTTP error status fails the task.
type: io.kestra.plugin.ee.fortinet.fortigate.RestoreConfigExamples
Restore a backup and wait for the device
id: fortigate_restore
namespace: company.network
inputs:
- id: backup
type: URI
- id: previous_boot
type: FLOAT
tasks:
- id: restore
type: io.kestra.plugin.ee.fortinet.fortigate.RestoreConfig
host: fgt1.example.com
apiToken: "{{ secret('FORTIGATE_API_TOKEN') }}"
backup: "{{ inputs.backup }}"
previousBootupTimestamp: "{{ inputs.previous_boot }}"
- id: wait
type: io.kestra.plugin.ee.fortinet.fortigate.WaitForReturn
host: fgt1.example.com
apiToken: "{{ secret('FORTIGATE_API_TOKEN') }}"
previousBootupTimestamp: "{{ inputs.previous_boot }}"
Installation
This Enterprise plugin requires an Enterprise image and access to the plugin registry. Install it with the following command:
kestractl plugins get io.kestra.plugin.ee:plugin-ee-fortinet --compatible-for $KESTRA_VERSION For kestractl, use your Kestra version with --compatible-for, or specify an exact plugin version.
Properties
backup *string
Backup
Internal storage URI of the backup file, for example the uri output of GetConfig.
Pebble expression referencing an Internal Storage URI e.g. {{ outputs.mytask.uri }}.
apiToken string
API token
Key of a REST API administrator (execute api-user generate-key). It is sent in the Authorization: Bearer header only, never in the URL. Use {{ secret('FORTIGATE_API_TOKEN') }}. Set a trusthost on the API administrator to the egress range of your worker group. Configuration backup, restore and firmware upgrade need the super_admin profile, the other tasks work with a read profile (read-write for the tasks that change configuration).
assets
Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.
io.kestra.core.models.assets.AssetsDeclaration
IGNOREFAILWARNAsset failure behavior
Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.
Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.
The assets consumed as inputs.
io.kestra.core.models.assets.AssetIdentifier
1The assets produced as outputs.
io.kestra.plugin.ee.assets.Dataset
1150{}1150io.kestra.plugin.ee.assets.File
1150{}1150io.kestra.plugin.ee.assets.Table
1150{}1150io.kestra.plugin.ee.assets.VM
1150{}1150io.kestra.core.models.assets.External
1150{}1150io.kestra.core.models.assets.Custom
11501Custom asset type
{}1150caCertificate string
CA certificate
PEM encoded CA certificate(s) used to validate the FortiGate certificate. When set, only this CA is trusted. When empty, the JVM trust store is used.
connectTimeout string
Connect timeout
Maximum time to open the connection. Must be greater than zero. Defaults to 10 seconds.
device string
Managed device
Name of the FortiGate in FortiManager. Only used with fortiManager.
fortiManager
FortiManager proxy
Reach the FortiGate through a FortiManager when the worker can only connect to the manager. Reads only: the call goes through exec /sys/proxy/json. Tasks that write (ApplyConfig, RestoreConfig, Reload) and GetConfig backups need a direct connection: on a managed FortiGate, change configuration with policy packages. Needs device.
io.kestra.plugin.ee.fortinet.fortimanager.FortiManagerConnection
FortiManager host
Host name or IP address of the FortiManager management interface.
ADOM
Administrative domain that holds the managed device. Defaults to root.
API key
REST API key of a FortiManager API user (FortiManager 7.2.2 and later), sent in the Authorization header. Use {{ secret('FORTIMANAGER_API_KEY') }}.
CA certificate
PEM encoded CA certificate(s) used to validate the FortiManager certificate. When empty, the JVM trust store is used.
Connect timeout
Maximum time to open the connection. Must be greater than zero. Defaults to 10 seconds.
Skip TLS verification
Disables certificate and host name validation. Only for labs with self-signed certificates. Defaults to false.
Password
Administrator password. Use {{ secret('FORTIMANAGER_PASSWORD') }}.
FortiManager port
HTTPS port. Defaults to 443.
Request timeout
Maximum time to wait for one answer. Must be greater than zero. Defaults to 60 seconds.
Username
Administrator name, used with password when no apiKey is set.
host string
FortiGate host
Host name or IP address of the FortiGate management interface. Required unless fortiManager and device are set.
insecureSkipVerify booleanstring
Skip TLS verification
Disables certificate and host name validation. Only for labs with self-signed certificates. Defaults to false.
port integerstring
FortiGate port
HTTPS port of the management interface. Defaults to 443.
previousBootupTimestamp numberstring
Previous boot timestamp
Baseline boot time (epoch seconds) when no snapshot is given.
requestTimeout string
Request timeout
Maximum time to wait for one answer. Must be greater than zero. Defaults to 60 seconds.
scope string
GLOBALVDOMScope
GLOBAL (default) or VDOM, as used when the backup was taken.
snapshot string
Snapshot
Internal storage URI of the PRE check snapshot. Its boot time is the guard baseline when a reboot is expected.
Pebble expression referencing an Internal Storage URI e.g. {{ outputs.mytask.uri }}.
vdom string
VDOM
VDOM the call applies to. Defaults to root. Global tables (system/...) ignore it.
Outputs
alreadyReloaded boolean
Already reloaded
True when the guard found the device already rebooted since the baseline, so nothing was sent.
rebootExpected boolean
Reboot expected
True when reboot-upon-config-restore is enabled, so the device reboots after the restore.