OPNexusdocs

API: rules

GET /api/rules#

List Rules

Permission policy.read (look)

Response 200 RuleRead[]

Show 23 fields
FieldTypeNotes
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_idsstring (uuid)[]
enabled *boolean
id *string (uuid)
interface *string
ipprotocol *string
logboolean default: false
placementstring default: "end"
protocol *string
source_net *string
source_port *string | null
target_group_idsstring (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
FieldTypeNotes
action"pass" | "block" | "reject" default: "pass"
description *stringminLength 1, maxLength 255
destination_netstring default: "any" · minLength 1, maxLength 128
destination_portstring | null
direction"in" | "out" default: "in"
enabledboolean default: true
interface *stringminLength 1, maxLength 64
ipprotocol"inet" | "inet6" default: "inet"
logboolean default: false
placement"end" | "top" default: "end"
protocolstring default: "any" · minLength 1, maxLength 16
source_netstring default: "any" · minLength 1, maxLength 128
source_portstring | null
target_group_idsstring (uuid)[]
target_host_idsstring (uuid)[]

Response 201 RuleRead

Show 23 fields
FieldTypeNotes
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_idsstring (uuid)[]
enabled *boolean
id *string (uuid)
interface *string
ipprotocol *string
logboolean default: false
placementstring default: "end"
protocol *string
source_net *string
source_port *string | null
target_group_idsstring (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 *pathstring (uuid)

Request body RuleEdit

Show 16 fields
FieldTypeNotes
action"pass" | "block" | "reject" default: "pass"
description *stringminLength 1, maxLength 255
destination_netstring default: "any" · minLength 1, maxLength 128
destination_portstring | null
direction"in" | "out" default: "in"
enabledboolean default: true
expected_updated_at *string (date-time)
interface *stringminLength 1, maxLength 64
ipprotocol"inet" | "inet6" default: "inet"
logboolean default: false
placement"end" | "top" default: "end"
protocolstring default: "any" · minLength 1, maxLength 16
source_netstring default: "any" · minLength 1, maxLength 128
source_portstring | null
target_group_idsstring (uuid)[]
target_host_idsstring (uuid)[]

Response 200 RuleRead

Show 23 fields
FieldTypeNotes
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_idsstring (uuid)[]
enabled *boolean
id *string (uuid)
interface *string
ipprotocol *string
logboolean default: false
placementstring default: "end"
protocol *string
source_net *string
source_port *string | null
target_group_idsstring (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 *pathstring (uuid)
acknowledge_management_riskqueryboolean

Response 204

POST /api/rules/{rule_id}/confirm#

Confirm

Permission policy.write (prepare)

Parameters

rule_id *pathstring (uuid)

Response 200 RuleRead

Show 23 fields
FieldTypeNotes
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_idsstring (uuid)[]
enabled *boolean
id *string (uuid)
interface *string
ipprotocol *string
logboolean default: false
placementstring default: "end"
protocol *string
source_net *string
source_port *string | null
target_group_idsstring (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 *pathstring (uuid)

Request body DeployApproval | null

Response 200 RuleRead

Show 23 fields
FieldTypeNotes
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_idsstring (uuid)[]
enabled *boolean
id *string (uuid)
interface *string
ipprotocol *string
logboolean default: false
placementstring default: "end"
protocol *string
source_net *string
source_port *string | null
target_group_idsstring (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 *pathstring (uuid)
host_id *pathstring (uuid)

Request body DeployApproval

Show 3 fields
FieldTypeNotes
acknowledge_management_riskboolean default: false
commentstring | null
preview_token *stringminLength 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 *pathstring (uuid)
host_id *pathstring (uuid)

Request body DeployApproval

Show 3 fields
FieldTypeNotes
acknowledge_management_riskboolean default: false
commentstring | null
preview_token *stringminLength 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 *pathstring (uuid)
actionquery"deploy" | "remove" | "delete"
host_idquerystring (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 *pathstring (uuid)

Response 200

GET /api/rules/{rule_id}/preview#

Preview Rule

Permission policy.read (look)

Parameters

rule_id *pathstring (uuid)

Response 200

GET /api/rules/{rule_id}/revisions#

List Revisions

Permission policy.read (look)

Parameters

rule_id *pathstring (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
FieldTypeNotes
host_id *string (uuid)
interface_rolestring | null
link_tostring (uuid) | null
rule_uuid *stringminLength 1, maxLength 64

Response 201 RuleRead

Show 23 fields
FieldTypeNotes
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_idsstring (uuid)[]
enabled *boolean
id *string (uuid)
interface *string
ipprotocol *string
logboolean default: false
placementstring default: "end"
protocol *string
source_net *string
source_port *string | null
target_group_idsstring (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
FieldTypeNotes
rule_ids *string (uuid)[]

Response 200 BulkConfirmResult

Show 2 fields
FieldTypeNotes
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
FieldTypeNotes
commentstring | null
items *BulkDeployItem[]

Response 200 BulkDeployResult

Show 5 fields
FieldTypeNotes
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 *querystring (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 *querystring (uuid)

Response 200 UnmanagedRule[]

Show 19 fields
FieldTypeNotes
action *string
adoptable *boolean
description *string
destination_net *string
destination_port *string
direction *string
enabled *boolean
interface *string
interface_label *string
interface_rolesstring[]
linkableboolean default: false
log *boolean
matchesLinkTarget[]
protocol *string
reasons *string[]
similarLinkTarget[]
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)

Response 200