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-11-17 11:22:23 +08:00
|
|
|
import "model_dns_domain.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-11-13 18:23:06 +08:00
|
|
|
rpc updateServerBasic (UpdateServerBasicRequest) returns (RPCSuccess);
|
2020-09-15 14:44:38 +08:00
|
|
|
|
|
|
|
|
// 修改服务的HTTP设置
|
2020-11-13 18:23:06 +08:00
|
|
|
rpc updateServerHTTP (UpdateServerHTTPRequest) returns (RPCSuccess);
|
2020-09-15 14:44:38 +08:00
|
|
|
|
|
|
|
|
// 修改服务的HTTPS设置
|
2020-11-13 18:23:06 +08:00
|
|
|
rpc updateServerHTTPS (UpdateServerHTTPSRequest) returns (RPCSuccess);
|
2020-09-15 14:44:38 +08:00
|
|
|
|
|
|
|
|
// 修改服务的TCP设置
|
2020-11-13 18:23:06 +08:00
|
|
|
rpc updateServerTCP (UpdateServerTCPRequest) returns (RPCSuccess);
|
2020-09-15 14:44:38 +08:00
|
|
|
|
|
|
|
|
// 修改服务的TLS设置
|
2020-11-13 18:23:06 +08:00
|
|
|
rpc updateServerTLS (UpdateServerTLSRequest) returns (RPCSuccess);
|
2020-09-15 14:44:38 +08:00
|
|
|
|
|
|
|
|
// 修改服务的Unix设置
|
2020-11-13 18:23:06 +08:00
|
|
|
rpc updateServerUnix (UpdateServerUnixRequest) returns (RPCSuccess);
|
2020-09-15 14:44:38 +08:00
|
|
|
|
|
|
|
|
// 修改服务的UDP设置
|
2020-11-13 18:23:06 +08:00
|
|
|
rpc updateServerUDP (UpdateServerUDPRequest) returns (RPCSuccess);
|
2020-09-15 14:44:38 +08:00
|
|
|
|
|
|
|
|
// 修改服务的Web设置
|
2020-11-13 18:23:06 +08:00
|
|
|
rpc updateServerWeb (UpdateServerWebRequest) returns (RPCSuccess);
|
2020-09-15 14:44:38 +08:00
|
|
|
|
|
|
|
|
// 修改服务的反向代理设置
|
2020-11-13 18:23:06 +08:00
|
|
|
rpc updateServerReverseProxy (UpdateServerReverseProxyRequest) returns (RPCSuccess);
|
2020-09-15 14:44:38 +08:00
|
|
|
|
2020-12-03 21:07:16 +08:00
|
|
|
// 查找服务的域名设置
|
|
|
|
|
rpc findServerNames (FindServerNamesRequest) returns (FindServerNamesResponse);
|
|
|
|
|
|
2020-09-15 14:44:38 +08:00
|
|
|
// 修改服务的域名设置
|
2020-11-13 18:23:06 +08:00
|
|
|
rpc updateServerNames (UpdateServerNamesRequest) returns (RPCSuccess);
|
2020-09-13 19:27:47 +08:00
|
|
|
|
2020-10-31 15:21:35 +08:00
|
|
|
// 计算匹配的服务数量
|
2020-11-12 14:41:23 +08:00
|
|
|
rpc countAllEnabledServersMatch (CountAllEnabledServersMatchRequest) returns (RPCCountResponse);
|
2020-09-13 19:27:47 +08:00
|
|
|
|
|
|
|
|
// 列出单页服务
|
2020-10-31 15:21:35 +08:00
|
|
|
rpc listEnabledServersMatch (ListEnabledServersMatchRequest) returns (ListEnabledServersMatchResponse);
|
2020-09-13 19:27:47 +08:00
|
|
|
|
|
|
|
|
// 禁用某服务
|
|
|
|
|
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证书的服务数量
|
2020-11-12 14:41:23 +08:00
|
|
|
rpc countAllEnabledServersWithSSLCertId (CountAllEnabledServersWithSSLCertIdRequest) returns (RPCCountResponse);
|
2020-09-30 17:46:33 +08:00
|
|
|
|
|
|
|
|
// 查找使用某个SSL证书的所有服务
|
2020-10-02 17:22:46 +08:00
|
|
|
rpc findAllEnabledServersWithSSLCertId (FindAllEnabledServersWithSSLCertIdRequest) returns (FindAllEnabledServersWithSSLCertIdResponse);
|
|
|
|
|
|
2020-10-25 16:22:40 +08:00
|
|
|
// 计算运行在某个集群上的所有服务数量
|
2020-11-12 14:41:23 +08:00
|
|
|
rpc countAllEnabledServersWithNodeClusterId (CountAllEnabledServersWithNodeClusterIdRequest) returns (RPCCountResponse);
|
2020-10-29 20:53:47 +08:00
|
|
|
|
|
|
|
|
// 计算使用某个分组的服务数量
|
2020-11-12 14:41:23 +08:00
|
|
|
rpc countAllEnabledServersWithGroupId (CountAllEnabledServersWithGroupIdRequest) returns (RPCCountResponse);
|
2020-11-02 10:45:07 +08:00
|
|
|
|
|
|
|
|
// 通知更新
|
|
|
|
|
rpc notifyServersChange (NotifyServersChangeRequest) returns (NotifyServersChangeResponse);
|
2020-11-14 11:05:49 +08:00
|
|
|
|
|
|
|
|
// 取得某个集群下的所有服务相关的DNS
|
|
|
|
|
rpc findAllEnabledServersDNSWithClusterId (FindAllEnabledServersDNSWithClusterIdRequest) returns (FindAllEnabledServersDNSWithClusterIdResponse);
|
2020-11-17 11:22:23 +08:00
|
|
|
|
|
|
|
|
// 查找单个服务的DNS信息
|
|
|
|
|
rpc findEnabledServerDNS (FindEnabledServerDNSRequest) returns (FindEnabledServerDNSResponse);
|
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-10-29 21:37:52 +08:00
|
|
|
repeated int64 groupIds = 17;
|
2020-09-15 14:44:38 +08:00
|
|
|
|
2020-12-17 15:51:09 +08:00
|
|
|
int64 nodeClusterId = 30;
|
2020-09-15 14:44:38 +08:00
|
|
|
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;
|
2020-12-17 15:51:09 +08:00
|
|
|
int64 nodeClusterId = 4;
|
2020-09-28 16:25:49 +08:00
|
|
|
bool isOn = 5;
|
2020-10-29 21:37:52 +08:00
|
|
|
repeated int64 groupIds = 6;
|
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
|
|
|
}
|
|
|
|
|
|
2020-12-03 21:07:16 +08:00
|
|
|
// 查找服务的域名设置
|
|
|
|
|
message FindServerNamesRequest {
|
|
|
|
|
int64 serverId = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message FindServerNamesResponse {
|
|
|
|
|
bytes serverNamesJSON = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 修改服务的域名设置
|
2020-09-15 14:44:38 +08:00
|
|
|
message UpdateServerNamesRequest {
|
|
|
|
|
int64 serverId = 1;
|
|
|
|
|
bytes config = 2;
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-13 19:27:47 +08:00
|
|
|
// 计算服务数量
|
2020-10-31 15:21:35 +08:00
|
|
|
message CountAllEnabledServersMatchRequest {
|
|
|
|
|
int64 groupId = 1;
|
|
|
|
|
string keyword = 2;
|
2020-12-18 21:19:25 +08:00
|
|
|
int64 userId = 3;
|
2020-09-13 19:27:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 列出单页服务
|
2020-10-31 15:21:35 +08:00
|
|
|
message ListEnabledServersMatchRequest {
|
2020-09-13 19:27:47 +08:00
|
|
|
int64 offset = 1;
|
|
|
|
|
int64 size = 2;
|
2020-10-31 15:21:35 +08:00
|
|
|
int64 groupId = 3;
|
|
|
|
|
string keyword = 4;
|
2020-12-18 21:19:25 +08:00
|
|
|
int64 userId = 5;
|
2020-09-13 19:27:47 +08:00
|
|
|
}
|
|
|
|
|
|
2020-10-31 15:21:35 +08:00
|
|
|
message ListEnabledServersMatchResponse {
|
2020-09-13 19:27:47 +08:00
|
|
|
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证书的服务数量
|
2020-10-02 17:22:46 +08:00
|
|
|
message CountAllEnabledServersWithSSLCertIdRequest {
|
2020-12-18 21:19:25 +08:00
|
|
|
int64 sslCertId = 1;
|
2020-09-30 17:46:33 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 查找使用某个SSL证书的所有服务
|
2020-10-02 17:22:46 +08:00
|
|
|
message FindAllEnabledServersWithSSLCertIdRequest {
|
2020-12-18 21:19:25 +08:00
|
|
|
int64 sslCertId = 1;
|
2020-09-30 17:46:33 +08:00
|
|
|
}
|
|
|
|
|
|
2020-10-02 17:22:46 +08:00
|
|
|
message FindAllEnabledServersWithSSLCertIdResponse {
|
|
|
|
|
repeated Server servers = 1;
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-25 16:22:40 +08:00
|
|
|
// 计算运行在某个集群上的所有服务数量
|
|
|
|
|
message CountAllEnabledServersWithNodeClusterIdRequest {
|
|
|
|
|
int64 nodeClusterId = 1;
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-29 20:53:47 +08:00
|
|
|
// 计算使用某个分组的服务数量
|
|
|
|
|
message CountAllEnabledServersWithGroupIdRequest {
|
|
|
|
|
int64 groupId = 1;
|
|
|
|
|
}
|
|
|
|
|
|
2020-11-02 10:45:07 +08:00
|
|
|
// 通知更新
|
|
|
|
|
message NotifyServersChangeRequest {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message NotifyServersChangeResponse {
|
|
|
|
|
|
2020-11-14 11:05:49 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 取得某个集群下的所有服务相关的DNS
|
|
|
|
|
message FindAllEnabledServersDNSWithClusterIdRequest {
|
2020-12-17 15:51:09 +08:00
|
|
|
int64 nodeClusterId = 1;
|
2020-11-14 11:05:49 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message FindAllEnabledServersDNSWithClusterIdResponse {
|
|
|
|
|
repeated ServerDNSInfo servers = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message ServerDNSInfo {
|
|
|
|
|
int64 id = 1;
|
|
|
|
|
string name = 2;
|
|
|
|
|
string dnsName = 3;
|
2020-11-17 11:22:23 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 查找单个服务的DNS信息
|
|
|
|
|
message FindEnabledServerDNSRequest {
|
|
|
|
|
int64 serverId = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message FindEnabledServerDNSResponse {
|
|
|
|
|
string dnsName = 1;
|
|
|
|
|
DNSDomain domain = 2;
|
2020-11-02 10:45:07 +08:00
|
|
|
}
|