Merge pull request #12151 from zhaoxiangchun/automated-cherry-pick-of-#12149-upstream-release-3.7

Automated cherry pick of #12149: fix(monitor): add monitor resource details field
This commit is contained in:
Zexi Li
2021-09-08 22:52:29 +08:00
committed by GitHub
3 changed files with 8 additions and 0 deletions
+3
View File
@@ -33,6 +33,9 @@ type MonitorResourceListInput struct {
type MonitorResourceDetails struct {
apis.VirtualResourceDetails
compute.CloudregionResourceInfo
compute.CloudaccountResourceInfo
Ips string `json:"ips"`
AccessIp string `json:"access_ip"`
AttachAlertCount int64 `json:"attach_alert_count"`
}
+1
View File
@@ -58,6 +58,7 @@ type Details struct {
Brand string
DomainId string
ProjectDomain string
Ips string
}
type Guest struct {
compute_models.SGuest
+4
View File
@@ -295,6 +295,10 @@ func (self *SMonitorResource) getMoreDetails(out monitor.MonitorResourceDetails)
if err != nil {
log.Errorf("getMoreDetails err:%v", err)
}
_, object := MonitorResourceManager.GetResourceObj(self.ResId)
if object != nil {
object.Unmarshal(&out)
}
out.AttachAlertCount = int64(len(joints))
return out
}