Skip to content

Commit

Permalink
Adding Query Parameter for listing snapshots for dellctl support (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
harshitap26 authored Aug 6, 2024
1 parent 1c0c336 commit aff0b89
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion api/v1/api_v1_snapshots.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,34 @@ func GetIsiSnapshots(
if err != nil {
return nil, err
}
return resp, nil
snapshotList := resp.SnapshotList

for {
if resp.Resume == "" {
break
}

snapshotQS := api.OrderedValues{
{[]byte("resume"), []byte(resp.Resume)},
}

var newResp *getIsiSnapshotsResp
// PAPI call: GET https://1.2.3.4:8080/platform/1/snapshot/snapshots?resume=<resume token>
err := client.Get(ctx, snapshotsPath, "", snapshotQS, nil, &newResp)
if err != nil {
return nil, err
}

snapshotList = append(snapshotList, newResp.SnapshotList...)
resp = newResp
}

isiSnapshotResp := &getIsiSnapshotsResp{
SnapshotList: snapshotList,
Total: resp.Total,
Resume: resp.Resume,
}
return isiSnapshotResp, nil
}

// GetIsiSnapshot queries an individual snapshot on the cluster
Expand Down

0 comments on commit aff0b89

Please sign in to comment.