Get cached Docker Swarm cluster status including comprehensive node information.

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:

{
  "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:

{
  "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"
    }
  }
}
get/api/v1/status/swarm

Response

Success

object required

Changes

No recorded changes to this endpoint across all 1 revision of this API.