mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
feat(monitor): use GET for unifiedmonitors resource-metrics (#24781)
This commit is contained in:
@@ -702,7 +702,22 @@ func (self *SUnifiedMonitorManager) PerformResourceMetrics(
|
||||
if err := data.Unmarshal(input); err != nil {
|
||||
return nil, httperrors.NewInputParameterError("unmarshal input: %v", err)
|
||||
}
|
||||
return self.getResourceMetrics(ctx, userCred, input)
|
||||
}
|
||||
|
||||
func (self *SUnifiedMonitorManager) GetPropertyResourceMetrics(
|
||||
ctx context.Context,
|
||||
userCred mcclient.TokenCredential,
|
||||
input *monitor.ResourceMetricsQueryInput,
|
||||
) (jsonutils.JSONObject, error) {
|
||||
return self.getResourceMetrics(ctx, userCred, input)
|
||||
}
|
||||
|
||||
func (self *SUnifiedMonitorManager) getResourceMetrics(
|
||||
ctx context.Context,
|
||||
userCred mcclient.TokenCredential,
|
||||
input *monitor.ResourceMetricsQueryInput,
|
||||
) (jsonutils.JSONObject, error) {
|
||||
drv := GetResourceMetricDriver(input.ResType)
|
||||
if drv == nil {
|
||||
return nil, httperrors.NewInputParameterError("unsupported res_type %q", input.ResType)
|
||||
|
||||
Reference in New Issue
Block a user