commit | 8930d753f3c897b577da2993d8b7010f6b4953a0 | [log] [tgz] |
---|---|---|
author | Rodric Rabbah <rabbah@us.ibm.com> | Tue Apr 19 10:30:23 2016 -0400 |
committer | Rodric Rabbah <rabbah@us.ibm.com> | Tue Apr 19 10:31:16 2016 -0400 |
tree | 4a8ecae916ce383ccd1ae3f9c80d54e834787310 | |
parent | 51734f97d819d84d2059e7135e83d86307f7592e [diff] |
Update README for integration test setup. Update README for integration test setup.
JavaScript client library for the OpenWhisk platform. Provides a wrapper around the OpenWhisk APIs.
$ npm install openwhisk
var openwhisk = require('openwhisk'); var ow = openwhisk({api: 'https://openwhisk.ng.bluemix.net/api/v1/', api_key: '...', namespace: 'default_namespace'});
All methods return a Promise resolved asynchronously with the results. Failures are available through the catch method.
ow.resource.operation().then(function () { // success! }).catch(function (err) { // failed! })
ow.actions.list() ow.activations.list() ow.triggers.list() ow.rules.list() ow.namespaces.list() ow.packages.list()
Query parameters for the API calls are supported (e.g. limit, skip, etc.) by passing an object with the named parameters as the first argument.
ow.actions.list({skip: 100, limit: 50})
The following optional parameters are supported:
namespace
- set custom namespace for endpointow.actions.get({actionName: '...'}) ow.activations.get({activation: '...'}) ow.triggers.get({triggerName: '...'}) ow.rules.get({ruleName: '...'}) ow.namespaces.get({namespace: '...'}) ow.packages.get({packageName: '...'})
The following optional parameters are supported:
namespace
- set custom namespace for endpointow.actions.delete({actionName: '...'}) ow.triggers.delete({triggerName: '...'}) ow.rules.delete({ruleName: '...'}) ow.packages.delete({packageName: '...'})
The following optional parameters are supported:
namespace
- set custom namespace for endpointow.actions.invoke({actionName: '...'})
The following optional parameters are supported:
blocking
- delay returning until action has finished executing (default: false
)params
- JSON object containing parameters for the action being invoked (default: {}
)namespace
- set custom namespace for endpointow.actions.create({actionName: '...', action: 'function main() {};'}) ow.actions.update({actionName: '...', action: 'function main() {};'})
The following mandatory parameters are supported:
actionName
- action identifieraction
- String containing JS function source code or JSON object containing full parameters for the action bodyThe following optional parameters are supported:
namespace
- set custom namespace for endpointow.triggers.invoke({triggerName: '...'})
The following optional parameters are supported:
params
- JSON object containing parameters for the trigger being fired (default: {}
)namespace
- set custom namespace for endpointow.triggers.create({triggerName: '...'}) ow.triggers.update({triggerName: '...'})
The following optional parameters are supported:
trigger
- JSON object containing parameters for the trigger body (default: {}
)namespace
- set custom namespace for endpointow.packages.create({packageName: '...'}) ow.packages.update({packageName: '...'})
The following optional parameters are supported:
package
- JSON object containing parameters for the package body (default: {}
)namespace
- set custom namespace for endpointow.rules.create({ruleName: '...', action: '...', trigger: '...'}) ow.rules.update({ruleName: '...', action: '...', trigger: '...'})
The following optional parameters are supported:
namespace
- set custom namespace for endpointow.rules.enable({ruleName: '...'}) ow.rules.disable({ruleName: '...'})
The following optional parameters are supported:
namespace
- set custom namespace for endpoint