Skip to content

Services API

Manage and monitor services.

List Services

http
GET /api/v1/services

Query Parameters

ParameterTypeDescription
statusstringFilter by status (healthy, unhealthy, unknown)
typestringFilter by type (docker, kubernetes, http)
pageintegerPage number (default: 1)
per_pageintegerItems per page (default: 20, max: 100)

Response

json
{
  "data": [
    {
      "id": "svc_abc123",
      "name": "api-gateway",
      "type": "docker",
      "status": "healthy",
      "instances": 3,
      "created_at": "2025-01-15T10:00:00Z",
      "updated_at": "2025-01-15T12:30:00Z"
    }
  ],
  "meta": {
    "page": 1,
    "per_page": 20,
    "total": 45
  }
}

Get Service

http
GET /api/v1/services/:id

Response

json
{
  "data": {
    "id": "svc_abc123",
    "name": "api-gateway",
    "type": "docker",
    "status": "healthy",
    "instances": 3,
    "health_check": {
      "endpoint": "/health",
      "interval": "30s",
      "timeout": "5s"
    },
    "metrics": {
      "cpu_percent": 45.2,
      "memory_mb": 512,
      "requests_per_sec": 1250
    },
    "created_at": "2025-01-15T10:00:00Z"
  }
}

Create Service

http
POST /api/v1/services

Request Body

json
{
  "name": "my-service",
  "type": "http",
  "url": "https://my-service.example.com",
  "health_check": {
    "endpoint": "/health",
    "interval": "30s"
  }
}

Response

json
{
  "data": {
    "id": "svc_xyz789",
    "name": "my-service",
    "status": "unknown"
  }
}

Update Service

http
PATCH /api/v1/services/:id

Delete Service

http
DELETE /api/v1/services/:id

Returns 204 No Content on success.

Released under the MIT License.