Skip to content

API Reference ​

Every control-plane capability is exposed through the REST API. The WebUI, the CLI, and third-party automation are all clients of the same API and never bypass the control plane to operate directly on Agents or the data plane.

Complete endpoints, request fields, response structures, and runnable curl examples are authoritative in the repository's bilingual documentation:

  • Chinese: api/control-plane-api.zh-CN.md
  • English: api/control-plane-api.en.md

Entry point ​

ItemValue
Base URLhttps://<host>/api/cp
External entrynginx 443; port 80 only redirects with 301
Internal transportnginx forwards over a shared-volume unix socket; the control plane listens on no management TCP port
CertificateTOFU self-signed; pin with --cacert control_plane/state/certs/server.crt, or use -k
OpenAPIOff by default; set KURRENT_CP_OPENAPI=1 locally when needed

Authentication ​

Except /healthz and boot-chain endpoints, management endpoints require authentication. Three credential types are tried in order, and the first success short-circuits; an invalid credential returns 401 without falling through.

CredentialCarrierNotes
mTLS client certificate443 mutual TLSAdmin certificate issued during setup; nginx validates the chain and injects identity headers
Management tokenAuthorization: Bearer <token>Issued by kurrent token create --usage admin; only a digest is stored
Session cookie__Host-kurrent_sessionExchanged via POST /session with a certificate or token; identity comes from the server-side session ledger

Principal classes:

ClassSourceCapability
humanUser certificates from the users CAManagement and queries
componentagent / nvmet-host certificates from the nodes CAenroll / renew and component endpoints
automationManagement tokenNarrowed by scope
anonymousNo credentialBoot chain and health check only

Authorization rules:

  • Reads (GET) only require authentication;
  • writes (POST / PUT / PATCH / DELETE) require the admin group;
  • cross-class access is denied by default with 403;
  • an automation token with the enroll scope can only issue bootstrap tokens, cannot read ledgers, and cannot exchange for a session;
  • cookie-authenticated writes require Origin to match Host;
  • boot-chain endpoints are anonymous but constrained by binding, device signature verification, and source-IP rate limits.

Endpoint groups ​

GroupRepresentative endpointsPurpose
Health and declarationGET /healthz, GET /configLiveness, startup-derived self-checks, effective declaration and configHash
Boot chainGET /boot-assets, GET /boot-vars, GET /devices/report, GET /devices/challenge, POST /devices/rotateFirmware boot variables, device reporting, challenge-response, key rotation
Management identityPOST/DELETE /session, GET /sessions, GET /whoamiSession sign-in, sign-out, ledger, current identity
DevicesGET /devices, POST /devices, DELETE /devices/{mac}, POST/DELETE /devices/{mac}/bindDevice pool, registration, revocation, binding and unbinding
WorkersPOST /workers, GET /workers, GET /workers/{id}/status, DELETE /workers/{id}Worker ledger, status, batch deletion
System disksPOST /workers/{id}/luns/disk, POST /workers/luns/disk/batch, DELETE /workers/{id}/luns/disk/{os_tag}, PUT /workers/{id}/default-diskCreate, batch-create, delete, and default-disk selection
CredentialsGET/PUT/DELETE /workers/{id}/credentialView, rotate, revoke NVMe-oF authentication keys
AgentsGET /agents, POST /agents, POST /agents/probe, PUT /agents/{id}, DELETE /agents/{id}Storage-node ledger and probing
LUNs and mastersGET /agents/{id}/luns, GET /masters, POST /agents/{id}/luns/disk, PUT /agents/{id}/masters/{name}/tagMaster tags and LUN creation/deletion
PKIPOST /pki/tokens, GET /pki/tokens, GET /pki/users, GET /pki/components, GET /pki/control, GET /enroll/crlTokens, certificate ledgers, CRL distribution
SettingsGET/POST/DELETE /settings/registration-window, GET/PUT /settings/enforcementRegistration window and signature enforcement
OperationsGET /operationsOperation audit log

See the repository API docs for complete parameters and response fields.

Error semantics ​

StatusMeaning
400Request or business validation failure
401Missing, invalid, or expired credential
403Insufficient principal class or permission; cross-class access
404Object not found
409State conflict: already exists, already bound, node draining, etc.
429Rate limited; the response carries Retry-After
503Audit write failure, unreachable Agent, or failed startup-derived self-check

Bodies are usually {"detail": "..."}. Every response carries X-Request-Id; audit records use the same request_id.

Audit is fail-closed: if the audit event for a request cannot be written, the request itself returns 503. Audit never records keys, token plaintext, private keys, or PSKs.

Rate limits use a per-source-IP sliding window:

EndpointDefault threshold
/boot-vars240 requests/minute
/devices/report120 requests/minute
/devices/challenge120 requests/minute
/devices/rotate10 requests/minute

Thresholds can be adjusted with KURRENT_CP_RATE_LIMIT_*; <= 0 disables them. Rate limiting suppresses scanning; it is not an identity boundary.

Boot-chain endpoints ​

EndpointAuthKey constraint
/boot-varsanonymousBinding check plus optional device signature verification; unverified requests get no keys; no default disk returns reboot
/devices/reportanonymousRegistration only within the window, within quota, and with a valid public key; revoked devices stay revoked
/devices/challengeanonymousUnknown, unclaimed, or revoked devices return 404; the nonce is single-use and bound to the MAC
/devices/rotateanonymousOld key signs rotate‖mac‖new_pubkey‖nonce; nonce is single-use

Field-level contracts are in the Firmware Contract.

State and configuration files ​

FileMeaning
config/agents.ymlAgent ledger and scheduling roles
state/devices.ymlDevice ledger; authority for bindings
state/workers.ymlWorker ledger and system disks
state/credentials.ymlNVMe-oF key store
state/credential-push.ymlCredential push state
state/masters.ymlMaster tags
state/settings.jsonRuntime settings
state/users.ymlManagement users and groups
state/sessions.ymlServer-side session ledger
state/audit.jsonlAuthentication, authorization, credential audit and alarms
state/pki/Three root CAs, issuance ledgers, and CRLs
state/operations.jsonlOperation audit
dnsmasq/dhcp-hosts.confMAC → hostname projection; the device ledger is authoritative

dhcp-hosts.conf is truncated in place to preserve its inode; it is only a derived projection of binding operations and does not participate in boot identity resolution.