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_node_grant.proto";
|
|
|
|
|
import "models/rpc_messages.proto";
|
2020-09-13 19:27:47 +08:00
|
|
|
|
2022-06-25 19:22:19 +08:00
|
|
|
// 节点认证信息管理服务
|
2020-09-13 19:27:47 +08:00
|
|
|
service NodeGrantService {
|
|
|
|
|
// 创建认证
|
|
|
|
|
rpc createNodeGrant (CreateNodeGrantRequest) returns (CreateNodeGrantResponse);
|
|
|
|
|
|
|
|
|
|
// 修改认证
|
2020-11-13 18:23:06 +08:00
|
|
|
rpc updateNodeGrant (UpdateNodeGrantRequest) returns (RPCSuccess);
|
2020-09-13 19:27:47 +08:00
|
|
|
|
|
|
|
|
// 禁用认证
|
|
|
|
|
rpc disableNodeGrant (DisableNodeGrantRequest) returns (DisableNodeGrantResponse);
|
|
|
|
|
|
|
|
|
|
// 计算认证的数量
|
2020-11-12 14:41:23 +08:00
|
|
|
rpc countAllEnabledNodeGrants (CountAllEnabledNodeGrantsRequest) returns (RPCCountResponse);
|
2020-09-13 19:27:47 +08:00
|
|
|
|
|
|
|
|
// 列出单页认证
|
2021-04-18 21:19:14 +08:00
|
|
|
rpc listEnabledNodeGrants (ListEnabledNodeGrantsRequest) returns (ListEnabledNodeGrantsResponse);
|
2020-09-13 19:27:47 +08:00
|
|
|
|
|
|
|
|
// 列出所有认证
|
2021-04-18 21:19:14 +08:00
|
|
|
rpc findAllEnabledNodeGrants (FindAllEnabledNodeGrantsRequest) returns (FindAllEnabledNodeGrantsResponse);
|
2020-09-13 19:27:47 +08:00
|
|
|
|
|
|
|
|
// 获取单个认证信息
|
2021-04-18 21:19:14 +08:00
|
|
|
rpc findEnabledNodeGrant (FindEnabledNodeGrantRequest) returns (FindEnabledNodeGrantResponse);
|
|
|
|
|
|
|
|
|
|
// 测试连接
|
|
|
|
|
rpc testNodeGrant (TestNodeGrantRequest) returns (TestNodeGrantResponse);
|
2021-08-14 21:33:26 +08:00
|
|
|
|
|
|
|
|
// 查找集群推荐的认证
|
|
|
|
|
rpc findSuggestNodeGrants(FindSuggestNodeGrantsRequest) returns (FindSuggestNodeGrantsResponse);
|
2020-09-13 19:27:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 创建节点认证
|
|
|
|
|
message CreateNodeGrantRequest {
|
|
|
|
|
string name = 1;
|
|
|
|
|
string method = 2;
|
|
|
|
|
string username = 3;
|
|
|
|
|
string password = 4;
|
|
|
|
|
string privateKey = 5;
|
2021-11-06 15:31:11 +08:00
|
|
|
string passphrase = 8;
|
2020-09-13 19:27:47 +08:00
|
|
|
string description = 6;
|
|
|
|
|
int64 nodeId = 7;
|
2021-12-06 19:23:18 +08:00
|
|
|
bool su = 9;
|
2020-09-13 19:27:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message CreateNodeGrantResponse {
|
2021-04-18 21:19:14 +08:00
|
|
|
int64 nodeGrantId = 1;
|
2020-09-13 19:27:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 修改节点认证
|
|
|
|
|
message UpdateNodeGrantRequest {
|
2021-04-18 21:19:14 +08:00
|
|
|
int64 nodeGrantId = 8;
|
2020-09-13 19:27:47 +08:00
|
|
|
string name = 1;
|
|
|
|
|
string method = 2;
|
|
|
|
|
string username = 3;
|
|
|
|
|
string password = 4;
|
|
|
|
|
string privateKey = 5;
|
2021-11-06 15:31:11 +08:00
|
|
|
string passphrase = 9;
|
2020-09-13 19:27:47 +08:00
|
|
|
string description = 6;
|
|
|
|
|
int64 nodeId = 7;
|
2021-12-06 19:23:18 +08:00
|
|
|
bool su = 10;
|
2020-09-13 19:27:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 禁用节点认证
|
|
|
|
|
message DisableNodeGrantRequest {
|
2021-04-18 21:19:14 +08:00
|
|
|
int64 nodeGrantId = 1;
|
2020-09-13 19:27:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message DisableNodeGrantResponse {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 计算节点认证数量
|
|
|
|
|
message CountAllEnabledNodeGrantsRequest {
|
2021-05-23 21:13:30 +08:00
|
|
|
string keyword = 1;
|
2020-09-13 19:27:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 列出单页认证
|
|
|
|
|
message ListEnabledNodeGrantsRequest {
|
2021-05-23 21:13:30 +08:00
|
|
|
string keyword = 3;
|
2020-09-13 19:27:47 +08:00
|
|
|
int64 offset = 1;
|
|
|
|
|
int64 size = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message ListEnabledNodeGrantsResponse {
|
2021-04-18 21:19:14 +08:00
|
|
|
repeated NodeGrant nodeGrants = 1;
|
2020-09-13 19:27:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 获取所有认证信息
|
|
|
|
|
message FindAllEnabledNodeGrantsRequest {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message FindAllEnabledNodeGrantsResponse {
|
2021-04-18 21:19:14 +08:00
|
|
|
repeated NodeGrant nodeGrants = 1;
|
2020-09-13 19:27:47 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 获取认证信息
|
2021-04-18 21:19:14 +08:00
|
|
|
message FindEnabledNodeGrantRequest {
|
|
|
|
|
int64 nodeGrantId = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message FindEnabledNodeGrantResponse {
|
|
|
|
|
NodeGrant nodeGrant = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 测试连接
|
|
|
|
|
message TestNodeGrantRequest {
|
|
|
|
|
int64 nodeGrantId = 1;
|
|
|
|
|
string host = 2;
|
|
|
|
|
int32 port = 3;
|
2020-09-13 19:27:47 +08:00
|
|
|
}
|
|
|
|
|
|
2021-04-18 21:19:14 +08:00
|
|
|
message TestNodeGrantResponse {
|
|
|
|
|
bool isOk = 1;
|
|
|
|
|
string error = 2;
|
2021-08-14 21:33:26 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 查找集群推荐的认证
|
|
|
|
|
message FindSuggestNodeGrantsRequest {
|
|
|
|
|
int64 nodeClusterId = 1; // 边缘节点集群
|
|
|
|
|
int64 nsClusterId = 2; // NS节点集群
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
message FindSuggestNodeGrantsResponse {
|
|
|
|
|
repeated NodeGrant nodeGrants = 1;
|
2020-09-13 19:27:47 +08:00
|
|
|
}
|