package message

type O11yAgentEnvironmentAWS struct {
	Account         string   `json:"account"`
	NodeSubnetIDs   []string `json:"nodeSubnetIDs"`
	Oidc            string   `json:"oidc"`
	SecurityGroupID string   `json:"securityGroupID"`
	VpcID           string   `json:"vpcID"`
	// this field is only used by dedicated regional server to add tag for vpcendpoint.
	VpcEndpointID string `json:"vpcEndpointID,omitempty"`
}

type O11yAgentEnvironmentGCP struct {
	GcpProject  string   `json:"gcpProject"`
	NetworkName string   `json:"networkName"`
	Subnets     []string `json:"subnets"`
}

type O11yAgentEnvironmentDataplane struct {
	ClusterCAData   string `json:"clusterCAData"`
	ClusterEndpoint string `json:"clusterEndpoint"`
	ClusterName     string `json:"clusterName"`
}

type O11yAgentObservation struct {
	ClusterTopology struct {
		Pd struct {
			Replicas int `json:"replicas"`
		} `json:"pd"`
		Tidb struct {
			Replicas int `json:"replicas"`
		} `json:"tidb"`
		Tiflash struct {
			Replicas int `json:"replicas"`
		} `json:"tiflash"`
		Tikv struct {
			Replicas int `json:"replicas"`
		} `json:"tikv"`
	} `json:"clusterTopology"`
	TidbVersion string `json:"tidbVersion"`
}

type O11yAgent struct {
	AgentEnvironment struct {
		Aws              O11yAgentEnvironmentAWS       `json:"aws"`
		Dataplane        O11yAgentEnvironmentDataplane `json:"dataplane"`
		Gcp              O11yAgentEnvironmentGCP       `json:"gcp"`
		ReleaseNameSpace string                        `json:"releaseNameSpace"`
	} `json:"agentEnvironment"`
	AgentReconcilePaused bool                  `json:"agentReconcilePaused"`
	AgentRoleArn         string                `json:"agentRoleArn"`
	EndpointName         string                `json:"endpointName"`
	Observed             *O11yAgentObservation `json:"observed,omitempty"`
	AgentStatus          string                `json:"agentStatus"`
	Region               string                `json:"region"`
	Vendor               string                `json:"vendor"`
	ID                   string                `json:"-"` // some help fields
}

type O11yAgentReconcileParam struct {
	ID           string `json:"-"`
	PauseCluster bool   `json:"pauseCluster"`
	Region       string `json:"region"`
	Vendor       string `json:"vendor"`
}
