Deployments API
Trigger and manage deployments.
List Deployments
http
GET /api/v1/deploymentsQuery Parameters
| Parameter | Type | Description |
|---|---|---|
service | string | Filter by service |
status | string | Filter by status (pending, running, success, failed) |
from | string | Start date |
to | string | End date |
Response
json
{
"data": [
{
"id": "dpl_abc123",
"service": "api-gateway",
"version": "v2.4.1",
"status": "success",
"strategy": "rolling",
"started_at": "2025-01-15T10:00:00Z",
"completed_at": "2025-01-15T10:05:00Z",
"triggered_by": "john@example.com"
}
]
}Get Deployment
http
GET /api/v1/deployments/:idTrigger Deployment
http
POST /api/v1/deploymentsRequest Body
json
{
"service": "api-gateway",
"version": "v2.4.1",
"strategy": "rolling",
"options": {
"max_unavailable": 1,
"health_check_timeout": "60s"
}
}Deployment Strategies
| Strategy | Description |
|---|---|
rolling | Gradual replacement of instances |
blue-green | Switch traffic to new version |
canary | Gradual traffic shift (10%, 50%, 100%) |
recreate | Stop all, then start new |
Response
json
{
"data": {
"id": "dpl_xyz789",
"service": "api-gateway",
"version": "v2.4.1",
"status": "pending",
"started_at": "2025-01-15T10:00:00Z"
}
}Rollback Deployment
http
POST /api/v1/deployments/:id/rollbackOr rollback to specific version:
json
{
"target_version": "v2.4.0"
}Cancel Deployment
http
POST /api/v1/deployments/:id/cancelDeployment Logs
http
GET /api/v1/deployments/:id/logsjson
{
"data": {
"logs": [
{ "timestamp": "2025-01-15T10:00:00Z", "message": "Starting deployment..." },
{ "timestamp": "2025-01-15T10:00:05Z", "message": "Pulling image v2.4.1..." },
{ "timestamp": "2025-01-15T10:00:30Z", "message": "Starting new instances..." }
]
}
}