fix(region): Fix the snapshotpolicy info in DiskDetails

This commit is contained in:
Rain
2020-04-14 15:41:17 +08:00
parent 3e170f8a9b
commit d8d04512ba
2 changed files with 6 additions and 2 deletions
+4 -2
View File
@@ -138,8 +138,10 @@ type SimpleGuest struct {
}
type SimpleSnapshotPolicy struct {
RepeatWeekdays []int `json:"repeat_weekdays"`
TimePoints []int `json:"time_points"`
Id string `json:"id"`
Name string `json:"name"`
RepeatWeekdays []int `json:"repeat_weekdays"`
TimePoints []int `json:"time_points"`
}
type DiskDetails struct {
+2
View File
@@ -1802,6 +1802,8 @@ func (self *SDisk) getMoreDetails(ctx context.Context, userCred mcclient.TokenCr
policy := api.SimpleSnapshotPolicy{}
policy.RepeatWeekdays = SnapshotPolicyManager.RepeatWeekdaysToIntArray(sps[i].RepeatWeekdays)
policy.TimePoints = SnapshotPolicyManager.TimePointsToIntArray(sps[i].TimePoints)
policy.Id = sps[i].Id
policy.Name = sps[i].Name
out.Snapshotpolicies = append(out.Snapshotpolicies, policy)
}
storage := self.GetStorage()