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;

	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;

	NodeCluster nodeCluster = 30; // 主集群
}