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

Support package bind API #20

Open
jthomas opened this issue Jan 20, 2017 · 7 comments
Open

Support package bind API #20

jthomas opened this issue Jan 20, 2017 · 7 comments

Comments

@jthomas
Copy link
Member

jthomas commented Jan 20, 2017

No description provided.

@starpit
Copy link
Contributor

starpit commented Jan 20, 2017

here is an example request handshake:

% wsk -v package bind /whisk.system/slack myslack -p foo bar
REQUEST:
[PUT]    https://openwhisk.ng.bluemix.net/api/v1/namespaces/_/packages/myslack?overwrite=false
Req Headers
{
  "Authorization": [
    "Basic xxxx"
  ],
  "Content-Type": [
    "application/json"
  ]
}Req Body
{{"parameters":[{"key":"foo","value":"bar"}],"binding":{"namespace":"whisk.system","name":"slack"}}
}

@rabbah
Copy link
Member

rabbah commented Jan 22, 2017

i want it too 👍
tag me when it's closed i'll bump the version in openwhisk (or send a pr our way).

@jthomas
Copy link
Member Author

jthomas commented Jan 23, 2017

I've discovered this feature is already supported.

const options = {
  packageName: 'slack', 
  package: {
    parameters: [{key: "foo", value: "bar"}],
    binding: {namespace: "whisk.system", name : "slack"} 
  }
}

ow.packages.create(options).then(...)

Does that work for you @starpit? cc @rabbah

@rabbah
Copy link
Member

rabbah commented Jan 23, 2017

Great thanks. Note that to create an action from an option object one has to specify the name of the action also which is asymmetric. I can file a defect/give an example.

@jthomas
Copy link
Member Author

jthomas commented Jan 23, 2017

Can you provide an example here and I'll look at it for you?

@rabbah
Copy link
Member

rabbah commented Jan 23, 2017

                let actionName = 'seq'
                let sequence = {
                    namespace: process.env['__OW_NAMESPACE'],
                    name: actionName,
                    exec: {
                        kind: 'sequence',
                        components: [ ]}
                }

                return wsk.actions.update({actionName: actionName, action: sequence})

without actionName: actionName, in the update call above will thrown an Error (actionName required).

@starpit
Copy link
Contributor

starpit commented Jan 23, 2017

awesome @jthomas confirmed

AnthonyAmanse pushed a commit to AnthonyAmanse/incubator-openwhisk-client-js that referenced this issue Mar 27, 2019
Add travis CI support as minimum gate.
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

3 participants