reanahub / reana-client

REANA command-line client
http://reana-client.readthedocs.io/
MIT License
10 stars 46 forks source link

cli: add new command to show user quota usage #424

Closed diegodelemos closed 4 years ago

diegodelemos commented 4 years ago

With the outcome of https://github.com/reanahub/reana-server/issues/279, we should create a new command to display quota usage for the logged-in user.

$ reana-client quota-show # or similar
...

To take inspiration from similar command-line tools, taking advantage of Click colors to show numbers in a more user-friendly way.

tiborsimko commented 4 years ago

Musings about quota commands:

So we could start with just one-two command in a new section at the end of reana-client --help.

Some options:

(1) Several commands primarily split by action (showing limits/usage, setting limit), for example:

$ reana-client quota-show --resource cpu --report limit
1234 minutes per month
$ reana-client quota-show --resource disk --report limit 
123456 KiB
$ reana-client quota-show --resource disk --report usage
123 KiB
$ reana-client quota-show --resource disk 
123 KiB out of 123456 KiB used (12.34%)

(2) Several commands primarily split by resource (cpu, disk); for example:

$ reana-client quota-cpu --report limit
$ reana-client quota-disk --report usage

By analogy with secrets-* I guess we can go for (1) which will open future possibilities of quota-set (some resource), quota-get (some resource), quota-list (gimme all resources that are under quota management), etc.

$ reana-client quota-list --resources
cpu
disk
$ reana-client quota-show --resource disk
123 KiB out of 123456 KiB used (12.34%)