package constants

type TidbClusterStatus string

const (
	TidbClusterUnavailable TidbClusterStatus = "UNAVAILABLE"
	TidbClusterUnhealthy   TidbClusterStatus = "UNHEALTHY"
	TidbClusterUpgrading   TidbClusterStatus = "UPGRADING"
	TidbClusterScaling     TidbClusterStatus = "SCALING"
	TidbClusterNormal      TidbClusterStatus = "NORMAL"
	TidbClusterUnknown     TidbClusterStatus = "UNKNOWN"
	TidbClusterCreating    TidbClusterStatus = "CREATING"

	// for billing system
	TiDBClusterTenantIDLabel         = "billing-tenant-id"
	TiDBClusterProjectIDLabel        = "billing-project-id"
	TiDBClusterClusterIDLabel        = "billing-cluster-id"
	TiDBClusterClusterProfileIDLabel = "billing-cluster-profile-id"
	TiDBClusterStatusFromCentral     = "billing-cluster-status-from-central"

	// for central access proxy
	// reserved the old change password for compatible with old logic
	ServiceRouteChangePassWD = "change_password"

	// new proxy access route
	ServiceRouteExecute = "proxy/cluster/%d/v1beta1/execute"
	ServiceRouteQuery   = "proxy/cluster/%d/v1beta1/query"
	ServiceRouteCDC     = "proxy/cluster/%d/ticdc"

	// ID of the client online
	ManagementPortalTenantID uint64 = 1
	PingCAPProdTenantID      uint64 = 1372813089187041280
	CloudChatTenantID        uint64 = 1311265642040528896
	ColoplTenantID           uint64 = 1326455380288475136
	PortcastTenantID         uint64 = 1348927713213157376
	ColoplPoCTenantID        uint64 = 1372813089187641281
	EasyPayTenantID          uint64 = 1372813089188031284
	BookingTenantID          uint64 = 1372813089189201287
)

type Cluster struct {
	ClusterID uint64
	Password  string `json:"password"`
}

type ChangePasswordModel struct {
	Cluster
	NewPassword string
}

type QuerySqlModel struct {
	Cluster
	Query            string `json:"query"`
	ShowMasterStatus bool   `json:"showMasterStatus"`
}

type ExecuteSqlModel struct {
	Cluster
	Query string `json:"query"`
	SetGc string `json:"setGC"`
}

type MasterStatus struct {
	Position []uint64 `field:"Position"`
}
