syntax = "proto3";
option go_package = "./pb";

package pb;

import "models/model_node_cluster.proto";
import "models/model_node_login.proto";
import "models/model_node_install_status.proto";
import "models/model_node_ip_address.proto";
import "models/model_node_group.proto";
import "models/model_node_region.proto";
import "models/model_dns_route.proto";
import "models/model_size_capacity.proto";

message Node {
	int64 id = 1;
	string name = 2;
	bytes statusJSON = 3;
	string installDir = 4;
	bool isInstalled = 5;
	string code = 6;
	string uniqueId = 7;
	string secret = 8;
	int64 version = 9;
	int64 latestVersion = 10;
	repeated int64 connectedAPINodeIds = 11;
	int32 maxCPU = 12;
	bool isOn = 13;
	bool isUp = 14;
	repeated DNSRoute dnsRoutes = 15;
	bool isActive = 16;
	SizeCapacity maxCacheDiskCapacity = 17;
	SizeCapacity maxCacheMemoryCapacity = 18;
	string cacheDiskDir = 19;
	bytes cacheDiskSubDirsJSON = 23;
	int32 level = 20;
	repeated string lnAddrs = 21; // Ln访问地址
	bool enableIPLists = 22;
	bytes apiNodeAddrsJSON = 24;
	string offlineDay = 25; // 下线日期
	bool isBackupForCluster = 26; // 是否为集群备用节点
	bool isBackupForGroup = 27; // 是否为分组备用节点

	NodeCluster nodeCluster = 32; // 主集群
	NodeLogin nodeLogin = 33;
	NodeInstallStatus installStatus = 34;
	repeated NodeIPAddress ipAddresses = 35;
	NodeGroup nodeGroup = 36;
	NodeRegion nodeRegion = 37;
	repeated NodeCluster secondaryNodeClusters = 38; // 从集群
}

message BasicNode {
	int64 id = 1;
	string name = 2;
	bool isOn = 3;
	bool isUp = 4;
	int32 level = 5;

	NodeCluster nodeCluster = 30; // 主集群
}