From d3611db0596aed0d3fc274054579ec6f7338fa8f Mon Sep 17 00:00:00 2001 From: Keepers Date: Tue, 23 May 2023 10:31:52 -0600 Subject: [PATCH] add ownerName to backup list json (#3481) #### Does this PR need a docs update or release note? - [x] :white_check_mark: Yes, it's included #### Type of change - [x] :sunflower: Feature #### Issue(s) * #3748 #### Test Plan - [x] :muscle: Manual - [x] :zap: Unit test --- CHANGELOG.md | 2 ++ src/pkg/backup/backup.go | 22 ++++++++++++---------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90246cebd..afdbc8a79 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] (beta) ### Added +- Added OwnerName to the backup list json output. OwnerName holds either a UPN or a WebURL, depending on the resource type. + ### Fixed - Fix Exchange folder cache population error when parent folder isn't found. - Fix Exchange backup issue caused by incorrect json serialization diff --git a/src/pkg/backup/backup.go b/src/pkg/backup/backup.go index 352015203..d0796b58c 100644 --- a/src/pkg/backup/backup.go +++ b/src/pkg/backup/backup.go @@ -167,21 +167,23 @@ func PrintAll(ctx context.Context, bs []*Backup) { } type Printable struct { - ID model.StableID `json:"id"` - Status string `json:"status"` - Version string `json:"version"` - Owner string `json:"owner"` - Stats backupStats `json:"stats"` + ID model.StableID `json:"id"` + Status string `json:"status"` + Version string `json:"version"` + Owner string `json:"owner"` + OwnerName string `json:"ownerName"` + Stats backupStats `json:"stats"` } // ToPrintable reduces the Backup to its minimally printable details. func (b Backup) ToPrintable() Printable { return Printable{ - ID: b.ID, - Status: b.Status, - Version: "0", - Owner: b.Selector.DiscreteOwner, - Stats: b.toStats(), + ID: b.ID, + Status: b.Status, + Version: "0", + Owner: b.Selector.DiscreteOwner, + OwnerName: b.Selector.DiscreteOwnerName, + Stats: b.toStats(), } }