Documentation Index
Fetch the complete documentation index at: https://o1.network/docs/llms.txt
Use this file to discover all available pages before exploring further.
Addons API Reference
Manage addons that bundle multiple applications and jobs together for coordinated deployment and management. Addons provide a way to deploy complex multi-component systems as a single unit.
Endpoints Overview
| Method | Endpoint | Description |
|---|
| GET | /api/addons | List all addons |
| POST | /api/addons/new | Create new addon |
| PUT | /api/addons/edit | Edit addon |
| GET | /api/addons/{addonName} | Get addon details |
| POST | /api/addons/deploy | Deploy addon |
| POST | /api/addons/deployments/rerun | Rerun addon deployment |
| POST | /api/addons/uninstall | Uninstall addon |
Addon Management
List All Addons
Response:
{
"addons": {
"monitoring": {
"name": "monitoring",
"description": "Monitoring and observability addon",
"variables": {
"prometheus_port": {
"type": "string",
"value": "{prometheus_port}",
"default": "9090"
},
"grafana_port": {
"type": "string",
"value": "{grafana_port}",
"default": "3000"
}
},
"applications": {
"prometheus": {
"type": "monitoring",
"value": {
"installation": {
"setup_type": "docker",
"docker": {
"image": "prom/prometheus:latest"
}
}
}
},
"grafana": {
"type": "monitoring",
"value": {
"installation": {
"setup_type": "docker",
"docker": {
"image": "grafana/grafana:latest"
}
}
}
}
},
"jobs": {
"backup": {
"command": "backup.sh",
"schedule": "0 0 * * *",
"environment": {
"BACKUP_DIR": "/backups"
}
}
}
}
}
}
Create Addon
Request Body (JSON):
{
"name": "monitoring",
"description": "Monitoring and observability addon",
"variables": {
"prometheus_port": {
"type": "string",
"value": "{prometheus_port}",
"default": "9090"
}
},
"applications": {
"prometheus": {
"type": "monitoring",
"value": {
"installation": {
"setup_type": "docker",
"docker": {
"image": "prom/prometheus:latest"
}
}
}
}
}
}
Response:
{
"success": true,
"message": "Addon created successfully"
}
Get Addon Details
GET /api/addons/{addonName}
Parameters:
addonName (path): Name of the addon
Response:
{
"success": true,
"addon": {
"name": "monitoring",
"description": "Monitoring and observability addon",
"variables": {
"prometheus_port": {
"type": "string",
"value": "{prometheus_port}",
"default": "9090"
}
},
"applications": {
"prometheus": {
"type": "monitoring",
"value": {
"installation": {
"setup_type": "docker",
"docker": {
"image": "prom/prometheus:latest"
}
}
}
}
}
}
}
Deployment Management
Deploy Addon
Request Body (JSON):
{
"addonName": "monitoring",
"nodeName": "production-monitoring",
"deploymentMode": "docker",
"variables": {
"prometheus_port": "9090",
"grafana_port": "3000"
},
"deploymentId": "addon-deploy-20240115-103000"
}
Response:
{
"success": true,
"deploymentId": "addon-deploy-20240115-103000",
"message": "Addon deployment started"
}
Rerun Addon Deployment
POST /api/addons/deployments/rerun
Request Body (JSON):
{
"deploymentId": "addon-deploy-20240115-103000",
"newDeploymentId": "addon-deploy-20240116-140000",
"addonName": "monitoring",
"nodeName": "production-monitoring"
}
Response:
{
"success": true,
"message": "Addon deployment rerun started",
"deploymentId": "addon-deploy-20240116-140000",
"node": "production-monitoring",
"playbookPath": "/playbooks/monitoring/deploy.yml",
"originalDeploymentId": "addon-deploy-20240115-103000"
}
Uninstall Addon
POST /api/addons/uninstall
Request Body (JSON):
{
"addonName": "monitoring",
"nodeName": "production-monitoring"
}
Response:
{
"success": true,
"message": "Addon uninstalled successfully"
}
Advanced Addon Features
Job Management
Addons can include scheduled jobs that run on the target node:
{
"jobs": {
"backup": {
"command": "backup.sh",
"schedule": "0 0 * * *",
"environment": {
"BACKUP_DIR": "/backups"
},
"retry_policy": {
"retries": 3,
"retry_interval": "5m"
},
"notifications": {
"message": "Job {job_name} completed",
"on_success": true,
"on_failure": true
}
}
}
}
Component Dependencies
Addons can define dependencies between components:
{
"components": [
{
"name": "database",
"type": "postgresql",
"ports": ["5432"],
"dependencies": []
},
{
"name": "api",
"type": "nodejs",
"ports": ["3000"],
"dependencies": ["database"]
}
]
}
Error Responses
Common error responses for Addons API:
{
"success": false,
"error": "Addon not found",
"details": {
"addonName": "non-existent-addon"
}
}
{
"success": false,
"error": "Addon deployment failed",
"details": {
"addonName": "monitoring",
"nodeName": "production-monitoring",
"component": "prometheus",
"output": "Docker image pull failed"
}
}
Best Practices
Addon Design
- Keep addons focused on specific functionality
- Use clear naming conventions
- Document component dependencies
- Test addon deployments thoroughly
Variable Management
- Use descriptive variable names
- Provide sensible defaults
- Validate variable values
- Document variable usage
Deployment Strategy
- Test addon deployments in isolation
- Monitor component dependencies
- Implement proper rollback procedures
- Set up comprehensive monitoring
Job Management
- Use appropriate scheduling for jobs
- Implement proper error handling
- Monitor job execution and results
- Set up notifications for critical jobs
For detailed schema definitions, refer to the OpenAPI specification published alongside the backend service.