package globalapi

import (
	"github.com/gin-gonic/gin"
)

// ListClusterAlerts
// @Summary list cluster alerts
// @Description list all user alerts belongs to specific cluster
// @Tags external
// @Accept json
// @Produce json
// @Param bizType path string true "bizType, for staging, use staging-tidbcloud, others, use tidbcloud"
// @Param tenantID path string true "tenant id"
// @Param projectID path string true "project id"
// @Param applicationID path string true "application id"
// @Param request query message.QueryExternalAlertsReq true "Query Alerts Parameters"
// @Success 200 {object} message.Result{data=message.QueryExternalAlertsResp}
// @Failure 400 {object} message.Result
// @Failure 404 {object} message.Result
// @Failure 500 {object} message.Result
// @Router /external/{bizType}/orgs/{tenantID}/projects/{projectID}/clusters/{applicationID}/alerts [get]
func ListClusterExternalAlerts(c *gin.Context) {
	// automatic analysis of routing addresses for forwarding to the regional server
	AutoRouteRegionalServer(c, defaultOptionalParam)
}

// ListClusterExternalAlertsInternal
// @Summary list cluster external alerts for internal service
// @Description lists all user alerts belongs to specific cluster
// @Tags external
// @Accept json
// @Produce json
// @Param bizType path string true "bizType, for staging, use staging-tidbcloud, others, use tidbcloud"
// @Param tenantID path string true "tenant id"
// @Param projectID path string true "project id"
// @Param applicationID path string true "application id"
// @Param request query message.QueryExternalAlertsReq true "Query Alerts Parameters"
// @Success 200 {object} message.Result{data=message.QueryExternalAlertsResp}
// @Failure 400 {object} message.Result
// @Failure 404 {object} message.Result
// @Failure 500 {object} message.Result
// @Router /internal/{bizType}/orgs/{tenantID}/projects/{projectID}/clusters/{applicationID}/alerts [get]
func ListClusterExternalAlertsInternal(c *gin.Context) {
	// automatic analysis of routing addresses for forwarding to the regional server
	AutoRouteRegionalServer(c, defaultOptionalParam)
}

// ListClusterExternalAlertsNextGen
// @Summary list cluster alerts for next gen
// @Description list all user alerts belongs to specific cluster
// @Tags external
// @Accept json
// @Produce json
// @Param bizType path string true "bizType, for staging, use staging-tidbcloud, others, use tidbcloud"
// @Param tenantID path string true "tenant id"
// @Param applicationID path string true "application id"
// @Param request query message.QueryExternalAlertsReq true "Query Alerts Parameters"
// @Success 200 {object} message.Result{data=message.QueryExternalAlertsResp}
// @Failure 400 {object} message.Result
// @Failure 404 {object} message.Result
// @Failure 500 {object} message.Result
// @Router /external/{bizType}/orgs/{tenantID}/clusters/{applicationID}/alerts [get]
func ListClusterExternalAlertsNextGen(c *gin.Context) {
	// automatic analysis of routing addresses for forwarding to the regional server
	AutoRouteRegionalServer(c, defaultOptionalParam)
}
