Some checks failed
Build docker and publish / prepare (push) Has been cancelled
Build docker and publish / build (map[dockerfile:deploy/Dockerfile.admin image_name:ppanel-admin name:admin]) (push) Has been cancelled
Build docker and publish / build (map[dockerfile:deploy/Dockerfile.api image_name:ppanel-api name:api]) (push) Has been cancelled
Build docker and publish / build (map[dockerfile:deploy/Dockerfile.node image_name:ppanel-node name:node]) (push) Has been cancelled
Build docker and publish / build (map[dockerfile:deploy/Dockerfile.queue image_name:ppanel-queue name:queue]) (push) Has been cancelled
Build docker and publish / build (map[dockerfile:deploy/Dockerfile.scheduler image_name:ppanel-scheduler name:scheduler]) (push) Has been cancelled
Build docker and publish / deploy (push) Has been cancelled
Build docker and publish / notify (push) Has been cancelled
71 lines
1.4 KiB
Plaintext
71 lines
1.4 KiB
Plaintext
syntax = "v1"
|
|
|
|
info (
|
|
title: "节点通信接口"
|
|
)
|
|
|
|
type (
|
|
PushStatusReq {
|
|
CPU float64 `json:"cpu"`
|
|
Mem float64 `json:"mem"`
|
|
Disk float64 `json:"disk"`
|
|
OnlineUsers int `json:"online_users"`
|
|
Uptime int64 `json:"uptime"`
|
|
}
|
|
|
|
UserTraffic {
|
|
UserId int64 `json:"user_id"`
|
|
Upload int64 `json:"upload"`
|
|
Download int64 `json:"download"`
|
|
}
|
|
|
|
PushUserTrafficReq {
|
|
Data []UserTraffic `json:"data"`
|
|
}
|
|
|
|
OnlineUser {
|
|
UserId int64 `json:"user_id"`
|
|
IP string `json:"ip"`
|
|
}
|
|
|
|
PushOnlineUsersReq {
|
|
Data []OnlineUser `json:"data"`
|
|
}
|
|
|
|
ServerConfigResp {
|
|
Id int64 `json:"id"`
|
|
Name string `json:"name"`
|
|
Protocol string `json:"protocol"`
|
|
Config map[string]string `json:"config"`
|
|
}
|
|
|
|
ServerUserResp {
|
|
Id int64 `json:"id"`
|
|
Token string `json:"token"`
|
|
Speed int64 `json:"speed"`
|
|
DeviceLimit int `json:"device_limit"`
|
|
}
|
|
)
|
|
|
|
@server (
|
|
prefix: /api/v1/node
|
|
group: node
|
|
middleware: NodeAuthMiddleware
|
|
)
|
|
service ppanelnode {
|
|
@handler GetServerConfigHandler
|
|
get /config returns (ServerConfigResp)
|
|
|
|
@handler GetServerUserListHandler
|
|
get /users returns ([]ServerUserResp)
|
|
|
|
@handler PushStatusHandler
|
|
post /status (PushStatusReq)
|
|
|
|
@handler PushUserTrafficHandler
|
|
post /traffic (PushUserTrafficReq)
|
|
|
|
@handler PushOnlineUsersHandler
|
|
post /online (PushOnlineUsersReq)
|
|
}
|