RAM API Reference
Complete REST API documentation for RAM PostgreSQL clustering management.
API Overview
The RAM API provides RESTful endpoints for cluster management, monitoring, and administrative operations. All endpoints return JSON responses and support standard HTTP status codes.
🔗
RESTful
Standard HTTP methods and status codes
🔒
Secure
Token-based authentication and TLS support
📊
JSON
Structured JSON requests and responses
Authentication
Token Authentication
# Include token in Authorization header
curl -H "Authorization: Bearer your-token-here" \
http://localhost:8080/api/v1/status
# Or use API key header
curl -H "X-API-Key: your-api-key-here" \
http://localhost:8080/api/v1/status
Cluster Management
GET /api/v1/status
Get comprehensive cluster status
curl http://localhost:8080/api/v1/status
GET /api/v1/nodes
List all cluster nodes
curl http://localhost:8080/api/v1/nodes
POST /api/v1/nodes
Add a new node to the cluster
curl -X POST http://localhost:8080/api/v1/nodes \
-H "Content-Type: application/json" \
-d '{"id": "node4", "address": "192.168.1.13:8080"}'
Failover Operations
POST /api/v1/failover
Trigger manual failover
curl -X POST http://localhost:8080/api/v1/failover
Health and Metrics
GET /api/v1/health
Cluster health check
curl http://localhost:8080/api/v1/health
GET /api/v1/metrics
Prometheus metrics
curl http://localhost:8080/api/v1/metrics
Error Handling
HTTP Status Codes
Code | Description | Usage |
---|---|---|
200 | OK | Successful operation |
201 | Created | Resource created successfully |
400 | Bad Request | Invalid request parameters |
401 | Unauthorized | Authentication required |
403 | Forbidden | Insufficient permissions |
500 | Internal Server Error | Server error |