topic.go 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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 notify
  15. import "yunion.io/x/onecloud/pkg/apis"
  16. const (
  17. DefaultResourceCreateDelete = "resource create or delete"
  18. DefaultResourceChangeConfig = "resource change config"
  19. DefaultResourceUpdate = "resource update"
  20. DefaultResourceReleaseDue1Day = "resource release due 1 day"
  21. DefaultResourceReleaseDue3Day = "resource release due 3 day"
  22. DefaultResourceReleaseDue30Day = "resource release due 30 day"
  23. DefaultResourceRelease = "resource release"
  24. DefaultScheduledTaskExecute = "scheduled task execute"
  25. DefaultScalingPolicyExecute = "scaling policy execute"
  26. DefaultSnapshotPolicyExecute = "snapshot policy execute"
  27. DefaultResourceOperationFailed = "resource operation failed"
  28. DefaultResourceSync = "resource sync"
  29. DefaultSystemExceptionEvent = "system exception event"
  30. DefaultChecksumTestFailed = "checksum test failed"
  31. DefaultUserLock = "user lock"
  32. DefaultActionLogExceedCount = "action log exceed count"
  33. DefaultSyncAccountStatus = "cloud account sync status"
  34. DefaultPasswordExpireDue1Day = "password expire due 1 day"
  35. DefaultPasswordExpireDue7Day = "password expire due 7 day"
  36. DefaultPasswordExpire = "password expire"
  37. DefaultNetOutOfSync = "net out of sync"
  38. DefaultMysqlOutOfSync = "mysql out of sync"
  39. DefaultServiceAbnormal = "service abnormal"
  40. DefaultServerPanicked = "server panicked"
  41. )
  42. type TopicUpdateInput struct {
  43. apis.EnabledStatusStandaloneResourceBaseUpdateInput
  44. TitleCn string `json:"title_cn"`
  45. TitleEn string `json:"title_en"`
  46. ContentCn string `json:"content_cn"`
  47. ContentEn string `json:"content_en"`
  48. AdvanceDays []int `json:"advance_days"`
  49. WebconsoleDisable *bool `json:"webconsole_disable"`
  50. Actions []string `json:"actions"`
  51. Resources []string `json:"resources"`
  52. }
  53. type TopicListInput struct {
  54. apis.StandaloneResourceListInput
  55. apis.EnabledResourceBaseListInput
  56. }
  57. type TopicDetails struct {
  58. apis.StandaloneResourceDetails
  59. STopic
  60. // description: resources managed
  61. // example: ["server", "eip", "disk"]
  62. Resources []string `json:"resource_types"`
  63. Actions []string `json:"actions"`
  64. AdvanceDays []int `json:"advance_days"`
  65. }
  66. type PerformEnableInput struct {
  67. }
  68. type PerformDisableInput struct {
  69. }
  70. type STopicGroupKeys []string
  71. type TopicAdvanceDays []int
  72. type STopicCreateInput struct {
  73. apis.EnabledStatusStandaloneResourceCreateInput
  74. Type string `json:"type"`
  75. Results bool `json:"results"`
  76. TitleCn string `json:"title_cn"`
  77. TitleEn string `json:"title_en"`
  78. ContentCn string `json:"content_cn"`
  79. ContentEn string `json:"content_en"`
  80. GroupKeys *STopicGroupKeys `json:"group_keys"`
  81. AdvanceDays []int `json:"advance_days"`
  82. Resources []string `json:"resources"`
  83. Actions []string `json:"actions"`
  84. WebconsoleDisable bool `json:"webconsole_disable"`
  85. }
  86. type TopicAddActionInput struct {
  87. Actions []string `json:"actions"`
  88. }
  89. type TopicAddResourcesInput struct {
  90. Resources []string `json:"resources"`
  91. }