mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* AlertingNG: Save alert instances Co-authored-by: Kyle Brandt <kyle@grafana.com> * Rename alert instance fields/columns * Include definition title in listing alert instances * Delete instances when deleting defintion Co-authored-by: Kyle Brandt <kyle@grafana.com>
18 lines
507 B
Go
18 lines
507 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 (ng *AlertNG) listAlertInstancesEndpoint(c *models.ReqContext) response.Response {
|
|
cmd := listAlertInstancesQuery{DefinitionOrgID: c.SignedInUser.OrgId}
|
|
|
|
if err := ng.listAlertInstances(&cmd); err != nil {
|
|
return response.Error(500, "Failed to list alert instances", err)
|
|
}
|
|
|
|
return response.JSON(200, cmd.Result)
|
|
}
|