legacy-cli icon indicating copy to clipboard operation
legacy-cli copied to clipboard

The --limit option does not work for a value >10

Open budda opened this issue 10 years ago • 5 comments

Feature request.

→ platform snapshot:list --project u3tucrjygkrgk --environment snapshot

The above only gives me 10 snapshots with their dates. We may wish to restore a snapshot from 3 months ago so need a way to get snapshots list for a given date range or just a full list maybe?

The Web UI doesn't help find snapshots over 30 days old either as everything is shown as "a month ago" until you manually hover over it with the mouse (very time consuming!)

budda avatar Oct 06 '15 11:10 budda

p.s. worth noting that platform snapshot:list --project u3tucrjygkrgk --environment master --limit=100 doesn't return more than 10, but a limit of 5 does return a smaller list.

budda avatar Oct 06 '15 11:10 budda

Yes, this is a higher up bug (in the API) which we are tracking internally. At the moment there is a limit effectively hardcoded to 10. I'm leaving this issue open as it provides more visibility on the bug.

pjcdawkins avatar Oct 06 '15 19:10 pjcdawkins

How does the web UI manage to keep loading more snapshots as you scroll down the event list if it's using the same api?

budda avatar Oct 06 '15 20:10 budda

Good point - there is a starts_at parameter on the API, which takes a timestamp.

GET /api/projects/<projectId>/environments/<environmentId>/activities?starts_at=2015-09-25T11:47:46.506908%2B00:00

Let me investigate how the web UI uses that. It doesn't seem very practical to specify times on the command-line but perhaps it could page through in a similar infinite-scroll kind of way, at least.

pjcdawkins avatar Oct 06 '15 20:10 pjcdawkins

OK... in v2.5.1 I've added a --start option to snapshot:list. Specify any date/time that PHP's strtotime() understands.

The --limit option still won't work. I'll change this issue's title to reflect this.

pjcdawkins avatar Oct 06 '15 20:10 pjcdawkins