Files
EdgeCommon/pkg/rpc/protos/service_admin.proto

282 lines
6.1 KiB
Protocol Buffer
Raw Normal View History

2020-09-13 19:27:47 +08:00
syntax = "proto3";
option go_package = "./pb";
package pb;
import "models/model_admin.proto";
import "models/model_admin_list.proto";
import "models/rpc_messages.proto";
2021-07-19 17:58:09 +08:00
import "service_server_stat_board.proto";
2020-09-13 19:27:47 +08:00
service AdminService {
// 登录
2020-10-13 20:05:18 +08:00
rpc loginAdmin (LoginAdminRequest) returns (LoginAdminResponse);
2020-09-13 19:27:47 +08:00
// 检查管理员是否存在
2020-10-13 20:05:18 +08:00
rpc checkAdminExists (CheckAdminExistsRequest) returns (CheckAdminExistsResponse);
2020-09-13 19:27:47 +08:00
2020-10-14 19:42:28 +08:00
// 检查用户名是否存在
rpc checkAdminUsername (CheckAdminUsernameRequest) returns (CheckAdminUsernameResponse);
2020-09-13 19:27:47 +08:00
// 获取管理员名称
2020-10-13 20:05:18 +08:00
rpc findAdminFullname (FindAdminFullnameRequest) returns (FindAdminFullnameResponse);
2020-09-13 19:27:47 +08:00
2020-10-14 19:42:28 +08:00
// 获取管理员信息
rpc findEnabledAdmin (FindEnabledAdminRequest) returns (FindEnabledAdminResponse);
2020-10-13 20:05:18 +08:00
// 创建或修改管理员
rpc createOrUpdateAdmin (CreateOrUpdateAdminRequest) returns (CreateOrUpdateAdminResponse);
2020-10-14 19:42:28 +08:00
// 修改管理员信息
rpc updateAdminInfo (UpdateAdminInfoRequest) returns (RPCSuccess);
2020-10-14 19:42:28 +08:00
// 修改管理员登录信息
rpc updateAdminLogin (UpdateAdminLoginRequest) returns (RPCSuccess);
// 获取所有管理员的权限列表
rpc findAllAdminModules (FindAllAdminModulesRequest) returns (FindAllAdminModulesResponse);
// 创建管理员
rpc createAdmin (CreateAdminRequest) returns (CreateAdminResponse);
// 修改管理员
rpc updateAdmin (UpdateAdminRequest) returns (RPCSuccess);
// 计算管理员数量
rpc countAllEnabledAdmins (CountAllEnabledAdminsRequest) returns (RPCCountResponse);
// 列出单页的管理员
rpc listEnabledAdmins (ListEnabledAdminsRequest) returns (ListEnabledAdminsResponse);
// 删除管理员
rpc deleteAdmin (DeleteAdminRequest) returns (RPCSuccess);
// 根据用户名检查是否需要输入OTP
rpc checkAdminOTPWithUsername (CheckAdminOTPWithUsernameRequest) returns (CheckAdminOTPWithUsernameResponse);
2021-01-21 18:56:12 +08:00
// 取得管理员Dashboard数据
rpc composeAdminDashboard (ComposeAdminDashboardRequest) returns (ComposeAdminDashboardResponse);
2021-07-12 10:21:45 +08:00
// 修改管理员使用的界面风格
rpc updateAdminTheme (UpdateAdminThemeRequest) returns (RPCSuccess);
2020-09-13 19:27:47 +08:00
}
2020-10-13 20:05:18 +08:00
// 登录
2020-09-13 19:27:47 +08:00
message LoginAdminRequest {
string username = 1;
string password = 2;
}
message LoginAdminResponse {
int64 adminId = 1;
bool isOk = 2;
string message = 3;
}
2020-10-13 20:05:18 +08:00
// 检查管理员是否存在
2020-09-13 19:27:47 +08:00
message CheckAdminExistsRequest {
int64 adminId = 1;
}
message CheckAdminExistsResponse {
bool isOk = 1;
string message = 2;
}
2020-10-14 19:42:28 +08:00
// 检查用户名是否存在
message CheckAdminUsernameRequest {
int64 adminId = 1;
string username = 2;
}
message CheckAdminUsernameResponse {
bool exists = 1;
}
2020-10-13 20:05:18 +08:00
// 获取管理员名称
2020-09-13 19:27:47 +08:00
message FindAdminFullnameRequest {
int64 adminId = 1;
}
message FindAdminFullnameResponse {
string fullname = 1;
}
2020-10-14 19:42:28 +08:00
// 获取管理员信息
message FindEnabledAdminRequest {
int64 adminId = 1;
}
message FindEnabledAdminResponse {
Admin admin = 1;
}
2020-10-13 20:05:18 +08:00
// 创建或修改管理员
message CreateOrUpdateAdminRequest {
string username = 1;
string password = 2;
}
message CreateOrUpdateAdminResponse {
int64 adminId = 1;
2020-10-14 19:42:28 +08:00
}
// 修改管理员信息
message UpdateAdminInfoRequest {
2020-10-14 19:42:28 +08:00
int64 adminId = 1;
string fullname = 2;
}
// 修改管理员登录信息
message UpdateAdminLoginRequest {
int64 adminId = 1;
string username = 2;
string password = 3;
}
// 获取管理所有权限列表
message FindAllAdminModulesRequest {
}
message FindAllAdminModulesResponse {
repeated AdminModuleList adminModules = 1;
}
// 创建管理员
message CreateAdminRequest {
string username = 1;
string password = 2;
string fullname = 3;
bytes modulesJSON = 4;
bool isSuper = 5;
bool canLogin = 6;
}
message CreateAdminResponse {
int64 adminId = 1;
}
// 修改管理员
message UpdateAdminRequest {
int64 adminId = 1;
string username = 2;
string password = 3;
string fullname = 4;
bytes modulesJSON = 5;
bool isSuper = 6;
bool isOn = 7;
bool canLogin = 8;
}
// 计算管理员数量
message CountAllEnabledAdminsRequest {
}
// 列出单页的管理员
message ListEnabledAdminsRequest {
int64 offset = 1;
int64 size = 2;
}
message ListEnabledAdminsResponse {
repeated Admin admins = 1;
}
// 删除管理员
message DeleteAdminRequest {
int64 adminId = 1;
}
// 根据用户名检查是否需要输入OTP
message CheckAdminOTPWithUsernameRequest {
string username = 1;
}
message CheckAdminOTPWithUsernameResponse {
bool requireOTP = 1;
2021-01-21 18:56:12 +08:00
}
// 取得管理员Dashboard数据
message ComposeAdminDashboardRequest {
2021-08-23 09:59:43 +08:00
string apiVersion = 1;
2021-01-21 18:56:12 +08:00
}
message ComposeAdminDashboardResponse {
int64 countNodeClusters = 1;
int64 countNodes = 2;
2021-09-27 09:23:30 +08:00
int64 countOfflineNodes = 9;
2021-01-21 18:56:12 +08:00
int64 countServers = 3;
int64 countUsers = 4;
int64 countAPINodes = 5;
2021-09-27 09:23:30 +08:00
int64 countOfflineAPINodes = 10;
2021-01-21 18:56:12 +08:00
int64 countDBNodes = 6;
2021-09-27 09:23:30 +08:00
int64 countOfflineDBNodes = 11;
2021-01-21 18:56:12 +08:00
int64 countUserNodes = 7;
2021-09-27 09:23:30 +08:00
int64 countOfflineUserNodes = 12;
2021-08-25 11:41:13 +08:00
int64 defaultNodeClusterId = 8;
2021-01-21 18:56:12 +08:00
repeated DailyTrafficStat dailyTrafficStats = 30;
repeated HourlyTrafficStat hourlyTrafficStats = 31;
2021-07-13 15:49:34 +08:00
2021-05-11 22:47:44 +08:00
UpgradeInfo nodeUpgradeInfo = 32;
UpgradeInfo apiNodeUpgradeInfo = 33;
UpgradeInfo monitorNodeUpgradeInfo = 34;
UpgradeInfo userNodeUpgradeInfo = 35;
UpgradeInfo authorityNodeUpgradeInfo = 36;
2021-06-02 11:53:15 +08:00
UpgradeInfo nsNodeUpgradeInfo = 37;
2021-09-08 19:35:28 +08:00
UpgradeInfo reportNodeUpgradeInfo = 41;
2021-01-21 18:56:12 +08:00
2021-07-13 15:49:34 +08:00
repeated NodeStat topNodeStats = 38;
repeated DomainStat topDomainStats = 39;
2021-07-19 17:58:09 +08:00
repeated MetricDataChart metricDataCharts = 40;
2021-01-21 18:56:12 +08:00
message DailyTrafficStat {
string day = 1;
int64 bytes = 2;
2021-07-13 15:49:34 +08:00
int64 cachedBytes = 3;
int64 countRequests = 4;
int64 countCachedRequests = 5;
int64 countAttackRequests = 6;
int64 attackBytes = 7;
2021-01-21 18:56:12 +08:00
}
message HourlyTrafficStat {
string hour = 1;
int64 bytes = 2;
2021-07-13 15:49:34 +08:00
int64 cachedBytes = 3;
int64 countRequests = 4;
int64 countCachedRequests = 5;
int64 countAttackRequests = 6;
int64 attackBytes = 7;
}
message NodeStat {
int64 nodeId = 1;
string nodeName = 2;
int64 countRequests = 3;
int64 bytes = 4;
}
message DomainStat {
int64 serverId = 1;
string domain = 2;
int64 countRequests = 3;
int64 bytes = 4;
2021-01-21 18:56:12 +08:00
}
2021-05-11 22:47:44 +08:00
// 节点升级信息
message UpgradeInfo {
int64 countNodes = 1;
string newVersion = 2;
}
2021-07-12 10:21:45 +08:00
}
// 修改管理员使用的界面风格
message UpdateAdminThemeRequest {
int64 adminId = 1;
string theme = 2;
2020-10-13 20:05:18 +08:00
}