---
title: "Get cached Docker Swarm cluster status including comprehensive node information."
method: GET
path: "/api/v1/status/swarm"
---

# Get cached Docker Swarm cluster status including comprehensive node information.

`GET /api/v1/status/swarm`

**Authentication**: JWT token required
**Access**: Restricted to ADMIN and SUPERADMIN users only
**Purpose**: Monitor Docker Swarm health, node resources, and capacity
**Performance**: Uses Redis-cached data updated every 2 minutes for fast response

**Response Schema**:
```json
{
  "data": {
    "swarm_active": true,
    "total_nodes": 3,
    "total_managers": 1,
    "total_workers": 2,
    "error": null,
    "cache_info": {
      "cached_at": "2025-01-15T10:30:00Z",
      "cache_ttl": 300,
      "cache_key": "docker_swarm_status",
      "source": "cached"
    },
    "nodes": [
      {
        "id": "node-id-123",
        "hostname": "manager-01",
        "role": "manager",
        "is_manager": true,
        "is_leader": true,
        "availability": "active",
        "state": "ready",
        "cpu_count": 4.0,
        "memory_gb": 8.0,
        "running_tasks": 3,
        "available_capacity": 37,
        "resource_usage": {
          "used_cpu_nanos": 300000000,
          "used_memory_bytes": 536870912,
          "available_cpu_nanos": 3700000000,
          "available_memory_bytes": 7548381184,
          "used_cpu_percent": 7.5,
          "used_memory_percent": 6.25
        },
        "labels": {"node.role": "manager"},
        "created_at": "2025-01-15T10:00:00Z",
        "updated_at": "2025-01-15T10:30:00Z"
      }
    ]
  }
}
```

**Data Source**:
- Uses cached Docker Swarm data from Redis (updated every 2 minutes)
- Resource calculations based on actual Docker Swarm task reservations
- Node capacity calculated from CPU/memory resources and current task load

**Error Responses**:
- 403: Access denied (non-admin user)
- 500: Server error

**Note**: When Docker is not in swarm mode or unavailable, returns:
```json
{
  "data": {
    "swarm_active": false,
    "error": "Not in swarm mode" | "Docker unavailable",
    "nodes": [],
    "total_nodes": 0,
    "total_managers": 0,
    "total_workers": 0,
    "cache_info": {
      "cached_at": "2025-01-15T10:30:00Z",
      "cache_ttl": 0,
      "cache_key": "docker_swarm_status",
      "source": "real_time_fallback" | "endpoint_error_fallback"
    }
  }
}
```

## Response `200`

Success

- object

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `500` — Internal Server Error

---

[API](https://skmtc.dev/trends/apis/trends-earth-api.md) · [All operations](https://skmtc.dev/trends/apis/trends-earth-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/trends/trends-earth-api/revisions/6bdbc0b84666/schema)
