opn_set_rule_categories
Assign or clear categories on an OPNsense firewall rule by UUID. Check savepoint support first on old versions to avoid lockout, and confirm changes or back up config when needed.
Instructions
Assign categories to a firewall rule by UUID with savepoint protection where supported.
Use this when you need to categorize or re-categorize a firewall rule. Savepoint protection applies on OPNsense < 26.7 only: there changes auto-revert in 60 seconds unless confirmed with opn_confirm_changes. OPNsense 26.7 removed the savepoint API upstream, so on 26.7+ changes apply immediately and are NOT rolled back automatically. Check opn_mcp_info first: if 'savepoint_support' is false, take a config backup with opn_download_config before changing rules that could lock you out.
Parameters:
uuid: the firewall rule UUID (from opn_list_firewall_rules)
categories: comma-separated category UUIDs (from opn_list_firewall_categories), or empty string to clear all categories
Returns: dict with 'revision' (str) for confirming and 'uuid' (str).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uuid | Yes | ||
| categories | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||