Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions pkg/services/profiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,14 +220,23 @@ func (svc *ProfileService) Import(in Profile) (*Profile, error) {
func (svc *ProfileService) Export(name string) (*Profile, error) {
logger.Trace()

var res Profile
var uri = fmt.Sprintf("/profiles/%s/export", name)
type Response struct {
Metadata Metadata `json:"metadata"`
Profile *Profile `json:"profile"`
}

var res Response

// XXX (privateip): The export URI returns an error from the server so
// using the get profile route instead
//var uri = fmt.Sprintf("/profiles/%s/export", name)
var uri = fmt.Sprintf("/profiles/%s", name)

if err := svc.client.Get(uri, &res); err != nil {
return nil, err
}

return &res, nil
return res.Profile, nil
}

func (svc *ProfileService) Activate(name string) error {
Expand Down