mirror of
https://github.com/TeaOSLab/EdgeCommon.git
synced 2025-12-28 13:36:38 +08:00
增加独立的IP地址管理功能
This commit is contained in:
@@ -39,4 +39,13 @@ message Node {
|
||||
NodeGroup nodeGroup = 36;
|
||||
NodeRegion nodeRegion = 37;
|
||||
repeated NodeCluster secondaryNodeClusters = 38; // 从集群
|
||||
}
|
||||
|
||||
message BasicNode {
|
||||
int64 id = 1;
|
||||
string name = 2;
|
||||
bool isOn = 3;
|
||||
bool isUp = 4;
|
||||
|
||||
NodeCluster nodeCluster = 30; // 主集群
|
||||
}
|
||||
@@ -16,4 +16,5 @@ message NodeIPAddress {
|
||||
bool isOn = 9;
|
||||
bool isUp = 10;
|
||||
bytes thresholdsJSON = 11;
|
||||
string role = 12;
|
||||
}
|
||||
19
pkg/rpc/protos/models/model_node_ip_address_log.proto
Normal file
19
pkg/rpc/protos/models/model_node_ip_address_log.proto
Normal file
@@ -0,0 +1,19 @@
|
||||
syntax = "proto3";
|
||||
option go_package = "./pb";
|
||||
|
||||
package pb;
|
||||
|
||||
import "models/model_node_ip_address.proto";
|
||||
import "models/model_admin.proto";
|
||||
|
||||
message NodeIPAddressLog {
|
||||
int64 id = 1;
|
||||
string description = 2;
|
||||
int64 createdAt = 3;
|
||||
bool isUp = 4;
|
||||
bool isOn = 5;
|
||||
bool canAccess = 6;
|
||||
|
||||
NodeIPAddress nodeIPAddress = 30;
|
||||
Admin admin = 31;
|
||||
}
|
||||
@@ -41,6 +41,9 @@ service NodeService {
|
||||
// 获取单个节点信息
|
||||
rpc findEnabledNode (FindEnabledNodeRequest) returns (FindEnabledNodeResponse);
|
||||
|
||||
// 获取单个节点基本信息
|
||||
rpc findEnabledBasicNode (FindEnabledBasicNodeRequest) returns (FindEnabledBasicNodeResponse);
|
||||
|
||||
// 获取当前节点配置
|
||||
rpc findCurrentNodeConfig (FindCurrentNodeConfigRequest) returns (FindCurrentNodeConfigResponse);
|
||||
|
||||
@@ -225,6 +228,15 @@ message FindEnabledNodeResponse {
|
||||
Node node = 1;
|
||||
}
|
||||
|
||||
// 获取单个节点基本信息
|
||||
message FindEnabledBasicNodeRequest {
|
||||
int64 nodeId = 1;
|
||||
}
|
||||
|
||||
message FindEnabledBasicNodeResponse {
|
||||
BasicNode node = 1;
|
||||
}
|
||||
|
||||
// 组合单个节点配置
|
||||
message FindCurrentNodeConfigRequest {
|
||||
// 由于登录信息中已经包含了节点信息,所以这里不需要nodeId
|
||||
|
||||
@@ -27,6 +27,12 @@ service NodeIPAddressService {
|
||||
|
||||
// 查找节点的所有地址
|
||||
rpc findAllEnabledIPAddressesWithNodeId (FindAllEnabledIPAddressesWithNodeIdRequest) returns (FindAllEnabledIPAddressesWithNodeIdResponse);
|
||||
|
||||
// 计算IP地址数量
|
||||
rpc countAllEnabledIPAddresses(CountAllEnabledIPAddressesRequest) returns (RPCCountResponse);
|
||||
|
||||
// 列出单页IP地址
|
||||
rpc listEnabledIPAddresses(ListEnabledIPAddressesRequest) returns (ListEnabledIPAddressesResponse);
|
||||
}
|
||||
|
||||
// 创建IP地址
|
||||
@@ -40,12 +46,12 @@ message CreateNodeIPAddressRequest {
|
||||
}
|
||||
|
||||
message CreateNodeIPAddressResponse {
|
||||
int64 addressId = 1;
|
||||
int64 nodeIPAddressId = 1;
|
||||
}
|
||||
|
||||
// 修改IP地址
|
||||
message UpdateNodeIPAddressRequest {
|
||||
int64 addressId = 1;
|
||||
int64 nodeIPAddressId = 1;
|
||||
string name = 2;
|
||||
string ip = 3;
|
||||
bool canAccess = 4;
|
||||
@@ -55,13 +61,13 @@ message UpdateNodeIPAddressRequest {
|
||||
|
||||
// 修改IP地址所属节点
|
||||
message UpdateNodeIPAddressNodeIdRequest {
|
||||
int64 addressId = 1;
|
||||
int64 nodeIPAddressId = 1;
|
||||
int64 nodeId = 2;
|
||||
}
|
||||
|
||||
// 禁用单个IP地址
|
||||
message DisableNodeIPAddressRequest {
|
||||
int64 addressId = 1;
|
||||
int64 nodeIPAddressId = 1;
|
||||
}
|
||||
|
||||
message DisableNodeIPAddressResponse {
|
||||
@@ -80,11 +86,11 @@ message DisableAllIPAddressesWithNodeIdResponse {
|
||||
|
||||
// 查找单个IP地址
|
||||
message FindEnabledNodeIPAddressRequest {
|
||||
int64 addressId = 1;
|
||||
int64 nodeIPAddressId = 1;
|
||||
}
|
||||
|
||||
message FindEnabledNodeIPAddressResponse {
|
||||
NodeIPAddress ipAddress = 1;
|
||||
NodeIPAddress nodeIPAddress = 1;
|
||||
}
|
||||
|
||||
// 查找节点的所有地址
|
||||
@@ -95,4 +101,26 @@ message FindAllEnabledIPAddressesWithNodeIdRequest {
|
||||
|
||||
message FindAllEnabledIPAddressesWithNodeIdResponse {
|
||||
repeated NodeIPAddress addresses = 1;
|
||||
}
|
||||
|
||||
// 计算IP地址数量
|
||||
message CountAllEnabledIPAddressesRequest {
|
||||
int64 nodeClusterId = 1;
|
||||
string role = 2;
|
||||
int32 upState = 3;
|
||||
string keyword = 4;
|
||||
}
|
||||
|
||||
// 列出单页IP地址
|
||||
message ListEnabledIPAddressesRequest {
|
||||
int64 nodeClusterId = 1;
|
||||
string role = 2;
|
||||
int32 upState = 3;
|
||||
string keyword = 4;
|
||||
int64 offset = 5;
|
||||
int64 size = 6;
|
||||
}
|
||||
|
||||
message ListEnabledIPAddressesResponse {
|
||||
repeated NodeIPAddress nodeIPAddresses = 1;
|
||||
}
|
||||
32
pkg/rpc/protos/service_node_ip_address_log.proto
Normal file
32
pkg/rpc/protos/service_node_ip_address_log.proto
Normal file
@@ -0,0 +1,32 @@
|
||||
syntax = "proto3";
|
||||
option go_package = "./pb";
|
||||
|
||||
package pb;
|
||||
|
||||
import "models/rpc_messages.proto";
|
||||
import "models/model_node_ip_address_log.proto";
|
||||
|
||||
// IP地址相关日志
|
||||
service NodeIPAddressLogService {
|
||||
// 计算日志数量
|
||||
rpc countAllNodeIPAddressLogs(CountAllNodeIPAddressLogsRequest) returns (RPCCountResponse);
|
||||
|
||||
// 列出单页日志
|
||||
rpc listNodeIPAddressLogs(ListNodeIPAddressLogsRequest) returns (ListNodeIPAddressLogsResponse);
|
||||
}
|
||||
|
||||
// 计算日志数量
|
||||
message CountAllNodeIPAddressLogsRequest {
|
||||
int64 nodeIPAddressId = 1;
|
||||
}
|
||||
|
||||
// 列出单页日志
|
||||
message ListNodeIPAddressLogsRequest {
|
||||
int64 nodeIPAddressId = 1;
|
||||
int64 offset = 2;
|
||||
int64 size = 3;
|
||||
}
|
||||
|
||||
message ListNodeIPAddressLogsResponse {
|
||||
repeated NodeIPAddressLog nodeIPAddressLogs = 1;
|
||||
}
|
||||
Reference in New Issue
Block a user