Skip to content

Deployments API

Trigger and manage deployments.

List Deployments

http
GET /api/v1/deployments

Query Parameters

ParameterTypeDescription
servicestringFilter by service
statusstringFilter by status (pending, running, success, failed)
fromstringStart date
tostringEnd 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/:id

Trigger Deployment

http
POST /api/v1/deployments

Request Body

json
{
  "service": "api-gateway",
  "version": "v2.4.1",
  "strategy": "rolling",
  "options": {
    "max_unavailable": 1,
    "health_check_timeout": "60s"
  }
}

Deployment Strategies

StrategyDescription
rollingGradual replacement of instances
blue-greenSwitch traffic to new version
canaryGradual traffic shift (10%, 50%, 100%)
recreateStop 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/rollback

Or rollback to specific version:

json
{
  "target_version": "v2.4.0"
}

Cancel Deployment

http
POST /api/v1/deployments/:id/cancel

Deployment Logs

http
GET /api/v1/deployments/:id/logs
json
{
  "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..." }
    ]
  }
}

Released under the MIT License.