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

Is it possible to override cloudant actions with default params? #111

Open
tleyden opened this issue Jul 6, 2017 · 2 comments
Open

Is it possible to override cloudant actions with default params? #111

tleyden opened this issue Jul 6, 2017 · 2 comments

Comments

@tleyden
Copy link

tleyden commented Jul 6, 2017

I'm planning to invoke a cloudant/write action as the second action in a two action sequence, and I want to specify the -p overwrite 'true' parameter, but I don't want to modify the first action in the action sequence to add the -p overwrite 'true' parameter to it's output for reasons of loose coupling.

The only way I can see to do that is during the binding phase:

wsk package bind /whisk.system/cloudant myCloudant -p overwrite 'true' -p username MYUSERNAME -p password MYPASSWORD -p host MYCLOUDANTACCOUNT.cloudant.com

which means that all actions in the myCloudant bound package will have always have -p overwrite 'true' set, which isn't what I necessarily want. As a workaround I was thinking of creating two bindings:

  • myCloudant
  • myCloudantOverwrite

and calling myCloudantOverwrite/write when I needed to write with the overwrite parameter set to true.

Or is there a better way to customize the behavior of cloudant/write via default parameters? Is it possible to create a new action based on an existing action, and customize the default parameters?

@tleyden
Copy link
Author

tleyden commented Jul 6, 2017

As a workaround I was thinking of creating two bindings

This worked .. but still wondering if there's a cleaner way

@rabbah
Copy link
Member

rabbah commented Jul 6, 2017

See #112 - this is the current suggested workaround.

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

No branches or pull requests

2 participants