| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- // Copyright 2019 Yunion
- //
- // Licensed under the Apache License, Version 2.0 (the "License");
- // you may not use this file except in compliance with the License.
- // You may obtain a copy of the License at
- //
- // http://www.apache.org/licenses/LICENSE-2.0
- //
- // Unless required by applicable law or agreed to in writing, software
- // distributed under the License is distributed on an "AS IS" BASIS,
- // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- // See the License for the specific language governing permissions and
- // limitations under the License.
- package monitor
- import (
- "time"
- "yunion.io/x/jsonutils"
- "yunion.io/x/onecloud/pkg/mcclient/options"
- )
- type MonitorResourceAlertListOptions struct {
- options.BaseListOptions
- MonitorResourceId string `help:"ID of monitor resource" json:"monitor_resource_id"`
- AlertId string `help:"ID of alert" json:"alert_id"`
- Alerting bool `help:"search alerting resource" json:"alerting"`
- SendState string `json:"send_state"`
- AllState bool `help:"Show all state" json:"all_state"`
- Ip string `help:"IP address" json:"ip"`
- StartTime time.Time `help:"start time for top query, format: 2025-01-01 00:00:00" json:"start_time"`
- EndTime time.Time `help:"end time for top query, format: 2025-01-01 00:00:00" json:"end_time"`
- Top *int `help:"return top N resources by alert count (default: 5)" json:"top"`
- }
- func (o *MonitorResourceAlertListOptions) GetMasterOpt() string {
- return o.MonitorResourceId
- }
- func (o *MonitorResourceAlertListOptions) GetSlaveOpt() string {
- return o.AlertId
- }
- func (o *MonitorResourceAlertListOptions) Params() (jsonutils.JSONObject, error) {
- return options.ListStructToParams(o)
- }
|