You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2017/10/18 21:57:40 UTC

[GitHub] alexkli commented on a change in pull request #2848: Support reading param.json from stdin #2837

alexkli commented on a change in pull request #2848: Support reading param.json from stdin #2837
URL: https://github.com/apache/incubator-openwhisk/pull/2848#discussion_r145554426
 
 

 ##########
 File path: docs/actions.md
 ##########
 @@ -202,6 +202,39 @@ Parameters can be passed to the action when it is invoked.
       "payload": "Hello, Bernie from Vermont"
   }
   ```
+4.  It is possible to pipe JSON parameters to the `wsk` command by using the special filename `-` with `--params-file` or `-P`:
+  
+  ```
+  cat parameters.json | envsubst | wsk action invoke -r hello -P -
+  ```
+  
+  This example uses `envsubst` to replace environment variables in the JSON before passing them to the action invocation.
 
 Review comment:
   I thought it's nice to have a more "real world" use case example.
   
   The echo example can also be done simpler using `-p name Alice`. I chose `envsubst` as that's an actual case where you need to pipe from a file since some processing is going on, and I happened to be using `envsubst` in my case.
   
   Do you think there is a need to be as simple as possible?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services