monitor_resource_alert.go 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. import (
  16. "time"
  17. "yunion.io/x/jsonutils"
  18. "yunion.io/x/onecloud/pkg/apis"
  19. )
  20. type MonitorResourceJointListInput struct {
  21. apis.JointResourceBaseListInput
  22. apis.VirtualResourceListInput
  23. MonitorResourceId string `json:"monitor_resource_id"`
  24. AlertId string `json:"alert_id"`
  25. JointId []int64 `json:"joint_id"`
  26. Alerting bool `json:"alerting"`
  27. AlertState string `json:"alert_state"`
  28. SendState string `json:"send_state"`
  29. ResType string `json:"res_type"`
  30. Metric string `json:"metric"`
  31. ResName string `json:"res_name"`
  32. AlertName string `json:"alert_name"`
  33. Level string `json:"level"`
  34. // 查询所有状态
  35. AllState bool `json:"all_state"`
  36. // Top 查询参数(用于统计各监控指标报警资源最多的资源)
  37. TopQueryInput
  38. }
  39. type MonitorResourceJointCreateInput struct {
  40. apis.Meta
  41. MonitorResourceId string `json:"monitor_resource_id"`
  42. AlertId string `json:"alert_id"`
  43. Metric string `json:"metric"`
  44. AlertRecordId string `width:"36" charset:"ascii" list:"user" update:"user"`
  45. AlertState string `width:"18" charset:"ascii" list:"user" update:"user"`
  46. TriggerTime time.Time `list:"user" update:"user" json:"trigger_time"`
  47. Data EvalMatch `json:"data"`
  48. }
  49. type MonitorResourceJointDetails struct {
  50. MonitorResourceObjectId string `json:"monitor_resource_object_id"`
  51. ResName string `json:"res_name"`
  52. ResId string `json:"res_id"`
  53. ResType string `json:"res_type"`
  54. AlertName string `json:"alert_name"`
  55. AlertRule jsonutils.JSONObject `json:"alert_rule"`
  56. Level string `json:"level"`
  57. SendState string `json:"send_state"`
  58. State string `json:"state"`
  59. IsSetShield bool `json:"is_set_shield"`
  60. AlertCount int `json:"alert_count"`
  61. }