alert_notifications.go 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. package models
  2. import (
  3. "time"
  4. "github.com/grafana/grafana/pkg/components/simplejson"
  5. )
  6. type AlertNotification struct {
  7. Id int64 `json:"id"`
  8. OrgId int64 `json:"-"`
  9. Name string `json:"name"`
  10. Type string `json:"type"`
  11. AlwaysExecute bool `json:"alwaysExecute"`
  12. Settings *simplejson.Json `json:"settings"`
  13. Created time.Time `json:"created"`
  14. Updated time.Time `json:"updated"`
  15. }
  16. type CreateAlertNotificationCommand struct {
  17. Name string `json:"name" binding:"Required"`
  18. Type string `json:"type" binding:"Required"`
  19. AlwaysExecute bool `json:"alwaysExecute"`
  20. OrgID int64 `json:"-"`
  21. Settings *simplejson.Json `json:"settings"`
  22. Result *AlertNotification
  23. }
  24. type UpdateAlertNotificationCommand struct {
  25. Id int64 `json:"id" binding:"Required"`
  26. Name string `json:"name" binding:"Required"`
  27. Type string `json:"type" binding:"Required"`
  28. AlwaysExecute bool `json:"alwaysExecute"`
  29. OrgID int64 `json:"-"`
  30. Settings *simplejson.Json `json:"settings" binding:"Required"`
  31. Result *AlertNotification
  32. }
  33. type DeleteAlertNotificationCommand struct {
  34. Id int64
  35. OrgId int64
  36. }
  37. type GetAlertNotificationQuery struct {
  38. Name string
  39. Id int64
  40. Ids []int64
  41. OrgID int64
  42. IncludeAlwaysExecute bool
  43. Result []*AlertNotification
  44. }