mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-21 14:19:49 +08:00
priceKey携带region信息
This commit is contained in:
@@ -113,7 +113,8 @@ type SClassicInstance struct {
|
||||
|
||||
func (self *SClassicInstance) GetMetadata() *jsonutils.JSONDict {
|
||||
data := jsonutils.NewDict()
|
||||
data.Add(jsonutils.NewString(self.Properties.HardwareProfile.Size), "price_key")
|
||||
priceKey := fmt.Sprintf("%s::%s", self.Properties.HardwareProfile.Size, self.host.zone.region.Name)
|
||||
data.Add(jsonutils.NewString(priceKey), "price_key")
|
||||
if self.Properties.NetworkProfile.NetworkSecurityGroup != nil {
|
||||
data.Add(jsonutils.NewString(self.Properties.NetworkProfile.NetworkSecurityGroup.ID), "secgroupId")
|
||||
}
|
||||
|
||||
@@ -224,7 +224,8 @@ func (self *SInstance) GetMetadata() *jsonutils.JSONDict {
|
||||
data.Add(jsonutils.NewString(loginKey), "login_key")
|
||||
}
|
||||
|
||||
data.Add(jsonutils.NewString(self.Properties.HardwareProfile.VMSize), "price_key")
|
||||
priceKey := fmt.Sprintf("%s::%s", self.Properties.HardwareProfile.VMSize, self.host.zone.region.Name)
|
||||
data.Add(jsonutils.NewString(priceKey), "price_key")
|
||||
if nics, err := self.getNics(); err == nil {
|
||||
for _, nic := range nics {
|
||||
if nic.Properties.NetworkSecurityGroup != nil {
|
||||
|
||||
Reference in New Issue
Block a user