set_metadata_variable
Sets an existing metadata variable's value for a managed device, optionally for one VDOM scope, so templates apply it at the next install. Preview install if the value can affect network settings.
Instructions
Set a device's value for an existing metadata variable.
A device can hold one mapping per scope, for example "global" and "root",
and templates can read either, so a value changed in one scope alone can
leave the other behind. Without vdom every mapping the device has is
changed; a device without any gets a "global" mapping.
Only FortiManager changes here. Templates use the new value at the next
install: run preview_install(package=None) first, because a variable such
as branch_id can move LAN addresses and BGP identities.
Args:
adom: ADOM name
name: Variable name (it must already exist)
device: Managed device name
value: New value: one line, at most 255 characters, no newlines or
other control characters and none of ", \, #,
{{, {%, {# or $( (templates paste it into CLI as is)
vdom: Only this scope (optional, e.g. "global" or "root")
Returns: dict: status, variable, device, changes[{vdom, old, new}] (password variables redacted), or message on failure. A failure after some scopes were written also carries changes, for those scopes only
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>",
"name": "<name>",
"device": "<device>",
"value": "<value>"
},
"name": "set_metadata_variable"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| adom | Yes | ||
| name | Yes | ||
| vdom | No | ||
| value | Yes | ||
| device | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||