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": [
|
||||
|
||||
@@ -166,6 +166,37 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/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",
|
||||
@@ -2695,6 +2726,43 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"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": [
|
||||
|
||||
@@ -374,6 +374,33 @@ definitions:
|
||||
example: agent-001
|
||||
type: string
|
||||
type: object
|
||||
internal_handlers.AgentSystemMetricsOut:
|
||||
properties:
|
||||
connected_at:
|
||||
example: "2026-04-04 10:30:00"
|
||||
type: string
|
||||
cpu_percent:
|
||||
example: 45.2
|
||||
type: number
|
||||
disk_percent:
|
||||
example: 78.9
|
||||
type: number
|
||||
id:
|
||||
example: agent-001
|
||||
type: string
|
||||
label:
|
||||
example: web-server-1
|
||||
type: string
|
||||
memory_percent:
|
||||
example: 62.5
|
||||
type: number
|
||||
network_rx_bytes:
|
||||
example: 1048576
|
||||
type: number
|
||||
network_tx_bytes:
|
||||
example: 524288
|
||||
type: number
|
||||
type: object
|
||||
internal_handlers.CheckCmdIn:
|
||||
properties:
|
||||
command:
|
||||
@@ -619,6 +646,26 @@ paths:
|
||||
summary: Create registration token
|
||||
tags:
|
||||
- agents
|
||||
/agents/system-metrics:
|
||||
get:
|
||||
consumes:
|
||||
- application/json
|
||||
description: Returns CPU, RAM, disk, and network usage metrics for all connected
|
||||
agents
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: OK
|
||||
schema:
|
||||
items:
|
||||
$ref: '#/definitions/internal_handlers.AgentSystemMetricsOut'
|
||||
type: array
|
||||
security:
|
||||
- Bearer: []
|
||||
summary: Get agent system metrics
|
||||
tags:
|
||||
- agents
|
||||
/auth/login:
|
||||
post:
|
||||
consumes:
|
||||
|
||||
Reference in New Issue
Block a user