mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-18 15:23:51 +01:00
feat(api): add endpoint to retrieve container stats
- Introduced a new GET endpoint `/docker/stats/:id` to fetch statistics for a specified container by its ID or route alias. - Implemented the `Stats` function in the `dockerapi` package to handle the request and return container stats in both JSON and WebSocket formats. - Added error handling for invalid requests and container not found scenarios.
This commit is contained in:
@@ -140,6 +140,7 @@ func NewHandler(requireAuth bool) *gin.Engine {
|
||||
docker.POST("/start", dockerApi.Start)
|
||||
docker.POST("/stop", dockerApi.Stop)
|
||||
docker.POST("/restart", dockerApi.Restart)
|
||||
docker.GET("/stats/:id", dockerApi.Stats)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user