Openwhisk: update CLI help activation list command to specify max is 200

Created on 1 Apr 2017  路  12Comments  路  Source: apache/openwhisk

wsk activation list -h doesn't specify that max is 200 for limit only default is 30

.... from the collection (default 30)

maybe update to

.... from the collection (default 30, max 200)
wsk activation list -h
list activations
Usage:
  wsk activation list [NAMESPACE or NAME] [flags]

Flags:
  -f, --full          include full activation description
  -l, --limit LIMIT   only return LIMIT number of activations from the collection (default 30)
      --since SINCE   return activations with timestamps later than SINCE; measured in milliseconds since Th, 01, Jan 1970
  -s, --skip SKIP     exclude the first SKIP number of activations from the result
      --upto UPTO     return activations with timestamps earlier than UPTO; measured in milliseconds since Th, 01, Jan 1970

Global Flags:
      --apihost HOST         whisk API HOST
      --apiversion VERSION   whisk API VERSION
  -u, --auth KEY             authorization KEY
  -d, --debug                debug level output
  -i, --insecure             bypass certificate checking
  -v, --verbose              verbose output

cc @rabbah

cli enhancement

Most helpful comment

How do we feel about erroring out if limit is greater than 200?

All 12 comments

@csantanapr, the minimum and maximums should be added to all command (action, trigger, etc...) flags that take numeric input. The only issue is that we can't include the min and max in parentheses with the default as that text is generated by a package we utilize to parse arguments. We'd have to do something that would look like this only returnLIMITnumber of activations from the collection (min 1, max 200) (default 30)

it would nice if this is done to avoid hard coding any of these values in the cli directly - to avoid going out of sync with the api/backend.

some limits (and supported runtimes) will soon be available as part of pr #1980; we could consider adding more here, or reading the info from the swagger where appropriate.

i would like to avoid a repeat of the schema getting out of sync with the backend with bit us repeatedly until some of it was removed.

+1 drive thru configuration, do not hard code numbers if possible.

Hmm, sounds like we will have to query the backend for limits when the help commands are invoked.

I've seen this several times where users try to use wsk activation list with limit greater than 200 and don't see any more than 200 activations. The help says default is 30 but doesn't state a max. In the interest of less confusion doing the simple thing first works for me (hardcoding 200 in the cli help).

@rabbah, does the controller display the max/min values for such values yet via API call?

If we want the CLI to dynamically display min/max values, I can look at adding them to some kind of info route that's related to specific APIs in the controller.

suggest we hard code now - that's a 1 minute fix.
and address the config separately.

How do we feel about erroring out if limit is greater than 200?

hmm i thought you meant error out in the CLI; changing the API response is a breaking change we should mull over.

I would say for now just error in the CLI.

Originally I had changed the CLI to error. Removed that based on review comments.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dubee picture dubee  路  4Comments

andrepoleza picture andrepoleza  路  6Comments

csantanapr picture csantanapr  路  5Comments

varsha33 picture varsha33  路  5Comments

tysonnorris picture tysonnorris  路  3Comments