Add provisioning-request intake API for AI-driven client onboarding
Summary
- Adds
POST /api/v1/provision-requests: an AI assistant parses a client's Blesta ticket into structured fields (location, client identity, PTR, coarse OS choice, IXP interfaces/requests, extra hardware); Rax validates, records an internal ticket (browsable at/tickets), and best-effort emailsdc.ops@hop179.netvia Mailgun with a link back to the ticket. - New narrow Agent credential type (Bearer token, managed at
/settings/agents) — can only ever call this one endpoint, never logs into the UI; kept orthogonal to the existing local-admin/OIDC "no role model". - Intake-only: no Proxmox writes; the only NetBox read validates shared
ixp_interfacesagainst itsixp_interface-flagged VLANs. Actual provisioning — including resolvingos.kind: "debian"to a real on-node ISO filename — is deferred to a follow-up MR.
Test plan
-
go build ./...,go vet ./...,go test ./...all pass -
Manual smoke test: booted the server, logged in as local-admin, created an agent via /settings/agents, called the API with its token — got a200+ ticket id, ticket visible at/tickets/{id}withemail_sent: not sent(Mailgun key was a dummy) and the "Provisioning plan: not yet implemented" placeholder -
Verified 400(badlocation) and401(bad token) paths manually via curl -
Operator: point a real MAILGUN_API_KEYat a sandbox domain and confirm the dc.ops email actually arrives with a working/tickets/{id}link
Edited by Aiho Tehisaru