meteralert.go 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. // Copyright 2019 Yunion
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. package monitor
  15. const (
  16. MeterAlertTypeBalance = "balance"
  17. MeterAlertTypeDailyResFee = "resFee"
  18. MeterAlertTypeMonthResFee = "monthFee"
  19. )
  20. type MeterAlertCreateInput struct {
  21. ResourceAlertV1CreateInput
  22. // 监控资源类型, 比如: balance, resFree, monthFee
  23. Type string `json:"type"`
  24. // 云平台类型
  25. Provider string `json:"provider"`
  26. // 云账号 Id
  27. AccountId string `json:"account_id"`
  28. // 项目 Id string
  29. ProjectId string `json:"project_id"`
  30. }
  31. type MeterAlertListInput struct {
  32. V1AlertListInput
  33. // 监控资源类型, 比如: balance, resFree, monthFee
  34. Type string `json:"type"`
  35. // 云平台类型
  36. Provider string `json:"provider"`
  37. // 云账号 Id
  38. AccountId string `json:"account_id"`
  39. // 项目 Id
  40. ProjectId string `json:"project_id"`
  41. }
  42. type MeterAlertDetails struct {
  43. AlertV1Details
  44. Type string `json:"type"`
  45. ProjectId string `json:"project_id"`
  46. AccountId string `json:"account_id"`
  47. Provider string `json:"provider"`
  48. }
  49. type MeterAlertUpdateInput struct {
  50. V1AlertUpdateInput
  51. // 比较运算符, 比如: >, <, >=, <=
  52. Comparator *string `json:"comparator"`
  53. // 报警阀值
  54. Threshold *float64 `json:"threshold"`
  55. // 通知接受者
  56. Recipients *string `json:"recipients"`
  57. // 项目 Id
  58. ProjectId *string `json:"project_id"`
  59. // 通知方式, 比如: email, mobile
  60. Channel *string `json:"channel"`
  61. Status *string `json:"status"`
  62. }