diff --git a/cmd/climc/shell/monitor/unifiedmonitor.go b/cmd/climc/shell/monitor/unifiedmonitor.go index 454857cb08..f8174d5295 100644 --- a/cmd/climc/shell/monitor/unifiedmonitor.go +++ b/cmd/climc/shell/monitor/unifiedmonitor.go @@ -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{}) } diff --git a/pkg/mcclient/options/monitor/unifiedmonitor.go b/pkg/mcclient/options/monitor/unifiedmonitor.go new file mode 100644 index 0000000000..9cb232a67c --- /dev/null +++ b/pkg/mcclient/options/monitor/unifiedmonitor.go @@ -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" +}