API
DNS

DNS

Base path: /api/cloud/dns

Protected endpoints:

POST /api/cloud/dns/create

  • Auth: Bearer (Keycloak)
  • Description: Creates a new DNS/proxy host entry for an instance port.
  • Body (JSON):
    • instanceId (string, required)
    • forwardPort (number, required, target port on instance)
    • domain (string, optional; if omitted, auto-generates like <uuid>.redu.cloud)
  • Responses: 201 Created with created entry; 400/401/403/500
  • Example:
curl -X POST https://your-host/api/cloud/dns/create \
  -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  -d '{"instanceId":"INSTANCE_ID","forwardPort":3000,"domain":"app.redu.cloud"}'

POST /api/cloud/dns/update-dns

  • Auth: Bearer (Keycloak)
  • Description: Updates instance DNS-related metadata.
  • Body (JSON):
    • instanceId (string, required)
    • metadata (object, required)
  • Responses: 200 OK with result; 400/401/500
  • Example:
curl -X POST https://your-host/api/cloud/dns/update-dns \
  -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
  -d '{"instanceId":"INSTANCE_ID","metadata":{"dns":"app.redu.cloud"}}'

Public endpoints:

GET /api/cloud/dns/list

  • Auth: None
  • Description: Lists all proxy hosts (DNS entries).
  • Example:
curl https://your-host/api/cloud/dns/list

GET /api/cloud/dns/proxy-hosts/:proxyHostId

  • Auth: None
  • Params:
    • proxyHostId (string)
  • Responses: 200 OK with proxy host; 400/500
  • Example:
curl https://your-host/api/cloud/dns/proxy-hosts/PROXY_ID

DELETE /api/cloud/dns/proxy-hosts/:proxyHostId

  • Auth: None
  • Params:
    • proxyHostId (string)
  • Responses: 200 OK with message; 400/500
  • Example:
curl -X DELETE https://your-host/api/cloud/dns/proxy-hosts/PROXY_ID

PUT /api/cloud/dns/proxy-hosts/:proxyHostId

  • Auth: None
  • Params:
    • proxyHostId (string)
  • Body: updateData (object) fields to update
  • Responses: 200 OK with updated host; 400/500
  • Example:
curl -X PUT https://your-host/api/cloud/dns/proxy-hosts/PROXY_ID \
  -H 'Content-Type: application/json' \
  -d '{"forwardPort":8080}'