{"action":"created","issue":{"url":"https://api.github.com/repos/apache/incubator-openwhisk/issues/2837","repository_url":"https://api.github.com/repos/apache/incubator-openwhisk","labels_url":"https://api.github.com/repos/apache/incubator-openwhisk/issues/2837/labels{/name}","comments_url":"https://api.github.com/repos/apache/incubator-openwhisk/issues/2837/comments","events_url":"https://api.github.com/repos/apache/incubator-openwhisk/issues/2837/events","html_url":"https://github.com/apache/incubator-openwhisk/issues/2837","id":263312112,"number":2837,"title":"Support reading param.json from stdin","user":{"login":"alexkli","id":229022,"avatar_url":"https://avatars0.githubusercontent.com/u/229022?v=4","gravatar_id":"","url":"https://api.github.com/users/alexkli","html_url":"https://github.com/alexkli","followers_url":"https://api.github.com/users/alexkli/followers","following_url":"https://api.github.com/users/alexkli/following{/other_user}","gists_url":"https://api.github.com/users/alexkli/gists{/gist_id}","starred_url":"https://api.github.com/users/alexkli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexkli/subscriptions","organizations_url":"https://api.github.com/users/alexkli/orgs","repos_url":"https://api.github.com/users/alexkli/repos","events_url":"https://api.github.com/users/alexkli/events{/privacy}","received_events_url":"https://api.github.com/users/alexkli/received_events","type":"User","site_admin":false},"labels":[{"id":332130641,"url":"https://api.github.com/repos/apache/incubator-openwhisk/labels/cli","name":"cli","color":"006b75","default":false},{"id":328380821,"url":"https://api.github.com/repos/apache/incubator-openwhisk/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"closed","locked":false,"assignee":{"login":"alexkli","id":229022,"avatar_url":"https://avatars0.githubusercontent.com/u/229022?v=4","gravatar_id":"","url":"https://api.github.com/users/alexkli","html_url":"https://github.com/alexkli","followers_url":"https://api.github.com/users/alexkli/followers","following_url":"https://api.github.com/users/alexkli/following{/other_user}","gists_url":"https://api.github.com/users/alexkli/gists{/gist_id}","starred_url":"https://api.github.com/users/alexkli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexkli/subscriptions","organizations_url":"https://api.github.com/users/alexkli/orgs","repos_url":"https://api.github.com/users/alexkli/repos","events_url":"https://api.github.com/users/alexkli/events{/privacy}","received_events_url":"https://api.github.com/users/alexkli/received_events","type":"User","site_admin":false},"assignees":[{"login":"alexkli","id":229022,"avatar_url":"https://avatars0.githubusercontent.com/u/229022?v=4","gravatar_id":"","url":"https://api.github.com/users/alexkli","html_url":"https://github.com/alexkli","followers_url":"https://api.github.com/users/alexkli/followers","following_url":"https://api.github.com/users/alexkli/following{/other_user}","gists_url":"https://api.github.com/users/alexkli/gists{/gist_id}","starred_url":"https://api.github.com/users/alexkli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexkli/subscriptions","organizations_url":"https://api.github.com/users/alexkli/orgs","repos_url":"https://api.github.com/users/alexkli/repos","events_url":"https://api.github.com/users/alexkli/events{/privacy}","received_events_url":"https://api.github.com/users/alexkli/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2017-10-06T01:21:36Z","updated_at":"2017-11-22T00:35:23Z","closed_at":"2017-11-22T00:35:22Z","author_association":"CONTRIBUTOR","body":"It would be useful to support reading a parameter json file from stdin for various piping scenarios, using the convention of \"-\" as filename:\r\n\r\n    cat some.json | envsubst | wsk action invoke my-action -P -\r\n\r\nIn this example we can leverage `envsubst` to replace some environment variables in the file. Without being able to read from stdin, one has to push the content into a temporary file, invoke and then delete the temp file again.\r\n\r\nFrom looking at the go cli code, it seems `readFile()` in [util.go](https://github.com/apache/incubator-openwhisk/blob/26146368f1dd07f817062e662db64c73a8d486d6/tools/cli/go-whisk-cli/commands/util.go#L829) could be adapted to leverage `ioutil.ReadAll(os.Stdin)` in case `filename == \"-\"`. One probably has to check if that is ok for all other `readFile()` usages, or if that should be a special option reserved for `-P --param-file` only."},"comment":{"url":"https://api.github.com/repos/apache/incubator-openwhisk/issues/comments/346206160","html_url":"https://github.com/apache/incubator-openwhisk/issues/2837#issuecomment-346206160","issue_url":"https://api.github.com/repos/apache/incubator-openwhisk/issues/2837","id":346206160,"user":{"login":"csantanapr","id":1094878,"avatar_url":"https://avatars0.githubusercontent.com/u/1094878?v=4","gravatar_id":"","url":"https://api.github.com/users/csantanapr","html_url":"https://github.com/csantanapr","followers_url":"https://api.github.com/users/csantanapr/followers","following_url":"https://api.github.com/users/csantanapr/following{/other_user}","gists_url":"https://api.github.com/users/csantanapr/gists{/gist_id}","starred_url":"https://api.github.com/users/csantanapr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csantanapr/subscriptions","organizations_url":"https://api.github.com/users/csantanapr/orgs","repos_url":"https://api.github.com/users/csantanapr/repos","events_url":"https://api.github.com/users/csantanapr/events{/privacy}","received_events_url":"https://api.github.com/users/csantanapr/received_events","type":"User","site_admin":false},"created_at":"2017-11-22T00:35:23Z","updated_at":"2017-11-22T00:35:23Z","author_association":"MEMBER","body":"Issue moved to [apache/incubator-openwhisk-cli #126](https://github.com/apache/incubator-openwhisk-cli/issues/126) via [**ZenHub**](https://www.zenhub.com/)\n"}}
{"actor":{"display_login":"csantanapr"}}