This is an automated email from the ASF dual-hosted git repository. jamesthomas pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-client-js.git
The following commit(s) were added to refs/heads/master by this push: new daedefd Update docs to include examples of sequence creation and package binding (#167) daedefd is described below commit daedefd8ceff9d9c2dbc3772cfd794570abaa707 Author: Lars Trieloff <l...@trieloff.net> AuthorDate: Fri May 17 11:59:06 2019 +0200 Update docs to include examples of sequence creation and package binding (#167) * docs(readme): add example for creation of a sequence * docs(readme): provide example for binding a package --- README.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/README.md b/README.md index 1dc69aa..57916cb 100644 --- a/README.md +++ b/README.md @@ -217,6 +217,20 @@ ow.actions.create({name, action}).then(result => { }) ``` +### create sequence from another action + +```javascript +const actionName = '/mynamespace/reverseWords' +const name = 'reverse' + +ow.actions.create({ name, action: { + exec: { + kind: 'sequence', + components: [ actionName ] + } +}}) +``` + ### retrieve action resource ```javascript @@ -264,6 +278,24 @@ ow.packages.update({name, package}).then(package => { }) ``` +### bind a package from another namespace + +```javascript +const name = 'myBoundPackage' +const package = { + binding: { + namespace: "othernamespace", // namespace to bind from + name: "otherpackage" // package to bind from + } +} + +ow.packages.update({name, package}).then(package => { + console.log('bound package:', package.name) +}).catch(err => { + console.error('failed to bind package', err) +}) +``` + ### create trigger feed from alarm package ```javascript