cli icon indicating copy to clipboard operation
cli copied to clipboard

Ability to limit the amount of tasks returned by `cf tasks`

Open CN91 opened this issue 3 years ago • 0 comments

Please provide details on the following items. Failure to do so may result in deletion of your feature request.

What's the user value of this feature request? Currently when we use cf tasks APP_NAME if an app has a lot of tasks, it can take a long time for the response to be given. The web-api seems to be handling this with pagination, but via the CLI we can't limit.

if we were able to use something like cf tasks APP_NAME --recent or cf tasks APP_NAME limit 100 or cf tasks APP_NAME --page 1

Who is the functionality for? People using many tasks and who are waiting for run_task --wait to return.

How often will this functionality be used by the user? For us lots of times, each PR currently calls this command.

Who else is affected by the change? It's an addition so shouldn't have any impact on existing functionality

Is your feature request related to a problem? Please describe. Yes, the call to cf tasks takes too long to load when there are many tasks in the history. I also see no way for user to clear up the history.

Describe the solution you'd like Able to limit the scope of cf tasks to just a list of recently run tasks or clear set number.

cf tasks APP_NAME --recent or cf tasks APP_NAME limit 100 or cf tasks APP_NAME --page 1

Describe alternatives you've considered There's no way to get the status of one specific task, can't use --wait on cf run_task in cf cli v8 since https://github.com/cloudfoundry/cli/issues/2238 is still open.

Additional context According to the web-ui our current app has ~845 pages of tasks/jobs in it's history. Running cf tasks takes about 6/7 minutes to get a response!!

Note: As of the GA of the v7 CLI, the v6 line is no longer under active development and will be updated only to patch CVEs or fix severe blocking defects with no workarounds.

CN91 avatar Oct 18 '22 11:10 CN91