Skip to content

Tenant Manager

The Tenant Manager (cbtenant) is the central orchestration system for Campaign Brain.

Features

  • Tenant Lifecycle Management: Create, deploy, upgrade, and delete tenants
  • Service Management: Start, stop, restart tenant services
  • Port Allocation: Automatic port assignment with conflict detection
  • Version Control: Track deployed versions, manage upgrades
  • Health Monitoring: Check tenant service status

Quick Reference

API Endpoints

Endpoint Method Description
/api/tenants GET List all tenants
/api/tenants POST Create new tenant
/api/tenants/{id} GET Get tenant details
/api/tenants/{id} DELETE Delete tenant
/api/tenants/{id}/deploy POST Deploy tenant
/api/tenants/{id}/upgrade POST Upgrade tenant
/api/tenants/{id}/version GET Check version status
/api/tenants/{id}/services/start POST Start services
/api/tenants/{id}/services/stop POST Stop services
/api/tenants/{id}/services/restart POST Restart services
/api/tenants/{id}/services/status GET Check service status

Common Operations

Get Auth Token

curl -s -X POST http://localhost:32201/api/auth/login \
  -d "username=admin&password=admin123"

List Tenants

curl -H "Authorization: Bearer $TOKEN" \
  http://localhost:32201/api/tenants

Check Tenant Version

curl -H "Authorization: Bearer $TOKEN" \
  http://localhost:32201/api/tenants/{id}/version

Upgrade Tenant

curl -X POST -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"target_version": "v0.3.0", "backup_db": true}' \
  http://localhost:32201/api/tenants/{id}/upgrade

Dashboard

Access the web dashboard at http://localhost:32200

Features:

  • Tenant overview with health status
  • One-click deployment and upgrades
  • Service management
  • Log viewing

See Also