diff --git a/pkg/apis/compute/disk.go b/pkg/apis/compute/disk.go index d4a122dfbd..ab3f2e9478 100644 --- a/pkg/apis/compute/disk.go +++ b/pkg/apis/compute/disk.go @@ -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 { diff --git a/pkg/compute/models/disks.go b/pkg/compute/models/disks.go index a4e7cf9c4b..5be818fc4d 100644 --- a/pkg/compute/models/disks.go +++ b/pkg/compute/models/disks.go @@ -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()