'--last' doesn't work for all st2 CLI endpoints
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 6.5k
- Forks
- 787
- PR merge metrics
- No merged PRs in 30d
Description
We recently introduced --last -1 #3735 param to show all CLI results and forced pagination to 50 per page for CLI output (some CLI previously reported ALL results by default).
However --last present only for some CLI endpoints.
Ideally to have all the CLI working in the same manner & make it consistent and predictable.
And while some CLIs are missing --last, for example currently st2 action list outputs ALL the results, while other CLIs limit output to only 50 results.
List of working CLI endpoints with --last:
- st2 execution list
- st2 key list
- st2 rule list
- st2 trace list
- st2 trigger-instance list
- st2 rule-enforcement list
Missing --last param
- st2 action list
- st2 action-alias list
- st2 apikey list
- st2 pack list
- st2 policy list
- st2 policy-type list
- st2 webhook list
- st2 timer list
- st2 runner list
- st2 sensor list
- st2 trigger list
- st2 role list
- st2 role-assignment list
Example CLI missing --last
$ st2 action list --last 1
usage: st2 [-h] [--version] [--url BASE_URL] [--auth-url AUTH_URL]
[--api-url API_URL] [--stream-url STREAM_URL]
[--api-version API_VERSION] [--cacert CACERT]
[--config-file CONFIG_FILE] [--print-config] [--skip-config]
[--debug]
{run,action,action-alias,auth,login,whoami,apikey,execution,inquiry,key,pack,policy,policy-type,rule,webhook,timer,runner,sensor,trace,trigger,trigger-instance,rule-enforcement,role,role-assignment}
...
st2: error: unrecognized arguments: --last 1
cc @humblearner
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the existing --last behavior in the listed working endpoints with the missing endpoints, using st2 action list --last 1 as the reproduction case. Review the CLI entry points for each missing list command and their help output. Done means all listed endpoints accept --last and use consistent result limits and pagination behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100