The get-snapshots API accepts a size parameter to limit the number of snapshots returned, but today it still retrieves all potentially-matching SnapshotInfo blobs before applying the limit. In repositories containing hundreds/thousands of snapshots this can take many minutes, and consume a large amount of heap. However we have enough information in the RepositoryData to apply the limit before retrieving any SnapshotInfo blobs if sorting by name, start time, or duration. We should do that to save time and memory.
Workaround
Note that the from_sort_value parameter does restrict the SnapshotInfo blobs retrieved if sorting by name, start time, or duration, so you can say sort=start_time&order=asc&from_sort_value=XXXXXX to restrict things to just the snapshots which started after time XXXXXX (in milliseconds since the Unix epoch). If you pick a time close enough to the present then the API still works.
The get-snapshots API accepts a
sizeparameter to limit the number of snapshots returned, but today it still retrieves all potentially-matchingSnapshotInfoblobs before applying the limit. In repositories containing hundreds/thousands of snapshots this can take many minutes, and consume a large amount of heap. However we have enough information in theRepositoryDatato apply the limit before retrieving anySnapshotInfoblobs if sorting by name, start time, or duration. We should do that to save time and memory.Workaround
Note that the
from_sort_valueparameter does restrict theSnapshotInfoblobs retrieved if sorting by name, start time, or duration, so you can saysort=start_time&order=asc&from_sort_value=XXXXXXto restrict things to just the snapshots which started after timeXXXXXX(in milliseconds since the Unix epoch). If you pick a time close enough to the present then the API still works.