mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
18 lines
515 B
Go
18 lines
515 B
Go
package ngalert
|
|
|
|
import (
|
|
"github.com/grafana/grafana/pkg/api/response"
|
|
"github.com/grafana/grafana/pkg/models"
|
|
)
|
|
|
|
// listAlertInstancesEndpoint handles GET /api/alert-instances.
|
|
func (api *apiImpl) listAlertInstancesEndpoint(c *models.ReqContext) response.Response {
|
|
cmd := listAlertInstancesQuery{DefinitionOrgID: c.SignedInUser.OrgId}
|
|
|
|
if err := api.store.listAlertInstances(&cmd); err != nil {
|
|
return response.Error(500, "Failed to list alert instances", err)
|
|
}
|
|
|
|
return response.JSON(200, cmd.Result)
|
|
}
|