Tests a rule configuration in dry-run mode without saving. Useful for previewing what a new rule would detect before creating it
POST /api/automation/rules/test-preview
Auto-generated from server.go. Handler: s.automationHandlers.TestRulePreview.
Authorizations
Section titled “Authorizations ”Request Body
Section titled “Request Body ”object
Responses
Section titled “ Responses ”Dry-run preview
Response from POST /api/automation/rules/test-preview. Returns a
dry-run preview of MACs that would match the proposed rule. Mirrors
the gin.H literal in
internal/api/handlers_automation.go::TestRulePreview and the
TestRuleResult struct in internal/automation/types.go (hand-lifted
Phase 70-03 Session 6 — sampler’s generic body produces an internal
scheduler error against the seeded MV state).
Note: the inner DetectedMAC struct has no JSON tags, so Go emits
capitalised field names verbatim on the wire.
object
Always success on the 200 path.
TestRuleResult — detected MACs and aggregate counts.
object
object
DHCPv6 DUID for clients without an extractable MAC.
Sum of requests over the lookback window (ClickHouse UInt64).
Count of unique IPs over the lookback window (ClickHouse UInt64).
Either dhcpv4 or dhcpv6.
Total number of detected MAC rows.
The SQL query the scheduler executed.
ClickHouse-reported execution time in milliseconds.
The request body or parameters failed validation.
Standardised error envelope per RFC 7807. Many existing endpoints still
return an older shape (e.g. {"error": "..."}). This schema documents the
target shape; legacy endpoints will be migrated in Phase 70. Per D-21 the
spec describes current behaviour without enforcing the migration here.
object
A URI reference that identifies the problem type.
A short human-readable summary of the problem.
The HTTP status code generated by the origin server.
A human-readable explanation specific to this occurrence.
A URI reference that identifies the specific occurrence.
Legacy error message field. Will be removed once handlers are migrated.
Legacy per-field error details. Will be removed once handlers are migrated.
object
The request id middleware-assigned identifier for tracing.
Authentication is required or the supplied token is invalid.
Standardised error envelope per RFC 7807. Many existing endpoints still
return an older shape (e.g. {"error": "..."}). This schema documents the
target shape; legacy endpoints will be migrated in Phase 70. Per D-21 the
spec describes current behaviour without enforcing the migration here.
object
A URI reference that identifies the problem type.
A short human-readable summary of the problem.
The HTTP status code generated by the origin server.
A human-readable explanation specific to this occurrence.
A URI reference that identifies the specific occurrence.
Legacy error message field. Will be removed once handlers are migrated.
Legacy per-field error details. Will be removed once handlers are migrated.
object
The request id middleware-assigned identifier for tracing.
Internal server error
Standardised error envelope per RFC 7807. Many existing endpoints still
return an older shape (e.g. {"error": "..."}). This schema documents the
target shape; legacy endpoints will be migrated in Phase 70. Per D-21 the
spec describes current behaviour without enforcing the migration here.
object
A URI reference that identifies the problem type.
A short human-readable summary of the problem.
The HTTP status code generated by the origin server.
A human-readable explanation specific to this occurrence.
A URI reference that identifies the specific occurrence.
Legacy error message field. Will be removed once handlers are migrated.
Legacy per-field error details. Will be removed once handlers are migrated.
object
The request id middleware-assigned identifier for tracing.