Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide ability to pass parameters as a JSON object on the command line #1513

Closed
l2fprod opened this issue Nov 16, 2016 · 4 comments
Closed
Labels

Comments

@l2fprod
Copy link
Contributor

l2fprod commented Nov 16, 2016

Just like I can pass the JSON body of a request on the command line with cURL, I'd like to be able to pass the parameters the same way with the OpenWhisk CLI

curl -H "Content-Type: application/json" -X POST -d '{"username":"xyz","password":"xyz"}' http://localhost:3000/api/login

as example:

wsk action invoke --body '{"key1": "value1", "object1": { "object1Prop": "anotherValue" }}'
@mbehrendt mbehrendt added the cli label Nov 16, 2016
@mbehrendt
Copy link

mbehrendt commented Nov 16, 2016

good point.

should we even allow piping it in, sth like echo <json> | wsk action invoke myAction ?

@dubee
Copy link
Member

dubee commented Nov 16, 2016

You can put the JSON in a file, and pass that filename to the -P flag.

@l2fprod
Copy link
Contributor Author

l2fprod commented Nov 16, 2016

true but here I don't want to have to create a temp file.

@csantanapr
Copy link
Member

Issue moved to apache/incubator-openwhisk-cli #147 via ZenHub

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants