2020-09-13 19:27:47 +08:00
|
|
|
syntax = "proto3";
|
|
|
|
|
option go_package = "./pb";
|
|
|
|
|
|
|
|
|
|
package pb;
|
2020-09-17 10:15:55 +08:00
|
|
|
|
2020-09-13 19:27:47 +08:00
|
|
|
import "model_server.proto";
|
2020-09-17 10:15:55 +08:00
|
|
|
import "rpc_messages.proto";
|
2020-09-13 19:27:47 +08:00
|
|
|
|
|
|
|
|
service ServerService {
|
|
|
|
|
// 创建服务
|
|
|
|
|
rpc createServer (CreateServerRequest) returns (CreateServerResponse);
|
|
|
|
|
|
2020-09-15 14:44:38 +08:00
|
|
|
// 修改服务基本信息
|
2020-09-17 10:15:55 +08:00
|
|
|
rpc updateServerBasic (UpdateServerBasicRequest) returns (RPCUpdateSuccess);
|
2020-09-15 14:44:38 +08:00
|
|
|
|
|
|
|
|
// 修改服务的HTTP设置
|
2020-09-17 10:15:55 +08:00
|
|
|
rpc updateServerHTTP (UpdateServerHTTPRequest) returns (RPCUpdateSuccess);
|
2020-09-15 14:44:38 +08:00
|
|
|
|
|
|
|
|
// 修改服务的HTTPS设置
|
2020-09-17 10:15:55 +08:00
|
|
|
rpc updateServerHTTPS (UpdateServerHTTPSRequest) returns (RPCUpdateSuccess);
|
2020-09-15 14:44:38 +08:00
|
|
|
|
|
|
|
|
// 修改服务的TCP设置
|
2020-09-17 10:15:55 +08:00
|
|
|
rpc updateServerTCP (UpdateServerTCPRequest) returns (RPCUpdateSuccess);
|
2020-09-15 14:44:38 +08:00
|
|
|
|
|
|
|
|
// 修改服务的TLS设置
|
2020-09-17 10:15:55 +08:00
|
|
|
rpc updateServerTLS (UpdateServerTLSRequest) returns (RPCUpdateSuccess);
|
2020-09-15 14:44:38 +08:00
|
|
|
|
|
|
|
|
// 修改服务的Unix设置
|
2020-09-17 10:15:55 +08:00
|
|
|
rpc updateServerUnix (UpdateServerUnixRequest) returns (RPCUpdateSuccess);
|
2020-09-15 14:44:38 +08:00
|
|
|
|
|
|
|
|
// 修改服务的UDP设置
|
2020-09-17 10:15:55 +08:00
|
|
|
rpc updateServerUDP (UpdateServerUDPRequest) returns (RPCUpdateSuccess);
|
2020-09-15 14:44:38 +08:00
|
|
|
|
|
|
|
|
// 修改服务的Web设置
|
2020-09-17 10:15:55 +08:00
|
|
|
rpc updateServerWeb (UpdateServerWebRequest) returns (RPCUpdateSuccess);
|
2020-09-15 14:44:38 +08:00
|
|
|
|
|
|
|
|
// 修改服务的反向代理设置
|
2020-09-17 10:15:55 +08:00
|
|
|
rpc updateServerReverseProxy (UpdateServerReverseProxyRequest) returns (RPCUpdateSuccess);
|
2020-09-15 14:44:38 +08:00
|
|
|
|
|
|
|
|
// 修改服务的域名设置
|
2020-09-17 10:15:55 +08:00
|
|
|
rpc updateServerNames (UpdateServerNamesRequest) returns (RPCUpdateSuccess);
|
2020-09-13 19:27:47 +08:00
|
|
|
|
|
|
|
|
// 计算服务数量
|
|
|
|
|
rpc countAllEnabledServers (CountAllEnabledServersRequest) returns (CountAllEnabledServersResponse);
|
|
|
|
|
|
|
|
|
|
// 列出单页服务
|
|
|
|
|
rpc listEnabledServers (ListEnabledServersRequest) returns (ListEnabledServersResponse);
|
|
|
|
|
|
|
|
|
|
// 禁用某服务
|
|
|
|
|
rpc disableServer (DisableServerRequest) returns (DisableServerResponse);
|
|
|
|
|
|
|
|
|
|
// 查找单个服务
|
|
|
|
|
rpc findEnabledServer (FindEnabledServerRequest) returns (FindEnabledServerResponse);
|
2020-09-15 14:44:38 +08:00
|
|
|
|
|
|
|
|
// 查找服务的服务类型
|
|
|
|
|
rpc findEnabledServerType (FindEnabledServerTypeRequest) returns (FindEnabledServerTypeResponse);
|
|
|
|
|
|
|
|
|
|
// 查找反向代理设置
|
2020-09-21 11:37:09 +08:00
|
|
|
rpc findAndInitServerReverseProxyConfig (FindAndInitServerReverseProxyConfigRequest) returns (FindAndInitServerReverseProxyConfigResponse);
|
2020-09-16 09:09:31 +08:00
|
|
|
|
|
|
|
|
// 初始化Web设置
|
2020-09-21 19:52:10 +08:00
|
|
|
rpc findAndInitServerWebConfig (FindAndInitServerWebConfigRequest) returns (FindAndInitServerWebConfigResponse);
|
2020-09-30 17:46:33 +08:00
|
|
|
|
|
|
|
|
// 计算使用某个SSL证书的服务数量
|
|
|
|
|
rpc countServersWithSSLCertId (CountServersWithSSLCertIdRequest) returns (CountServersWithSSLCertIdResponse);
|
|
|
|
|
|
|
|
|
|
// 查找使用某个SSL证书的所有服务
|
|
|
|
|
rpc findAllServersWithSSLCertId (FindAllServersWithSSLCertIdRequest) returns (FindAllServersWithSSLCertIdResponse);
|
2020-09-13 19:27:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 创建服务
|
|
|
|
|
message CreateServerRequest {
|
|
|
|
|
int64 userId = 1;
|
|
|
|
|
int64 adminId = 2;
|
|
|
|
|
string type = 3;
|
|
|
|
|
string name = 4;
|
|
|
|
|
string description = 5;
|
2020-09-15 14:44:38 +08:00
|
|
|
|
|
|
|
|
// 配置相关
|
|
|
|
|
bytes serverNamesJON = 8;
|
|
|
|
|
bytes httpJSON = 9;
|
|
|
|
|
bytes httpsJSON = 10;
|
|
|
|
|
bytes tcpJSON = 11;
|
|
|
|
|
bytes tlsJSON = 12;
|
|
|
|
|
bytes unixJSON = 13;
|
|
|
|
|
bytes udpJSON = 14;
|
|
|
|
|
int64 webId = 15;
|
2020-09-21 11:37:09 +08:00
|
|
|
bytes reverseProxyJSON = 16;
|
2020-09-15 14:44:38 +08:00
|
|
|
|
|
|
|
|
int64 clusterId = 30;
|
|
|
|
|
bytes includeNodesJSON = 31;
|
|
|
|
|
bytes excludeNodesJSON = 32;
|
2020-09-13 19:27:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message CreateServerResponse {
|
|
|
|
|
int64 serverId = 1;
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-15 14:44:38 +08:00
|
|
|
// 修改服务基本信息
|
|
|
|
|
message UpdateServerBasicRequest {
|
2020-09-13 19:27:47 +08:00
|
|
|
int64 serverId = 1;
|
2020-09-15 14:44:38 +08:00
|
|
|
string name = 2;
|
|
|
|
|
string description = 3;
|
|
|
|
|
int64 clusterId = 4;
|
2020-09-28 16:25:49 +08:00
|
|
|
bool isOn = 5;
|
2020-09-15 14:44:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 修改服务的HTTP等设置
|
|
|
|
|
message UpdateServerHTTPRequest {
|
|
|
|
|
int64 serverId = 1;
|
|
|
|
|
bytes config = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message UpdateServerHTTPSRequest {
|
|
|
|
|
int64 serverId = 1;
|
|
|
|
|
bytes config = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message UpdateServerTCPRequest {
|
|
|
|
|
int64 serverId = 1;
|
|
|
|
|
bytes config = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message UpdateServerTLSRequest {
|
|
|
|
|
int64 serverId = 1;
|
|
|
|
|
bytes config = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message UpdateServerUnixRequest {
|
|
|
|
|
int64 serverId = 1;
|
|
|
|
|
bytes config = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message UpdateServerUDPRequest {
|
|
|
|
|
int64 serverId = 1;
|
|
|
|
|
bytes config = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message UpdateServerWebRequest {
|
|
|
|
|
int64 serverId = 1;
|
|
|
|
|
int64 webId = 2;
|
2020-09-13 19:27:47 +08:00
|
|
|
}
|
|
|
|
|
|
2020-09-15 14:44:38 +08:00
|
|
|
message UpdateServerReverseProxyRequest {
|
|
|
|
|
int64 serverId = 1;
|
2020-09-21 11:37:09 +08:00
|
|
|
bytes reverseProxyJSON = 2;
|
2020-09-15 14:44:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message UpdateServerNamesRequest {
|
|
|
|
|
int64 serverId = 1;
|
|
|
|
|
bytes config = 2;
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-13 19:27:47 +08:00
|
|
|
// 计算服务数量
|
|
|
|
|
message CountAllEnabledServersRequest {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message CountAllEnabledServersResponse {
|
|
|
|
|
int64 count = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 列出单页服务
|
|
|
|
|
message ListEnabledServersRequest {
|
|
|
|
|
int64 offset = 1;
|
|
|
|
|
int64 size = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message ListEnabledServersResponse {
|
|
|
|
|
repeated Server servers = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 禁用服务
|
|
|
|
|
message DisableServerRequest {
|
|
|
|
|
int64 serverId = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message DisableServerResponse {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 查找单个服务
|
|
|
|
|
message FindEnabledServerRequest {
|
|
|
|
|
int64 serverId = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message FindEnabledServerResponse {
|
|
|
|
|
Server server = 1;
|
2020-09-15 14:44:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 查找服务的服务类型
|
|
|
|
|
message FindEnabledServerTypeRequest {
|
|
|
|
|
int64 serverId = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message FindEnabledServerTypeResponse {
|
|
|
|
|
string type = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 查找反向代理设置
|
2020-09-21 11:37:09 +08:00
|
|
|
message FindAndInitServerReverseProxyConfigRequest {
|
2020-09-15 14:44:38 +08:00
|
|
|
int64 serverId = 1;
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-21 11:37:09 +08:00
|
|
|
message FindAndInitServerReverseProxyConfigResponse {
|
2020-09-21 19:52:10 +08:00
|
|
|
bytes reverseProxyJSON = 1;
|
|
|
|
|
bytes reverseProxyRefJSON = 2;
|
2020-09-16 09:09:31 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 初始化Web设置
|
2020-09-21 19:52:10 +08:00
|
|
|
message FindAndInitServerWebConfigRequest {
|
2020-09-16 09:09:31 +08:00
|
|
|
int64 serverId = 1;
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-21 19:52:10 +08:00
|
|
|
message FindAndInitServerWebConfigResponse {
|
|
|
|
|
bytes webJSON = 1;
|
2020-09-30 17:46:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 计算使用某个SSL证书的服务数量
|
|
|
|
|
message CountServersWithSSLCertIdRequest {
|
|
|
|
|
int64 certId = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message CountServersWithSSLCertIdResponse {
|
|
|
|
|
int64 count = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 查找使用某个SSL证书的所有服务
|
|
|
|
|
message FindAllServersWithSSLCertIdRequest {
|
|
|
|
|
int64 certId = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message FindAllServersWithSSLCertIdResponse {
|
|
|
|
|
repeated Server servers = 1;
|
2020-09-13 19:27:47 +08:00
|
|
|
}
|