fix(region): azure created time sync

This commit is contained in:
ioito
2022-04-15 17:33:54 +08:00
parent d82b44deec
commit deedc5e38e
3 changed files with 5 additions and 4 deletions

View File

@@ -433,7 +433,7 @@ func (self *SAzureClient) _apiVersion(resource string, params url.Values) string
return "2020-06-01"
}
if utils.IsInStringArray("virtualmachines", info) {
return "2018-04-01"
return "2021-11-01"
}
if utils.IsInStringArray("skus", info) {
return "2019-04-01"

View File

@@ -59,7 +59,7 @@ func (ai TAzureInt32) Int32() int32 {
}
type DiskProperties struct {
//TimeCreated time.Time //??? 序列化出错?
TimeCreated time.Time `json:"timeCreated,omitempty"`
OsType string `json:"osType,omitempty"`
CreationData CreationData `json:"creationData,omitempty"`
DiskSizeGB TAzureInt32 `json:"diskSizeGB,omitempty"`
@@ -297,7 +297,7 @@ func (self *SDisk) GetBillingType() string {
}
func (self *SDisk) GetCreatedAt() time.Time {
return time.Time{}
return self.Properties.TimeCreated
}
func (self *SDisk) GetExpiredAt() time.Time {

View File

@@ -155,6 +155,7 @@ type VirtualMachineProperties struct {
DebugProfile *DebugProfile `json:"debugProfile,omitempty"`
OsProfile OsProfile `json:"osProfile,omitempty"`
VmId string `json:"vmId,omitempty"`
TimeCreated time.Time `json:"timeCreated,omitempty"`
}
type SExtensionResourceProperties struct {
@@ -1020,7 +1021,7 @@ func (self *SInstance) GetBillingType() string {
}
func (self *SInstance) GetCreatedAt() time.Time {
return time.Time{}
return self.Properties.TimeCreated
}
func (self *SInstance) GetExpiredAt() time.Time {