Resource Usage API Reference
Monitor your Odoo instances' resource consumption programmatically. Track CPU, RAM, database storage, and file storage metrics.
GET /api/v1/usage/instances
Retrieve usage summary for all your instances.
Request
curl -X GET "https://vedtechsolutions.com/api/v1/usage/instances" \ -H "X-API-Key: your_api_key"
Response
{
"success": true,
"data": {
"instances": [
{
"id": 91,
"name": "My Company ERP",
"subdomain": "mycompany",
"status": "running",
"usage": {
"cpu_percent": 15.2,
"ram_mb": 512,
"ram_percent": 25.0,
"db_storage_gb": 2.5,
"file_storage_gb": 1.2
},
"limits": {
"cpu_cores": 2,
"ram_mb": 2048,
"db_storage_gb": 10,
"file_storage_gb": 20
}
}
],
"total_instances": 1
}
}
GET /api/v1/usage/instance/{id}
Get detailed usage metrics for a specific instance.
Parameters
| Parameter | Type | Description |
|---|---|---|
id | integer | Instance ID or subdomain |
Request
curl -X GET "https://vedtechsolutions.com/api/v1/usage/instance/91" \ -H "X-API-Key: your_api_key"
Response
{
"success": true,
"data": {
"instance": {
"id": 91,
"name": "My Company ERP",
"subdomain": "mycompany",
"full_url": "mycompany.tenants.vedtechsolutions.com",
"status": "running",
"odoo_version": "19",
"plan": "Professional"
},
"current_usage": {
"cpu_percent": 15.2,
"cpu_cores_used": 0.3,
"ram_mb": 512,
"ram_percent": 25.0,
"db_storage_gb": 2.5,
"db_storage_percent": 25.0,
"file_storage_gb": 1.2,
"file_storage_percent": 6.0
},
"limits": {
"cpu_cores": 2,
"ram_mb": 2048,
"db_storage_gb": 10,
"file_storage_gb": 20,
"users": 15
},
"last_updated": "2026-01-02T12:00:00Z"
}
}
GET /api/v1/usage/instance/{id}/history
Get historical usage data for an instance.
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
period | string | 24h | Time period: 1h, 6h, 24h, 7d, 30d |
interval | string | auto | Data interval: 5m, 15m, 1h, 1d |
Request
curl -X GET "https://vedtechsolutions.com/api/v1/usage/instance/91/history?period=7d" \ -H "X-API-Key: your_api_key"
Response
{
"success": true,
"data": {
"instance_id": 91,
"period": "7d",
"interval": "1h",
"metrics": [
{
"timestamp": "2026-01-01T00:00:00Z",
"cpu_percent": 12.5,
"ram_mb": 480,
"db_storage_gb": 2.4
},
{
"timestamp": "2026-01-01T01:00:00Z",
"cpu_percent": 18.3,
"ram_mb": 520,
"db_storage_gb": 2.4
}
]
}
}
GET /api/v1/usage/summary
Get platform-wide usage summary across all your instances.
Request
curl -X GET "https://vedtechsolutions.com/api/v1/usage/summary" \ -H "X-API-Key: your_api_key"
Response
{
"success": true,
"data": {
"total_instances": 3,
"running_instances": 2,
"stopped_instances": 1,
"aggregate_usage": {
"total_cpu_cores": 6,
"used_cpu_percent": 22.5,
"total_ram_mb": 8192,
"used_ram_mb": 1536,
"total_db_storage_gb": 50,
"used_db_storage_gb": 8.5,
"total_file_storage_gb": 100,
"used_file_storage_gb": 12.3
}
}
}
Use Cases
- Monitoring Dashboards: Build custom dashboards to track resource usage
- Alerting: Set up alerts when usage exceeds thresholds
- Capacity Planning: Analyze historical data to predict growth
- Cost Optimization: Identify underutilized instances