mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
补充主机计费的shortdesc参数
This commit is contained in:
@@ -3777,6 +3777,20 @@ func (self *SGuest) GetShortDesc() *jsonutils.JSONDict {
|
||||
desc := self.SStandaloneResourceBase.GetShortDesc()
|
||||
desc.Set("mem", jsonutils.NewInt(int64(self.VmemSize)))
|
||||
desc.Set("cpu", jsonutils.NewInt(int64(self.VcpuCount)))
|
||||
|
||||
address := jsonutils.NewString(strings.Join(self.getRealIPs(), ","))
|
||||
desc.Set("ip_addr", address)
|
||||
|
||||
if len(self.OsType) > 0 {
|
||||
desc.Add(jsonutils.NewString(self.OsType), "os_type")
|
||||
}
|
||||
if osDist := self.GetMetadata("os_distribution", nil); len(osDist) > 0 {
|
||||
desc.Add(jsonutils.NewString(osDist), "os_distribution")
|
||||
}
|
||||
if osVer := self.GetMetadata("os_version", nil); len(osVer) > 0 {
|
||||
desc.Add(jsonutils.NewString(osVer), "os_version")
|
||||
}
|
||||
|
||||
templateId := self.GetTemplateId()
|
||||
if len(templateId) > 0 {
|
||||
desc.Set("cpu", jsonutils.NewString(templateId))
|
||||
|
||||
Reference in New Issue
Block a user