mirror of
				https://github.com/TeaOSLab/EdgeCommon.git
				synced 2025-11-04 05:00:24 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			110 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			Protocol Buffer
		
	
	
	
	
	
			
		
		
	
	
			110 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			Protocol Buffer
		
	
	
	
	
	
syntax = "proto3";
 | 
						|
option go_package = "./pb";
 | 
						|
 | 
						|
package pb;
 | 
						|
import "models/model_api_node.proto";
 | 
						|
import "models/rpc_messages.proto";
 | 
						|
 | 
						|
service APINodeService {
 | 
						|
	// 创建API节点
 | 
						|
	rpc createAPINode (CreateAPINodeRequest) returns (CreateAPINodeResponse);
 | 
						|
 | 
						|
	// 修改API节点
 | 
						|
	rpc updateAPINode (UpdateAPINodeRequest) returns (RPCSuccess);
 | 
						|
 | 
						|
	// 删除API节点
 | 
						|
	rpc deleteAPINode (DeleteAPINodeRequest) returns (RPCSuccess);
 | 
						|
 | 
						|
	// 列出所有可用API节点
 | 
						|
	rpc findAllEnabledAPINodes (FindAllEnabledAPINodesRequest) returns (FindAllEnabledAPINodesResponse);
 | 
						|
 | 
						|
	// 计算API节点数量
 | 
						|
	rpc countAllEnabledAPINodes (CountAllEnabledAPINodesRequest) returns (RPCCountResponse);
 | 
						|
 | 
						|
	// 列出单页的API节点
 | 
						|
	rpc listEnabledAPINodes (ListEnabledAPINodesRequest) returns (ListEnabledAPINodesResponse);
 | 
						|
 | 
						|
	// 根据ID查找节点
 | 
						|
	rpc findEnabledAPINode (FindEnabledAPINodeRequest) returns (FindEnabledAPINodeResponse);
 | 
						|
 | 
						|
	// 获取当前API节点的版本
 | 
						|
	rpc findCurrentAPINodeVersion (FindCurrentAPINodeVersionRequest) returns (FindCurrentAPINodeVersionResponse);
 | 
						|
}
 | 
						|
 | 
						|
// 创建API节点
 | 
						|
message CreateAPINodeRequest {
 | 
						|
	string name = 1;
 | 
						|
	string description = 2;
 | 
						|
	bytes httpJSON = 3;
 | 
						|
	bytes httpsJSON = 4;
 | 
						|
	bytes accessAddrsJSON = 5;
 | 
						|
	bool isOn = 6;
 | 
						|
	bool restIsOn = 7;
 | 
						|
	bytes restHTTPJSON = 8;
 | 
						|
	bytes restHTTPSJSON = 9;
 | 
						|
}
 | 
						|
 | 
						|
message CreateAPINodeResponse {
 | 
						|
	int64 nodeId = 1;
 | 
						|
}
 | 
						|
 | 
						|
// 修改API节点
 | 
						|
message UpdateAPINodeRequest {
 | 
						|
	int64 nodeId = 1;
 | 
						|
	string name = 2;
 | 
						|
	string description = 3;
 | 
						|
	bytes httpJSON = 4;
 | 
						|
	bytes httpsJSON = 5;
 | 
						|
	bytes accessAddrsJSON = 6;
 | 
						|
	bool isOn = 7;
 | 
						|
	bool restIsOn = 8;
 | 
						|
	bytes restHTTPJSON = 9;
 | 
						|
	bytes restHTTPSJSON = 10;
 | 
						|
}
 | 
						|
 | 
						|
// 删除API节点
 | 
						|
message DeleteAPINodeRequest {
 | 
						|
	int64 nodeId = 1;
 | 
						|
}
 | 
						|
 | 
						|
// 列出所有可用API节点
 | 
						|
message FindAllEnabledAPINodesRequest {
 | 
						|
 | 
						|
}
 | 
						|
 | 
						|
message FindAllEnabledAPINodesResponse {
 | 
						|
	repeated APINode nodes = 1;
 | 
						|
}
 | 
						|
 | 
						|
// 计算API节点数量
 | 
						|
message CountAllEnabledAPINodesRequest {
 | 
						|
 | 
						|
}
 | 
						|
 | 
						|
// 列出单页的API节点
 | 
						|
message ListEnabledAPINodesRequest {
 | 
						|
	int64 offset = 1;
 | 
						|
	int64 size = 2;
 | 
						|
}
 | 
						|
 | 
						|
message ListEnabledAPINodesResponse {
 | 
						|
	repeated APINode nodes = 1;
 | 
						|
}
 | 
						|
 | 
						|
// 根据ID查找节点
 | 
						|
message FindEnabledAPINodeRequest {
 | 
						|
	int64 nodeId = 1;
 | 
						|
}
 | 
						|
 | 
						|
message FindEnabledAPINodeResponse {
 | 
						|
	APINode node = 1;
 | 
						|
}
 | 
						|
 | 
						|
// 获取当前API节点的版本
 | 
						|
message FindCurrentAPINodeVersionRequest {
 | 
						|
 | 
						|
}
 | 
						|
 | 
						|
message FindCurrentAPINodeVersionResponse {
 | 
						|
	string version = 1;
 | 
						|
} |