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:27 UTC

[incubator-openwhisk-cli] branch master updated (9890308 -> 1287189)

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

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


    from 9890308  Add the wild card to support multiple packages under one directory (#78)
     new 42ee9cf  Update Usage for Activation Poll (#2398)
     new 20d04fd  Updates for Max Activation List Limit (#2215)
     new e3dcd92  Update all Go files with ASF License header. (#2422)
     new 1287189  wsk CLI should tolerate APIs that do not yet have a mapped action (#2458)

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 commands/activation.go           |  9 +++++---
 commands/api.go                  | 45 ++++++++++++++++++++++++++++------------
 commands/shared.go               | 13 ++++++------
 main.go                          | 13 ++++++------
 wski18n/resources/en_US.all.json |  8 +++++--
 5 files changed, 58 insertions(+), 30 deletions(-)

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

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

Posted by ho...@apache.org.
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>.

[incubator-openwhisk-cli] 04/04: wsk CLI should tolerate APIs that do not yet have a mapped action (#2458)

Posted by ho...@apache.org.
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 128718933b53de28a96f1c80707a2c746e8203d4
Author: Mark Deuser <md...@us.ibm.com>
AuthorDate: Fri Jul 7 14:40:19 2017 -0400

    wsk CLI should tolerate APIs that do not yet have a mapped action (#2458)
    
    * wsk CLI should tolerate APIs that do not yet have a mapped action
    - bump API GW version so that action-less APIs can be created via cli/swagger
    
    * Add `wsk api list --full` test for action-less apis
---
 commands/api.go                  | 45 ++++++++++++++++++++++++++++------------
 wski18n/resources/en_US.all.json |  4 ++++
 2 files changed, 36 insertions(+), 13 deletions(-)

diff --git a/commands/api.go b/commands/api.go
index 11aa494..968c8b7 100644
--- a/commands/api.go
+++ b/commands/api.go
@@ -864,21 +864,34 @@ var apiCreateCmdV2 = &cobra.Command{
                 for op, opv  := range retApi.Swagger.Paths[path] {
                     whisk.Debug(whisk.DbgInfo, "Path operation: %s\n", op)
                     var fqActionName string
-                    if (len(opv.XOpenWhisk.Package) > 0) {
+                    if (opv.XOpenWhisk == nil) {
+                        fqActionName = ""
+                    } else if (len(opv.XOpenWhisk.Package) > 0) {
                         fqActionName = "/"+opv.XOpenWhisk.Namespace+"/"+opv.XOpenWhisk.Package+"/"+opv.XOpenWhisk.ActionName
                     } else {
                         fqActionName = "/"+opv.XOpenWhisk.Namespace+"/"+opv.XOpenWhisk.ActionName
                     }
                     whisk.Debug(whisk.DbgInfo, "baseUrl %s  Path %s  Path obj %+v\n", baseUrl, path, opv)
-                    fmt.Fprintf(color.Output,
-                        wski18n.T("{{.ok}} created API {{.path}} {{.verb}} for action {{.name}}\n{{.fullpath}}\n",
-                            map[string]interface{}{
-                                "ok": color.GreenString("ok:"),
-                                "path": strings.TrimSuffix(retApi.Swagger.BasePath, "/") + path,
-                                "verb": op,
-                                "name": boldString(fqActionName),
-                                "fullpath": managedUrl,
-                            }))
+                    if len(fqActionName) > 0 {
+                        fmt.Fprintf(color.Output,
+                            wski18n.T("{{.ok}} created API {{.path}} {{.verb}} for action {{.name}}\n{{.fullpath}}\n",
+                                map[string]interface{}{
+                                    "ok": color.GreenString("ok:"),
+                                    "path": strings.TrimSuffix(retApi.Swagger.BasePath, "/") + path,
+                                    "verb": op,
+                                    "name": boldString(fqActionName),
+                                    "fullpath": managedUrl,
+                                }))
+                    } else {
+                        fmt.Fprintf(color.Output,
+                            wski18n.T("{{.ok}} created API {{.path}} {{.verb}}\n{{.fullpath}}\n",
+                                map[string]interface{}{
+                                    "ok": color.GreenString("ok:"),
+                                    "path": strings.TrimSuffix(retApi.Swagger.BasePath, "/") + path,
+                                    "verb": op,
+                                    "fullpath": managedUrl,
+                                }))
+                    }
                 }
             }
         }
@@ -1218,7 +1231,9 @@ func printFilteredListApiV2(resultApi *whisk.RetApiV2, apiPath string, apiVerb s
                     if ( len(apiVerb) == 0 || strings.ToLower(op) == strings.ToLower(apiVerb)) {
                         whisk.Debug(whisk.DbgInfo, "printFilteredListApiV2: operation matches: %#v\n", opv)
                         var actionName string
-                        if (len(opv.XOpenWhisk.Package) > 0) {
+                        if (opv.XOpenWhisk == nil) {
+                            actionName = ""
+                        } else if (len(opv.XOpenWhisk.Package) > 0) {
                             actionName = "/"+opv.XOpenWhisk.Namespace+"/"+opv.XOpenWhisk.Package+"/"+opv.XOpenWhisk.ActionName
                         } else {
                             actionName = "/"+opv.XOpenWhisk.Namespace+"/"+opv.XOpenWhisk.ActionName
@@ -1256,7 +1271,9 @@ func printFilteredListRowV2(resultApi *whisk.RetApiV2, apiPath string, apiVerb s
                     if ( len(apiVerb) == 0 || strings.ToLower(op) == strings.ToLower(apiVerb)) {
                         whisk.Debug(whisk.DbgInfo, "printFilteredListRowV2: operation matches: %#v\n", opv)
                         var actionName string
-                        if (len(opv.XOpenWhisk.Package) > 0) {
+                        if (opv.XOpenWhisk == nil) {
+                            actionName = ""
+                        } else if (len(opv.XOpenWhisk.Package) > 0) {
                             actionName = "/"+opv.XOpenWhisk.Namespace+"/"+opv.XOpenWhisk.Package+"/"+opv.XOpenWhisk.ActionName
                         } else {
                             actionName = "/"+opv.XOpenWhisk.Namespace+"/"+opv.XOpenWhisk.ActionName
@@ -1287,7 +1304,9 @@ func getLargestActionNameSizeV2(retApiArray *whisk.RetApiArrayV2, apiPath string
                         if ( len(apiVerb) == 0 || strings.ToLower(op) == strings.ToLower(apiVerb)) {
                             whisk.Debug(whisk.DbgInfo, "getLargestActionNameSize: operation matches: %#v\n", opv)
                             var fullActionName string
-                            if (len(opv.XOpenWhisk.Package) > 0) {
+                            if (opv.XOpenWhisk == nil) {
+                                fullActionName = ""
+                            } else if (len(opv.XOpenWhisk.Package) > 0) {
                                 fullActionName = "/"+opv.XOpenWhisk.Namespace+"/"+opv.XOpenWhisk.Package+"/"+opv.XOpenWhisk.ActionName
                             } else {
                                 fullActionName = "/"+opv.XOpenWhisk.Namespace+"/"+opv.XOpenWhisk.ActionName
diff --git a/wski18n/resources/en_US.all.json b/wski18n/resources/en_US.all.json
index 7d3a9bd..765f961 100644
--- a/wski18n/resources/en_US.all.json
+++ b/wski18n/resources/en_US.all.json
@@ -1188,6 +1188,10 @@
     "translation": "{{.ok}} created API {{.path}} {{.verb}} for action {{.name}}\n{{.fullpath}}\n"
   },
   {
+    "id": "{{.ok}} created API {{.path}} {{.verb}}\n{{.fullpath}}\n",
+    "translation": "{{.ok}} created API {{.path}} {{.verb}}\n{{.fullpath}}\n"
+  },
+  {
     "id": "Unable to parse api command arguments: {{.err}}",
     "translation": "Unable to parse api command arguments: {{.err}}"
   },

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

[incubator-openwhisk-cli] 03/04: Update all Go files with ASF License header. (#2422)

Posted by ho...@apache.org.
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 e3dcd923d80dc05cfd5302267f11c7d952ee2b29
Author: Matt Rutkowski <mr...@us.ibm.com>
AuthorDate: Fri Jun 30 18:45:15 2017 -0500

    Update all Go files with ASF License header. (#2422)
---
 commands/shared.go | 13 +++++++------
 main.go            | 13 +++++++------
 2 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/commands/shared.go b/commands/shared.go
index 9f4acd4..7ff8e94 100644
--- a/commands/shared.go
+++ b/commands/shared.go
@@ -1,11 +1,12 @@
 /*
- * Copyright 2015-2016 IBM Corporation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
diff --git a/main.go b/main.go
index bf2e505..eb8aca8 100644
--- a/main.go
+++ b/main.go
@@ -1,11 +1,12 @@
 /*
- * Copyright 2015-2016 IBM Corporation
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
  *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
+ *     http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,

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

[incubator-openwhisk-cli] 01/04: Update Usage for Activation Poll (#2398)

Posted by ho...@apache.org.
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 42ee9cfee9ad5d63643b48b0d5d3614265a3e9d7
Author: James Dubee <jw...@us.ibm.com>
AuthorDate: Fri Jun 23 09:29:36 2017 -0400

    Update Usage for Activation Poll (#2398)
    
    * Update Usage for Activation Poll
---
 commands/activation.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/commands/activation.go b/commands/activation.go
index 347f612..e8d54c5 100644
--- a/commands/activation.go
+++ b/commands/activation.go
@@ -218,7 +218,7 @@ var activationResultCmd = &cobra.Command{
 }
 
 var activationPollCmd = &cobra.Command{
-    Use:   "poll [NAMESPACE]",
+    Use:   "poll [ NAMESPACE | ACTION_NAME ]",
     Short: wski18n.T("poll continuously for log messages from currently running actions"),
     SilenceUsage:   true,
     SilenceErrors:  true,

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