add ownerName to backup list json (#3481)

#### Does this PR need a docs update or release note?

- [x]  Yes, it's included

#### Type of change

- [x] 🌻 Feature

#### Issue(s)

* #3748

#### Test Plan

- [x] 💪 Manual
- [x]  Unit test
This commit is contained in:
Keepers 2023-05-23 10:31:52 -06:00 committed by GitHub
parent 64ad412456
commit d3611db059
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 10 deletions

View File

@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] (beta) ## [Unreleased] (beta)
### Added ### Added
- Added OwnerName to the backup list json output. OwnerName holds either a UPN or a WebURL, depending on the resource type.
### Fixed ### Fixed
- Fix Exchange folder cache population error when parent folder isn't found. - Fix Exchange folder cache population error when parent folder isn't found.
- Fix Exchange backup issue caused by incorrect json serialization - Fix Exchange backup issue caused by incorrect json serialization

View File

@ -167,21 +167,23 @@ func PrintAll(ctx context.Context, bs []*Backup) {
} }
type Printable struct { type Printable struct {
ID model.StableID `json:"id"` ID model.StableID `json:"id"`
Status string `json:"status"` Status string `json:"status"`
Version string `json:"version"` Version string `json:"version"`
Owner string `json:"owner"` Owner string `json:"owner"`
Stats backupStats `json:"stats"` OwnerName string `json:"ownerName"`
Stats backupStats `json:"stats"`
} }
// ToPrintable reduces the Backup to its minimally printable details. // ToPrintable reduces the Backup to its minimally printable details.
func (b Backup) ToPrintable() Printable { func (b Backup) ToPrintable() Printable {
return Printable{ return Printable{
ID: b.ID, ID: b.ID,
Status: b.Status, Status: b.Status,
Version: "0", Version: "0",
Owner: b.Selector.DiscreteOwner, Owner: b.Selector.DiscreteOwner,
Stats: b.toStats(), OwnerName: b.Selector.DiscreteOwnerName,
Stats: b.toStats(),
} }
} }