alertdashboard.go 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. "yunion.io/x/jsonutils"
  17. "yunion.io/x/onecloud/pkg/apis"
  18. "yunion.io/x/onecloud/pkg/mcclient/options"
  19. )
  20. type AlertDashBoardCreateOptions struct {
  21. apis.ScopedResourceCreateInput
  22. NAME string `help:"Name of bashboard"`
  23. Refresh string `help:"dashboard query refresh priod e.g. 1m|5m"`
  24. }
  25. func (o *AlertDashBoardCreateOptions) Params() (jsonutils.JSONObject, error) {
  26. return options.StructToParams(o)
  27. }
  28. type AlertDashBoardListOptions struct {
  29. options.BaseListOptions
  30. }
  31. func (o *AlertDashBoardListOptions) Params() (jsonutils.JSONObject, error) {
  32. return options.ListStructToParams(o)
  33. }
  34. type AlertDashBoardShowOptions struct {
  35. ID string `help:"ID of Metric " json:"-"`
  36. }
  37. func (o *AlertDashBoardShowOptions) Params() (jsonutils.JSONObject, error) {
  38. return options.StructToParams(o)
  39. }
  40. func (o *AlertDashBoardShowOptions) GetId() string {
  41. return o.ID
  42. }
  43. type AlertDashBoardDeleteOptions struct {
  44. ID string `json:"-"`
  45. }
  46. func (o *AlertDashBoardDeleteOptions) GetId() string {
  47. return o.ID
  48. }
  49. func (o *AlertDashBoardDeleteOptions) Params() (jsonutils.JSONObject, error) {
  50. return options.StructToParams(o)
  51. }
  52. type AlertClonePanelOptions struct {
  53. ID string `help:"ID of alart " json:"-"`
  54. PanelId string `help:"ID of alertPanel" json:"panel_id"`
  55. ClonePanelName string `help:"new panel name" json:"clone_panel_name"`
  56. }
  57. func (o *AlertClonePanelOptions) Params() (jsonutils.JSONObject, error) {
  58. return options.StructToParams(o)
  59. }
  60. func (o *AlertClonePanelOptions) GetId() string {
  61. return o.ID
  62. }
  63. type AlertCloneDashboardOptions struct {
  64. ID string `help:"ID of alart " json:"-"`
  65. CloneName string `json:"clone_name" help:"new dashboard name"`
  66. }
  67. func (o *AlertCloneDashboardOptions) Params() (jsonutils.JSONObject, error) {
  68. return options.StructToParams(o)
  69. }
  70. func (o *AlertCloneDashboardOptions) GetId() string {
  71. return o.ID
  72. }