mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 10:46:58 +08:00
fix: modify list details for guesttemplate
This commit is contained in:
@@ -57,6 +57,7 @@ type GuestTemplateDetails struct {
|
||||
|
||||
Secgroups []string `json:"secgroups"`
|
||||
Zone string `json:"zone"`
|
||||
ZoneId string `json:"zone_id"`
|
||||
Brand string `json:"brand"`
|
||||
|
||||
ConfigInfo GuestTemplateConfigInfo `json:"config_info"`
|
||||
@@ -71,9 +72,6 @@ type GuestTemplateListInput struct {
|
||||
}
|
||||
|
||||
type GuestTemplateConfigInfo struct {
|
||||
Region string `json:"region"`
|
||||
Zone string `json:"zone"`
|
||||
Hypervisor string `json:"hypervisor"`
|
||||
Secgroup string `json:"secgroup"`
|
||||
Sku GuestTemplateSku `json:"sku"`
|
||||
Disks []GuestTemplateDisk `json:"disks"`
|
||||
|
||||
@@ -345,23 +345,14 @@ func (gt *SGuestTemplate) getMoreDetails(ctx context.Context, userCred mcclient.
|
||||
return out, err
|
||||
}
|
||||
configInfo := computeapis.GuestTemplateConfigInfo{}
|
||||
if len(input.PreferRegion) != 0 {
|
||||
region := CloudregionManager.FetchRegionById(input.PreferRegion)
|
||||
if region != nil {
|
||||
input.PreferRegion = region.GetName()
|
||||
}
|
||||
configInfo.Region = input.PreferRegion
|
||||
|
||||
}
|
||||
if len(input.PreferZone) != 0 {
|
||||
zone := ZoneManager.FetchZoneById(input.PreferZone)
|
||||
if zone != nil {
|
||||
input.PreferZone = zone.GetName()
|
||||
}
|
||||
out.ZoneId = zone.GetId()
|
||||
out.Zone = input.PreferZone
|
||||
configInfo.Zone = input.PreferZone
|
||||
}
|
||||
configInfo.Hypervisor = gt.Hypervisor
|
||||
out.Brand = Hypervisor2Brand(gt.Hypervisor)
|
||||
|
||||
// sku deal
|
||||
|
||||
Reference in New Issue
Block a user