clone_package
Clone a FortiManager policy package with its policies and wait for completion, creating an unassigned copy by default for safe editing; optionally copy device assignments.
Instructions
Clone a policy package.
Creates a copy of an existing package with all its policies and waits for FortiManager's clone task to finish.
Changed in 1.13.0: by default the clone is NOT assigned to any device
(earlier releases asked FMG to keep the source's assignment), so it can
be edited and reviewed without touching the devices that run the source
package. Pass copy_installation_targets=True for the old behaviour.
Each policy keeps its own "install on" targets either way: FMG clears
them on an unassigned clone, so they are copied back from the source.
The new name is sent as dst_name, the parameter FNDN documents for
/securityconsole/package/clone (7.2 through 8.0); earlier releases
sent new_name, which is not a parameter of that command. The clone is
created at the package root, so new_name is a plain name, not a
folder path.
Args: adom: ADOM name package: Source package name (may be folder-qualified) new_name: Name for the cloned package, without a folder copy_installation_targets: Also copy the source package's device and group assignment (default: False) timeout: Seconds to wait for the clone task (10-600, default 120)
Returns: dict: Clone result with keys: - status: "success" or "error" - package: New package name - task_id: FMG clone task - installation_targets_copied: Whether the assignment was copied - policy_targets_restored: IDs of policies whose install-on targets were copied back from the source - warnings: Policies whose targets could not be restored - message: Status or error message
Example: >>> result = await clone_package( ... adom="root", ... package="default", ... new_name="default-copy" ... )
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>",
"new_name": "<new_name>"
},
"name": "clone_package"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| adom | Yes | ||
| package | Yes | ||
| timeout | No | ||
| new_name | Yes | ||
| copy_installation_targets | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||