mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
Merge pull request #15956 from zexi/automated-cherry-pick-of-#15955-upstream-master
Automated cherry pick of #15955: fix(climc): add measurements and databases api of unifiedmonitor
This commit is contained in:
@@ -21,6 +21,8 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
cmd := shell.NewResourceCmd(monitor.UnifiedMonitorManager).WithKeyword("monitor")
|
||||
cmd := shell.NewResourceCmd(monitor.UnifiedMonitorManager).SetPrefix("monitor")
|
||||
cmd.Show(&options.SimpleQueryOptions{})
|
||||
cmd.GetProperty(&options.MeasurementsQueryOptions{})
|
||||
cmd.GetProperty(&options.DatabasesQueryOptions{})
|
||||
}
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
// 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 "yunion.io/x/jsonutils"
|
||||
|
||||
type MeasurementsQueryOptions struct {
|
||||
Scope string `json:"scope"`
|
||||
ProjectDomainId string `json:"project_domin_id"`
|
||||
ProjectId string `json:"project_id"`
|
||||
}
|
||||
|
||||
func (o MeasurementsQueryOptions) Params() (jsonutils.JSONObject, error) {
|
||||
return jsonutils.Marshal(o), nil
|
||||
}
|
||||
|
||||
func (o MeasurementsQueryOptions) Property() string {
|
||||
return "measurements"
|
||||
}
|
||||
|
||||
type DatabasesQueryOptions struct{}
|
||||
|
||||
func (o DatabasesQueryOptions) Params() (jsonutils.JSONObject, error) {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (o DatabasesQueryOptions) Property() string {
|
||||
return "databases"
|
||||
}
|
||||
Reference in New Issue
Block a user