2020-09-13 19:27:47 +08:00
|
|
|
syntax = "proto3";
|
|
|
|
|
option go_package = "./pb";
|
|
|
|
|
|
|
|
|
|
package pb;
|
2021-01-25 16:41:30 +08:00
|
|
|
import "models/model_api_node.proto";
|
|
|
|
|
import "models/rpc_messages.proto";
|
2020-09-13 19:27:47 +08:00
|
|
|
|
|
|
|
|
service APINodeService {
|
|
|
|
|
// 创建API节点
|
|
|
|
|
rpc createAPINode (CreateAPINodeRequest) returns (CreateAPINodeResponse);
|
|
|
|
|
|
|
|
|
|
// 修改API节点
|
2020-11-13 18:23:06 +08:00
|
|
|
rpc updateAPINode (UpdateAPINodeRequest) returns (RPCSuccess);
|
2020-09-13 19:27:47 +08:00
|
|
|
|
|
|
|
|
// 删除API节点
|
2020-11-13 18:23:06 +08:00
|
|
|
rpc deleteAPINode (DeleteAPINodeRequest) returns (RPCSuccess);
|
2020-09-13 19:27:47 +08:00
|
|
|
|
|
|
|
|
// 列出所有可用API节点
|
|
|
|
|
rpc findAllEnabledAPINodes (FindAllEnabledAPINodesRequest) returns (FindAllEnabledAPINodesResponse);
|
|
|
|
|
|
|
|
|
|
// 计算API节点数量
|
2020-11-12 14:41:23 +08:00
|
|
|
rpc countAllEnabledAPINodes (CountAllEnabledAPINodesRequest) returns (RPCCountResponse);
|
2020-09-13 19:27:47 +08:00
|
|
|
|
2021-11-05 15:35:35 +08:00
|
|
|
// 计算启用的API节点数量
|
|
|
|
|
rpc countAllEnabledAndOnAPINodes (CountAllEnabledAndOnAPINodesRequest) returns (RPCCountResponse);
|
|
|
|
|
|
2020-09-13 19:27:47 +08:00
|
|
|
// 列出单页的API节点
|
|
|
|
|
rpc listEnabledAPINodes (ListEnabledAPINodesRequest) returns (ListEnabledAPINodesResponse);
|
|
|
|
|
|
|
|
|
|
// 根据ID查找节点
|
|
|
|
|
rpc findEnabledAPINode (FindEnabledAPINodeRequest) returns (FindEnabledAPINodeResponse);
|
2020-10-13 20:05:18 +08:00
|
|
|
|
|
|
|
|
// 获取当前API节点的版本
|
|
|
|
|
rpc findCurrentAPINodeVersion (FindCurrentAPINodeVersionRequest) returns (FindCurrentAPINodeVersionResponse);
|
2021-11-05 17:56:30 +08:00
|
|
|
|
2021-11-21 09:41:38 +08:00
|
|
|
// 获取当前API节点的信息
|
|
|
|
|
rpc findCurrentAPINode(FindCurrentAPINodeRequest) returns (FindCurrentAPINodeResponse);
|
|
|
|
|
|
2021-11-05 17:56:30 +08:00
|
|
|
// 计算使用某个SSL证书的API节点数量
|
|
|
|
|
rpc countAllEnabledAPINodesWithSSLCertId (CountAllEnabledAPINodesWithSSLCertIdRequest) returns (RPCCountResponse);
|
2020-09-13 19:27:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 创建API节点
|
|
|
|
|
message CreateAPINodeRequest {
|
|
|
|
|
string name = 1;
|
|
|
|
|
string description = 2;
|
2020-10-04 16:10:19 +08:00
|
|
|
bytes httpJSON = 3;
|
|
|
|
|
bytes httpsJSON = 4;
|
|
|
|
|
bytes accessAddrsJSON = 5;
|
|
|
|
|
bool isOn = 6;
|
2021-01-01 20:48:30 +08:00
|
|
|
bool restIsOn = 7;
|
|
|
|
|
bytes restHTTPJSON = 8;
|
|
|
|
|
bytes restHTTPSJSON = 9;
|
2020-09-13 19:27:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message CreateAPINodeResponse {
|
2021-11-05 15:35:35 +08:00
|
|
|
int64 apiNodeId = 1;
|
2020-09-13 19:27:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 修改API节点
|
|
|
|
|
message UpdateAPINodeRequest {
|
2021-11-05 15:35:35 +08:00
|
|
|
int64 apiNodeId = 1;
|
2020-09-13 19:27:47 +08:00
|
|
|
string name = 2;
|
|
|
|
|
string description = 3;
|
2020-10-04 16:10:19 +08:00
|
|
|
bytes httpJSON = 4;
|
|
|
|
|
bytes httpsJSON = 5;
|
|
|
|
|
bytes accessAddrsJSON = 6;
|
|
|
|
|
bool isOn = 7;
|
2021-01-01 20:48:30 +08:00
|
|
|
bool restIsOn = 8;
|
|
|
|
|
bytes restHTTPJSON = 9;
|
|
|
|
|
bytes restHTTPSJSON = 10;
|
2020-09-13 19:27:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 删除API节点
|
|
|
|
|
message DeleteAPINodeRequest {
|
2021-11-05 15:35:35 +08:00
|
|
|
int64 apiNodeId = 1;
|
2020-09-13 19:27:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 列出所有可用API节点
|
|
|
|
|
message FindAllEnabledAPINodesRequest {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message FindAllEnabledAPINodesResponse {
|
2021-11-05 15:35:35 +08:00
|
|
|
repeated APINode apiNodes = 1;
|
2020-09-13 19:27:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 计算API节点数量
|
|
|
|
|
message CountAllEnabledAPINodesRequest {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-05 15:35:35 +08:00
|
|
|
// 计算启用的API节点数量
|
|
|
|
|
message CountAllEnabledAndOnAPINodesRequest {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2020-09-13 19:27:47 +08:00
|
|
|
// 列出单页的API节点
|
|
|
|
|
message ListEnabledAPINodesRequest {
|
|
|
|
|
int64 offset = 1;
|
|
|
|
|
int64 size = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message ListEnabledAPINodesResponse {
|
2021-11-05 15:35:35 +08:00
|
|
|
repeated APINode apiNodes = 1;
|
2020-09-13 19:27:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 根据ID查找节点
|
|
|
|
|
message FindEnabledAPINodeRequest {
|
2021-11-05 15:35:35 +08:00
|
|
|
int64 apiNodeId = 1;
|
2020-09-13 19:27:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message FindEnabledAPINodeResponse {
|
2021-11-05 15:35:35 +08:00
|
|
|
APINode apiNode = 1;
|
2020-10-13 20:05:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 获取当前API节点的版本
|
|
|
|
|
message FindCurrentAPINodeVersionRequest {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message FindCurrentAPINodeVersionResponse {
|
|
|
|
|
string version = 1;
|
2021-11-05 17:56:30 +08:00
|
|
|
}
|
|
|
|
|
|
2021-11-21 09:41:38 +08:00
|
|
|
// 获取当前API节点的信息
|
|
|
|
|
message FindCurrentAPINodeRequest {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message FindCurrentAPINodeResponse {
|
|
|
|
|
APINode apiNode = 1;
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-05 17:56:30 +08:00
|
|
|
// 计算使用某个SSL证书的API节点数量
|
|
|
|
|
message CountAllEnabledAPINodesWithSSLCertIdRequest {
|
|
|
|
|
int64 sslCertId = 1;
|
2021-11-21 09:41:38 +08:00
|
|
|
}
|