Skip to content

Commit e8aa47f

Browse files
committed
add get open connections endpoint
1 parent 6a1fe10 commit e8aa47f

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

pkg/zos_api/admin.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ func (g *ZosAPI) adminShowResolveHandler(ctx context.Context, payload []byte) (i
6060
return os.ReadFile(path)
6161
}
6262

63+
func (g *ZosAPI) adminShowOpenConnectionsHandler(ctx context.Context, payload []byte) (interface{}, error) {
64+
return g.statisticsStub.OpenConnections(ctx)
65+
}
66+
6367
func (g *ZosAPI) adminInterfacesHandler(ctx context.Context, payload []byte) (interface{}, error) {
6468
// list all interfaces on node
6569
type Interface struct {

pkg/zos_api/routes.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ func (g *ZosAPI) SetupRoutes(router *peer.Router) {
4949
admin.WithHandler("restart", g.adminRestartServiceHandler)
5050
admin.WithHandler("restart_all", g.adminRestartAllHandler)
5151

52-
admin.WithHandler("show_logs", g.adminShowLogsHandler)
52+
admin.WithHandler("logs", g.adminShowLogsHandler)
5353
admin.WithHandler("show_resolve", g.adminShowResolveHandler)
54+
admin.WithHandler("get_open_connections", g.adminShowOpenConnectionsHandler)
5455

5556
admin.WithHandler("interfaces", g.adminInterfacesHandler)
5657
admin.WithHandler("set_public_nic", g.adminSetPublicNICHandler)

0 commit comments

Comments
 (0)