From de329f4a806fa3069536852dd941620bec6891ca Mon Sep 17 00:00:00 2001 From: Rain Date: Tue, 14 Apr 2020 15:38:08 +0800 Subject: [PATCH] fix(region): Fix the snapshotpolicy info in DiskDetails --- pkg/apis/compute/disk.go | 6 ++++-- pkg/compute/models/disks.go | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/apis/compute/disk.go b/pkg/apis/compute/disk.go index de6081c1f2..3e93d59230 100644 --- a/pkg/apis/compute/disk.go +++ b/pkg/apis/compute/disk.go @@ -176,8 +176,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 ca358b94f3..a9e4cb0567 100644 --- a/pkg/compute/models/disks.go +++ b/pkg/compute/models/disks.go @@ -1894,6 +1894,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()