chore: add system metrics
This commit is contained in:
@@ -177,6 +177,37 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"/agents/system-metrics": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"Bearer": []
|
||||
}
|
||||
],
|
||||
"description": "Returns CPU, RAM, disk, and network usage metrics for all connected agents",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"agents"
|
||||
],
|
||||
"summary": "Get agent system metrics",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK",
|
||||
"schema": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"$ref": "#/definitions/internal_handlers.AgentSystemMetricsOut"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/auth/login": {
|
||||
"post": {
|
||||
"description": "Authenticate with login and password, returns a token and permissions",
|
||||
@@ -2706,6 +2737,43 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"internal_handlers.AgentSystemMetricsOut": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"connected_at": {
|
||||
"type": "string",
|
||||
"example": "2026-04-04 10:30:00"
|
||||
},
|
||||
"cpu_percent": {
|
||||
"type": "number",
|
||||
"example": 45.2
|
||||
},
|
||||
"disk_percent": {
|
||||
"type": "number",
|
||||
"example": 78.9
|
||||
},
|
||||
"id": {
|
||||
"type": "string",
|
||||
"example": "agent-001"
|
||||
},
|
||||
"label": {
|
||||
"type": "string",
|
||||
"example": "web-server-1"
|
||||
},
|
||||
"memory_percent": {
|
||||
"type": "number",
|
||||
"example": 62.5
|
||||
},
|
||||
"network_rx_bytes": {
|
||||
"type": "number",
|
||||
"example": 1048576
|
||||
},
|
||||
"network_tx_bytes": {
|
||||
"type": "number",
|
||||
"example": 524288
|
||||
}
|
||||
}
|
||||
},
|
||||
"internal_handlers.CheckCmdIn": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
|
||||
Reference in New Issue
Block a user