API: rules
GET /api/rules#
List Rules
Permission policy.read (look)
Response 200 RuleRead[]
Show 23 fields
| Field | Type | Notes |
|---|---|---|
action * | string | |
config_key * | string | |
created_at * | string (date-time) | |
deployments * | DeploymentResult[] | |
description * | string | |
destination_net * | string | |
destination_port * | string | null | |
direction * | string | |
effective_host_ids | string (uuid)[] | |
enabled * | boolean | |
id * | string (uuid) | |
interface * | string | |
ipprotocol * | string | |
log | boolean | default: false |
placement | string | default: "end" |
protocol * | string | |
source_net * | string | |
source_port * | string | null | |
target_group_ids | string (uuid)[] | |
target_host_ids * | string (uuid)[] | |
updated_at * | string (date-time) | |
workflow_counts * | map<string, integer> | |
workflow_state * | "attention" | "pending" | "cleanup" | "unassigned" | "disabled" | "draft" | "synced" |
POST /api/rules#
Create Rule
Permission policy.write (prepare)
Request body RuleCreate
Show 15 fields
| Field | Type | Notes |
|---|---|---|
action | "pass" | "block" | "reject" | default: "pass" |
description * | string | minLength 1, maxLength 255 |
destination_net | string | default: "any" · minLength 1, maxLength 128 |
destination_port | string | null | |
direction | "in" | "out" | default: "in" |
enabled | boolean | default: true |
interface * | string | minLength 1, maxLength 64 |
ipprotocol | "inet" | "inet6" | default: "inet" |
log | boolean | default: false |
placement | "end" | "top" | default: "end" |
protocol | string | default: "any" · minLength 1, maxLength 16 |
source_net | string | default: "any" · minLength 1, maxLength 128 |
source_port | string | null | |
target_group_ids | string (uuid)[] | |
target_host_ids | string (uuid)[] |
Response 201 RuleRead
Show 23 fields
| Field | Type | Notes |
|---|---|---|
action * | string | |
config_key * | string | |
created_at * | string (date-time) | |
deployments * | DeploymentResult[] | |
description * | string | |
destination_net * | string | |
destination_port * | string | null | |
direction * | string | |
effective_host_ids | string (uuid)[] | |
enabled * | boolean | |
id * | string (uuid) | |
interface * | string | |
ipprotocol * | string | |
log | boolean | default: false |
placement | string | default: "end" |
protocol * | string | |
source_net * | string | |
source_port * | string | null | |
target_group_ids | string (uuid)[] | |
target_host_ids * | string (uuid)[] | |
updated_at * | string (date-time) | |
workflow_counts * | map<string, integer> | |
workflow_state * | "attention" | "pending" | "cleanup" | "unassigned" | "disabled" | "draft" | "synced" |
PUT /api/rules/{rule_id}#
Edit Rule
Permission policy.write (prepare)
Parameters
rule_id * | path | string (uuid) |
Request body RuleEdit
Show 16 fields
| Field | Type | Notes |
|---|---|---|
action | "pass" | "block" | "reject" | default: "pass" |
description * | string | minLength 1, maxLength 255 |
destination_net | string | default: "any" · minLength 1, maxLength 128 |
destination_port | string | null | |
direction | "in" | "out" | default: "in" |
enabled | boolean | default: true |
expected_updated_at * | string (date-time) | |
interface * | string | minLength 1, maxLength 64 |
ipprotocol | "inet" | "inet6" | default: "inet" |
log | boolean | default: false |
placement | "end" | "top" | default: "end" |
protocol | string | default: "any" · minLength 1, maxLength 16 |
source_net | string | default: "any" · minLength 1, maxLength 128 |
source_port | string | null | |
target_group_ids | string (uuid)[] | |
target_host_ids | string (uuid)[] |
Response 200 RuleRead
Show 23 fields
| Field | Type | Notes |
|---|---|---|
action * | string | |
config_key * | string | |
created_at * | string (date-time) | |
deployments * | DeploymentResult[] | |
description * | string | |
destination_net * | string | |
destination_port * | string | null | |
direction * | string | |
effective_host_ids | string (uuid)[] | |
enabled * | boolean | |
id * | string (uuid) | |
interface * | string | |
ipprotocol * | string | |
log | boolean | default: false |
placement | string | default: "end" |
protocol * | string | |
source_net * | string | |
source_port * | string | null | |
target_group_ids | string (uuid)[] | |
target_host_ids * | string (uuid)[] | |
updated_at * | string (date-time) | |
workflow_counts * | map<string, integer> | |
workflow_state * | "attention" | "pending" | "cleanup" | "unassigned" | "disabled" | "draft" | "synced" |
DELETE /api/rules/{rule_id}#
Delete Rule
Permission policy.deploy (roll out)
Parameters
rule_id * | path | string (uuid) | |
acknowledge_management_risk | query | boolean |
Response 204
POST /api/rules/{rule_id}/confirm#
Confirm
Permission policy.write (prepare)
Parameters
rule_id * | path | string (uuid) |
Response 200 RuleRead
Show 23 fields
| Field | Type | Notes |
|---|---|---|
action * | string | |
config_key * | string | |
created_at * | string (date-time) | |
deployments * | DeploymentResult[] | |
description * | string | |
destination_net * | string | |
destination_port * | string | null | |
direction * | string | |
effective_host_ids | string (uuid)[] | |
enabled * | boolean | |
id * | string (uuid) | |
interface * | string | |
ipprotocol * | string | |
log | boolean | default: false |
placement | string | default: "end" |
protocol * | string | |
source_net * | string | |
source_port * | string | null | |
target_group_ids | string (uuid)[] | |
target_host_ids * | string (uuid)[] | |
updated_at * | string (date-time) | |
workflow_counts * | map<string, integer> | |
workflow_state * | "attention" | "pending" | "cleanup" | "unassigned" | "disabled" | "draft" | "synced" |
POST /api/rules/{rule_id}/deploy#
Deploy
Permission policy.deploy (roll out)
Parameters
rule_id * | path | string (uuid) |
Request body DeployApproval | null
Response 200 RuleRead
Show 23 fields
| Field | Type | Notes |
|---|---|---|
action * | string | |
config_key * | string | |
created_at * | string (date-time) | |
deployments * | DeploymentResult[] | |
description * | string | |
destination_net * | string | |
destination_port * | string | null | |
direction * | string | |
effective_host_ids | string (uuid)[] | |
enabled * | boolean | |
id * | string (uuid) | |
interface * | string | |
ipprotocol * | string | |
log | boolean | default: false |
placement | string | default: "end" |
protocol * | string | |
source_net * | string | |
source_port * | string | null | |
target_group_ids | string (uuid)[] | |
target_host_ids * | string (uuid)[] | |
updated_at * | string (date-time) | |
workflow_counts * | map<string, integer> | |
workflow_state * | "attention" | "pending" | "cleanup" | "unassigned" | "disabled" | "draft" | "synced" |
POST /api/rules/{rule_id}/deployments/{host_id}/remove#
Remove Previous Target
Permission policy.deploy (roll out)
Parameters
rule_id * | path | string (uuid) | |
host_id * | path | string (uuid) |
Request body DeployApproval
Show 3 fields
| Field | Type | Notes |
|---|---|---|
acknowledge_management_risk | boolean | default: false |
comment | string | null | |
preview_token * | string | minLength 64, maxLength 64 |
Response 204
POST /api/rules/{rule_id}/deployments/{host_id}/retry-rollback#
Retry Rollback
Permission policy.deploy (roll out)
Parameters
rule_id * | path | string (uuid) | |
host_id * | path | string (uuid) |
Request body DeployApproval
Show 3 fields
| Field | Type | Notes |
|---|---|---|
acknowledge_management_risk | boolean | default: false |
comment | string | null | |
preview_token * | string | minLength 64, maxLength 64 |
Response 204
GET /api/rules/{rule_id}/management-check#
Rule Management Check
Read-only hint next to the preview (R11): would this rule block the way OPNexus or a management source reaches the firewall? The automatic revert needs that way. Reads the firewalls, writes nothing; a sure finding is what makes the deploy ask for an explicit acknowledgement.
Permission policy.read (look)
Parameters
rule_id * | path | string (uuid) | |
action | query | "deploy" | "remove" | "delete" | |
host_id | query | string (uuid) | null |
Response 200
GET /api/rules/{rule_id}/overlap#
Rule Overlap
Read-only hint next to the preview: would this rule be shadowed by (or duplicate) an earlier rule on its targets, and which later rules would it make pointless? Reads the firewalls (cached 60 s), writes nothing, never blocks.
Permission policy.read (look)
Parameters
rule_id * | path | string (uuid) |
Response 200
GET /api/rules/{rule_id}/preview#
Preview Rule
Permission policy.read (look)
Parameters
rule_id * | path | string (uuid) |
Response 200
GET /api/rules/{rule_id}/revisions#
List Revisions
Permission policy.read (look)
Parameters
rule_id * | path | string (uuid) |
Response 200
POST /api/rules/adopt#
Adopt Rule
Takes over a hand-made rule. Writes nothing to the firewall.
Permission policy.write (prepare)
Request body AdoptRequest
Show 4 fields
| Field | Type | Notes |
|---|---|---|
host_id * | string (uuid) | |
interface_role | string | null | |
link_to | string (uuid) | null | |
rule_uuid * | string | minLength 1, maxLength 64 |
Response 201 RuleRead
Show 23 fields
| Field | Type | Notes |
|---|---|---|
action * | string | |
config_key * | string | |
created_at * | string (date-time) | |
deployments * | DeploymentResult[] | |
description * | string | |
destination_net * | string | |
destination_port * | string | null | |
direction * | string | |
effective_host_ids | string (uuid)[] | |
enabled * | boolean | |
id * | string (uuid) | |
interface * | string | |
ipprotocol * | string | |
log | boolean | default: false |
placement | string | default: "end" |
protocol * | string | |
source_net * | string | |
source_port * | string | null | |
target_group_ids | string (uuid)[] | |
target_host_ids * | string (uuid)[] | |
updated_at * | string (date-time) | |
workflow_counts * | map<string, integer> | |
workflow_state * | "attention" | "pending" | "cleanup" | "unassigned" | "disabled" | "draft" | "synced" |
POST /api/rules/bulk/confirm#
Bulk Confirm
"I still have access" for several rules at once - the same confirm as the single endpoint, per rule.
Permission policy.write (prepare)
Request body BulkConfirmRequest
Show 1 fields
| Field | Type | Notes |
|---|---|---|
rule_ids * | string (uuid)[] |
Response 200 BulkConfirmResult
Show 2 fields
| Field | Type | Notes |
|---|---|---|
confirmed * | integer | |
results * | BulkRuleResult[] |
POST /api/rules/bulk/deploy#
Bulk Deploy
Deploys several rules one after the other, each through exactly the single-rule path (its own preview approval, consistency checks, pending window and auto-revert). One rule being refused does not stop the others; an unexpected error does, and the rest is reported as skipped. Declared before ``/{rule_id}/...`` so "bulk" is never read as an id.
Permission policy.deploy (roll out)
Request body BulkDeployRequest
Show 2 fields
| Field | Type | Notes |
|---|---|---|
comment | string | null | |
items * | BulkDeployItem[] |
Response 200 BulkDeployResult
Show 5 fields
| Field | Type | Notes |
|---|---|---|
attention * | integer | |
deployed * | integer | |
failed * | integer | |
results * | BulkRuleResult[] | |
skipped * | integer |
GET /api/rules/bulk/management-check#
Bulk Management Check
Read-only hint for the bulk dialog (R12): would these rules, deployed one after the other, block the way OPNexus or a management source reaches a firewall? Every rule can be harmless alone and still not be in combination. Reads the firewalls, writes nothing. Declared before ``/{rule_id}/...`` so "bulk" is never read as an id.
Permission policy.read (look)
Parameters
rule_id * | query | string (uuid)[] |
Response 200
GET /api/rules/unmanaged#
List Unmanaged Rules
Rules found on the host that OPNexus does not manage yet (live read).
Permission policy.read (look)
Parameters
host_id * | query | string (uuid) |
Response 200 UnmanagedRule[]
Show 19 fields
| Field | Type | Notes |
|---|---|---|
action * | string | |
adoptable * | boolean | |
description * | string | |
destination_net * | string | |
destination_port * | string | |
direction * | string | |
enabled * | boolean | |
interface * | string | |
interface_label * | string | |
interface_roles | string[] | |
linkable | boolean | default: false |
log * | boolean | |
matches | LinkTarget[] | |
protocol * | string | |
reasons * | string[] | |
similar | LinkTarget[] | |
source_net * | string | |
source_port * | string | |
uuid * | string |
GET /api/rules/usage#
Rule Usage
When each central rule last matched something (stored pf counter observations, merged over its deployments). Declared before ``/{rule_id}/...`` so "usage" is never read as an id.
Permission policy.read (look)