mirror of
				https://github.com/TeaOSLab/EdgeCommon.git
				synced 2025-11-04 05:00:24 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			108 lines
		
	
	
		
			2.5 KiB
		
	
	
	
		
			Protocol Buffer
		
	
	
	
	
	
			
		
		
	
	
			108 lines
		
	
	
		
			2.5 KiB
		
	
	
	
		
			Protocol Buffer
		
	
	
	
	
	
syntax = "proto3";
 | 
						|
option go_package = "./pb";
 | 
						|
 | 
						|
package pb;
 | 
						|
import "models/model_monitor_node.proto";
 | 
						|
import "models/rpc_messages.proto";
 | 
						|
 | 
						|
// 监控节点管理服务
 | 
						|
service MonitorNodeService {
 | 
						|
	// 创建监控节点
 | 
						|
	rpc createMonitorNode (CreateMonitorNodeRequest) returns (CreateMonitorNodeResponse);
 | 
						|
 | 
						|
	// 修改监控节点
 | 
						|
	rpc updateMonitorNode (UpdateMonitorNodeRequest) returns (RPCSuccess);
 | 
						|
 | 
						|
	// 删除监控节点
 | 
						|
	rpc deleteMonitorNode (DeleteMonitorNodeRequest) returns (RPCSuccess);
 | 
						|
 | 
						|
	// 列出所有可用监控节点
 | 
						|
	rpc findAllEnabledMonitorNodes (FindAllEnabledMonitorNodesRequest) returns (FindAllEnabledMonitorNodesResponse);
 | 
						|
 | 
						|
	// 计算监控节点数量
 | 
						|
	rpc countAllEnabledMonitorNodes (CountAllEnabledMonitorNodesRequest) returns (RPCCountResponse);
 | 
						|
 | 
						|
	// 列出单页的监控节点
 | 
						|
	rpc listEnabledMonitorNodes (ListEnabledMonitorNodesRequest) returns (ListEnabledMonitorNodesResponse);
 | 
						|
 | 
						|
	// 根据ID查找节点
 | 
						|
	rpc findEnabledMonitorNode (FindEnabledMonitorNodeRequest) returns (FindEnabledMonitorNodeResponse);
 | 
						|
 | 
						|
	// 获取当前监控节点信息
 | 
						|
	rpc findCurrentMonitorNode (FindCurrentMonitorNodeRequest) returns (FindCurrentMonitorNodeResponse);
 | 
						|
 | 
						|
	// 更新节点状态
 | 
						|
	rpc updateMonitorNodeStatus (UpdateMonitorNodeStatusRequest) returns (RPCSuccess);
 | 
						|
}
 | 
						|
 | 
						|
// 创建监控节点
 | 
						|
message CreateMonitorNodeRequest {
 | 
						|
	string name = 1;
 | 
						|
	string description = 2;
 | 
						|
	bool isOn = 3;
 | 
						|
}
 | 
						|
 | 
						|
message CreateMonitorNodeResponse {
 | 
						|
	int64 monitorNodeId = 1;
 | 
						|
}
 | 
						|
 | 
						|
// 修改监控节点
 | 
						|
message UpdateMonitorNodeRequest {
 | 
						|
	int64 monitorNodeId = 1;
 | 
						|
	string name = 2;
 | 
						|
	string description = 3;
 | 
						|
	bool isOn = 4;
 | 
						|
}
 | 
						|
 | 
						|
// 删除监控节点
 | 
						|
message DeleteMonitorNodeRequest {
 | 
						|
	int64 monitorNodeId = 1;
 | 
						|
}
 | 
						|
 | 
						|
// 列出所有可用监控节点
 | 
						|
message FindAllEnabledMonitorNodesRequest {
 | 
						|
 | 
						|
}
 | 
						|
 | 
						|
message FindAllEnabledMonitorNodesResponse {
 | 
						|
	repeated MonitorNode monitorNodes = 1;
 | 
						|
}
 | 
						|
 | 
						|
// 计算监控节点数量
 | 
						|
message CountAllEnabledMonitorNodesRequest {
 | 
						|
 | 
						|
}
 | 
						|
 | 
						|
// 列出单页的监控节点
 | 
						|
message ListEnabledMonitorNodesRequest {
 | 
						|
	int64 offset = 1;
 | 
						|
	int64 size = 2;
 | 
						|
}
 | 
						|
 | 
						|
message ListEnabledMonitorNodesResponse {
 | 
						|
	repeated MonitorNode monitorNodes = 1;
 | 
						|
}
 | 
						|
 | 
						|
// 根据ID查找节点
 | 
						|
message FindEnabledMonitorNodeRequest {
 | 
						|
	int64 monitorNodeId = 1;
 | 
						|
}
 | 
						|
 | 
						|
message FindEnabledMonitorNodeResponse {
 | 
						|
	MonitorNode monitorNode = 1;
 | 
						|
}
 | 
						|
 | 
						|
// 获取当前监控节点
 | 
						|
message FindCurrentMonitorNodeRequest {
 | 
						|
 | 
						|
}
 | 
						|
 | 
						|
message FindCurrentMonitorNodeResponse {
 | 
						|
	MonitorNode monitorNode = 1;
 | 
						|
}
 | 
						|
 | 
						|
// 更新监控状态
 | 
						|
message UpdateMonitorNodeStatusRequest {
 | 
						|
	int64 monitorNodeId = 1;
 | 
						|
	bytes statusJSON = 2;
 | 
						|
} |