You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by ho...@apache.org on 2017/07/11 03:07:29 UTC

[incubator-openwhisk-cli] 02/04: Updates for Max Activation List Limit (#2215)

This is an automated email from the ASF dual-hosted git repository.

houshengbo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-cli.git

commit 20d04fdb2041d4ca30502f0b743b4707635f073d
Author: James Dubee <jw...@us.ibm.com>
AuthorDate: Thu Jun 29 15:04:41 2017 -0400

    Updates for Max Activation List Limit (#2215)
    
    Inform users that 200 activations is the maximum limit for the list command when exceeding the limit.
---
 commands/activation.go           | 7 +++++--
 wski18n/resources/en_US.all.json | 4 ++--
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/commands/activation.go b/commands/activation.go
index e8d54c5..d7f59b2 100644
--- a/commands/activation.go
+++ b/commands/activation.go
@@ -35,9 +35,10 @@ import (
 const (
     PollInterval = time.Second * 2
     Delay        = time.Second * 5
+    MAX_ACTIVATION_LIMIT = 200
+    DEFAULT_ACTIVATION_LIMIT = 30
 )
 
-// activationCmd represents the activation command
 var activationCmd = &cobra.Command{
     Use:   "activation",
     Short: wski18n.T("work with activations"),
@@ -77,6 +78,7 @@ var activationListCmd = &cobra.Command{
             Since: Flags.activation.since,
             Docs:  Flags.common.full,
         }
+
         activations, _, err := client.Activations.List(options)
         if err != nil {
             whisk.Debug(whisk.DbgError, "client.Activations.List() error: %s\n", err)
@@ -332,7 +334,8 @@ var activationPollCmd = &cobra.Command{
 
 func init() {
     activationListCmd.Flags().IntVarP(&Flags.common.skip, "skip", "s", 0, wski18n.T("exclude the first `SKIP` number of activations from the result"))
-    activationListCmd.Flags().IntVarP(&Flags.common.limit, "limit", "l", 30, wski18n.T("only return `LIMIT` number of activations from the collection"))
+    activationListCmd.Flags().IntVarP(&Flags.common.limit, "limit", "l", DEFAULT_ACTIVATION_LIMIT, wski18n.T("only return `LIMIT` number of activations from the collection with a maximum LIMIT of {{.max}} activations",
+        map[string]interface{}{"max": MAX_ACTIVATION_LIMIT}))
     activationListCmd.Flags().BoolVarP(&Flags.common.full, "full", "f", false, wski18n.T("include full activation description"))
     activationListCmd.Flags().Int64Var(&Flags.activation.upto, "upto", 0, wski18n.T("return activations with timestamps earlier than `UPTO`; measured in milliseconds since Th, 01, Jan 1970"))
     activationListCmd.Flags().Int64Var(&Flags.activation.since, "since", 0, wski18n.T("return activations with timestamps later than `SINCE`; measured in milliseconds since Th, 01, Jan 1970"))
diff --git a/wski18n/resources/en_US.all.json b/wski18n/resources/en_US.all.json
index fd27946..7d3a9bd 100644
--- a/wski18n/resources/en_US.all.json
+++ b/wski18n/resources/en_US.all.json
@@ -996,8 +996,8 @@
     "translation": "exclude the first `SKIP` number of activations from the result"
   },
   {
-    "id": "only return `LIMIT` number of activations from the collection",
-    "translation": "only return `LIMIT` number of activations from the collection"
+    "id": "only return `LIMIT` number of activations from the collection with a maximum LIMIT of {{.max}} activations",
+    "translation": "only return `LIMIT` number of activations from the collection with a maximum LIMIT of {{.max}} activations"
   },
   {
     "id": "include full activation description",

-- 
To stop receiving notification emails like this one, please contact
"commits@openwhisk.apache.org" <co...@openwhisk.apache.org>.