$ npm install @adobe/aio-lib-runtime
- Initialize the SDK
const sdk = require('@adobe/aio-lib-runtime')
async function sdkTest() {
//initialize sdk
const client = await sdk.init({ apihost: 'apihost', api_key: 'api_key'})
}
- Call methods using the initialized SDK
const sdk = require('@adobe/aio-lib-runtime')
async function sdkTest() {
// initialize sdk
const client = await sdk.init({ apihost: 'apihost', api_key: 'api_key'})
// call methods
try {
// get... something
const result = await client.getSomething({})
console.log(result)
} catch (e) {
console.error(e)
}
}
- RuntimeAPI
This class provides methods to call your RuntimeAPI APIs. Before calling any method initialize the instance by calling the
init
method on it with valid options argument- Triggers
- deployActions([config], [deployConfig], eventEmitter, logFunc) ⇒
Promise.<object>
runs the command
- deployWsk(scriptConfig, manifestContent, logFunc, filterEntities)
- init(options) ⇒
Promise.<OpenwhiskClient>
Returns a Promise that resolves with a new RuntimeAPI object.
- printActionLogs(config, logger, limit, filterActions, strip, tail, fetchLogsInterval, startTime)
Prints action logs.
- undeployActions(config, logFunc)
- undeployWsk(packageName, manifestContent, owOptions, logger)
- getIncludesForAction(action) ⇒
Array(IncludeEntry)
Gets the list of files matching the patterns defined by action.include
- printLogs(activation, strip, logger)
Prints activation logs messages.
- printFilteredActionLogs(runtime, logger, limit, filterActions, strip, startTime)
Filters and prints action logs.
- getActionEntryFile(pkgJson) ⇒
string
returns path to main function as defined in package.json OR default of index.js note: file MUST exist, caller's responsibility, this method will throw if it does not exist
- zip(filePath, out, pathInZip) ⇒
Promise
Zip a file/folder using archiver
- createKeyValueObjectFromArray(inputsArray) ⇒
object
returns key value pairs in an object from the key value array supplied. Used to create parameters object.
- createKeyValueArrayFromObject(object) ⇒
Array
returns key value array from the object supplied.
- createKeyValueArrayFromFlag(flag) ⇒
Array
returns key value array from the parameters supplied. Used to create --param and --annotation key value pairs
- createKeyValueArrayFromFile(file) ⇒
Array
returns key value array from the json file supplied. Used to create --param-file and annotation-file key value pairs
- createKeyValueObjectFromFlag(flag) ⇒
object
returns key value pairs in an object from the parameters supplied. Used to create --param and --annotation key value pairs
- parsePackageName(name) ⇒
object
parses a package name string and returns the namespace and entity name for a package
- getKeyValueArrayFromMergedParameters(params, paramFilePath) ⇒
Array
returns key value array from the params and/or param-file supplied with more precendence to params.
- getKeyValueObjectFromMergedParameters(params, paramFilePath) ⇒
object
returns key value object from the params and/or param-file supplied with more precendence to params.
- createKeyValueObjectFromFile(file) ⇒
object
returns key value pairs from the parameters supplied. Used to create --param-file and --annotation-file key value pairs
- createComponentsfromSequence(sequenceAction) ⇒
object
Creates an object representation of a sequence.
- returnUnion(firstObject, secondObject) ⇒
object
Creates a union of two objects
- parsePathPattern(path) ⇒
Array
Parse a path pattern
- processInputs(input, params) ⇒
object
Process inputs
- createKeyValueInput(input) ⇒
object
Create a key-value object from the input
- getDeploymentPath() ⇒
string
Get the deployment yaml file path
- getManifestPath() ⇒
string
Get the manifest yaml file path
- returnDeploymentTriggerInputs(deploymentPackages) ⇒
object
Get the deployment trigger inputs.
- returnAnnotations(action) ⇒
object
Get the annotations for an action
- createApiRoutes(pkg, pkgName, apiName, allowedActions, allowedSequences, pathOnly) ⇒
Array.<OpenWhiskEntitiesRoute>
Creates an array of route definitions from the given manifest-based package. See https://github.com/apache/openwhisk-wskdeploy/blob/master/parsers/manifest_parser.go#L1187
- createSequenceObject(fullName, manifestSequence, packageName) ⇒
OpenWhiskEntitiesAction
Create a sequence object that is compatible with the OpenWhisk API from a parsed manifest object
- checkWebFlags(flag) ⇒
object
Check the web flags
- createActionObject(fullName, manifestAction) ⇒
OpenWhiskEntitiesAction
Create an action object compatible with the OpenWhisk API from an action object parsed from the manifest.
- processPackage(packages, deploymentPackages, deploymentTriggers, params, [namesOnly], [owOptions]) ⇒
OpenWhiskEntities
Process the manifest and deployment content and returns deployment entities.
- setPaths(flags) ⇒
DeploymentFileComponents
Get the deployment file components.
- setupAdobeAuth(actions, owOptions, imsOrgId)
Handle Adobe auth action dependency
This is a temporary solution and needs to be removed when headless apps will be able to validate against app-registry
This function stores the IMS organization id in the Adobe I/O cloud state library which is required by the headless validator.
The IMS org id must be stored beforehand in
@adobe/aio-lib-core-config
under the'project.org.ims_org_id'
key. TODO: pass in imsOrgId- deployPackage(entities, ow, logger, imsOrgId)
Deploy all processed entities: can deploy packages, actions, triggers, rules and apis.
- undeployPackage(entities, ow, logger)
Undeploy all processed entities: can undeploy packages, actions, triggers, rules and apis. Entity definitions do not need to be complete, only the names are needed for un-deployment.
- syncProject(projectName, manifestPath, manifestContent, entities, ow, logger, imsOrgId, deleteEntities)
Sync a project. This is a higher level function that can be used to sync a local manifest with deployed entities.
syncProject
doesn't only deploy entities it might also undeploy entities that are not defined in the manifest. This behavior can be disabled via thedeleteEntities
boolean parameter.- getProjectEntities(project, isProjectHash, ow) ⇒
Promise.<OpenWhiskEntities>
Get deployed entities for a managed project. This methods retrieves all the deployed entities for a given project name or project hash. This only works if the project was deployed using the
whisk-managed
annotation. This annotation can be set pre-deployement using[addManagedProjectAnnotations](#addmanagedprojectannotations)
.Note that returned apis will always be empty as they don't support annotations and hence are not managed as part of a project.
- addManagedProjectAnnotations(entities, manifestPath, projectName, projectHash)
Add the
whisk-managed
annotation to processed entities. This is needed for syncing managed projects.- getProjectHash(manifestContent, manifestPath) ⇒
string
Compute the project hash based on the manifest content and manifest path. This is used for syncing managed projects.
- findProjectHashonServer(ow, projectName) ⇒
Promise.<string>
Retrieve the project hash from a deployed managed project.
- _relApp(root, p)
- _absApp(root, p)
- checkOpenWhiskCredentials(config)
- getActionUrls(config, isRemoteDev, isLocalDev)
- urlJoin(...args) ⇒
string
Joins url path parts
- removeProtocolFromURL(url)
- OpenwhiskOptions :
object
- OpenwhiskClient :
object
- ManifestPackages :
Array.<ManifestPackage>
The entry point to the information read from the manifest, this can be extracted using setPaths.
- ManifestPackage :
object
The manifest package definition
- ManifestAction :
object
The manifest action definition
- ManifestAction :
object
- IncludeEntry :
object
- ManifestSequence :
object
The manifest sequence definition TODO: see https://github.com/apache/openwhisk-wskdeploy/blob/master/specification/html/spec_sequences.md
- ManifestTrigger :
object
The manifest trigger definition TODO: see https://github.com/apache/openwhisk-wskdeploy/blob/master/specification/html/spec_triggers.md
- ManifestRule :
object
The manifest rule definition TODO: see https://github.com/apache/openwhisk-wskdeploy/blob/master/specification/html/spec_rules.md
- ManifestApi :
object
The manifest api definition TODO: see https://github.com/apache/openwhisk-wskdeploy/blob/master/specification/html/spec_apis.md
- ManifestDependency :
object
The manifest dependency definition TODO
- ManifestActionLimits :
object
The manifest action limits definition TODO: see https://github.com/apache/openwhisk-wskdeploy/blob/master/specification/html/https://github.com/apache/openwhisk-wskdeploy/blob/master/specification/html/spec_actions.md#valid-limit-keys.md
- ManifestActionAnnotations :
object
The manifest action annotations definition TODO: see https://github.com/apache/openwhisk-wskdeploy/blob/master/specification/html/spec_actions.md#action-annotations
- OpenWhiskEntities :
object
The OpenWhisk entities definitions, which are compatible with the
openwhisk
node client module. Can be obtained using (processpackage)[#processpackage] (withonlyNames=true
for un-deployment)- OpenWhiskEntitiesRoute :
object
The api entity definition
- OpenWhiskEntitiesAction :
object
The action entity definition TODO
- OpenWhiskEntitiesRule :
object
The rule entity definition TODO
- OpenWhiskEntitiesTrigger :
object
The trigger entity definition TODO
- OpenWhiskEntitiesPackage :
object
The package entity definition TODO
- DeploymentPackages :
Array.<object>
The entry point to the information read from the deployment file, this can be extracted using setPaths. TODO
- DeploymentTrigger :
object
The deployment trigger definition TODO
- DeploymentFileComponents :
object
This class provides methods to call your RuntimeAPI APIs.
Before calling any method initialize the instance by calling the init
method on it
with valid options argument
runtimeAPI.init(options) ⇒ Promise.<OpenwhiskClient>
Initializes a RuntimeAPI object and returns it.
Kind: instance method of RuntimeAPI
Returns: Promise.<OpenwhiskClient>
- a RuntimeAPI object
Param | Type | Description |
---|---|---|
options | OpenwhiskOptions |
options for initialization |
Kind: global class
- Triggers
- new Triggers()
- .create(options) ⇒
Promise.<object>
- .delete(options) ⇒
Promise.<object>
A class to manage triggers
Creates a trigger and associated feeds
Kind: instance method of Triggers
Returns: Promise.<object>
- the result of the create operation
Param | Type | Description |
---|---|---|
options | object |
input options to create the trigger from manifest |
Deletes a trigger and associated feeds
Kind: instance method of Triggers
Returns: Promise.<object>
- the result of the delete operation
Param | Type | Description |
---|---|---|
options | object |
options with the name of the trigger |
runs the command
Kind: global function
Returns: Promise.<object>
- deployedEntities
Param | Type | Default | Description |
---|---|---|---|
[config] | object |
{} |
|
[deployConfig] | object |
{} |
|
[deployConfig.filterEntities] | object |
add filters to deploy only specified OpenWhisk entities | |
[deployConfig.filterEntities.actions] | Array |
filter list of actions to deploy, e.g. ['name1', ..] | |
[deployConfig.filterEntities.sequences] | Array |
filter list of sequences to deploy, e.g. ['name1', ..] | |
[deployConfig.filterEntities.triggers] | Array |
filter list of triggers to deploy, e.g. ['name1', ..] | |
[deployConfig.filterEntities.rules] | Array |
filter list of rules to deploy, e.g. ['name1', ..] | |
[deployConfig.filterEntities.apis] | Array |
filter list of apis to deploy, e.g. ['name1', ..] | |
eventEmitter | |||
logFunc | |||
[deployConfig.filterEntities.dependencies] | Array |
filter list of package dependencies to deploy, e.g. ['name1', ..] |
Kind: global function
Param |
---|
scriptConfig |
manifestContent |
logFunc |
filterEntities |
Kind: inner method of deployWsk
Param |
---|
pkgEntity |
filter |
init(options) ⇒ Promise.<OpenwhiskClient>
Returns a Promise that resolves with a new RuntimeAPI object.
Kind: global function
Returns: Promise.<OpenwhiskClient>
- a Promise with a RuntimeAPI object
Param | Type | Description |
---|---|---|
options | OpenwhiskOptions |
options for initialization |
Prints action logs.
Kind: global function
Param | Type | Default | Description |
---|---|---|---|
config | object |
openwhisk config | |
logger | object |
an instance of a logger to emit messages to | |
limit | number |
maximum number of activations to fetch logs from | |
filterActions | Array |
array of actions to fetch logs from examples:- ['pkg1/'] = logs of all deployed actions under package pkg1 ['pkg1/action'] = logs of action 'action' under package 'pkg1' [] = logs of all actions in the namespace | |
strip | boolean |
if true, strips the timestamp which prefixes every log line | |
tail | boolean |
false |
if true, logs are fetched continuously |
fetchLogsInterval | number |
10000 |
number of seconds to wait before fetching logs again when tail is set to true |
startTime | number |
time in milliseconds. Only logs after this time will be fetched |
Kind: global function
Param |
---|
config |
logFunc |
Kind: global function
Param |
---|
packageName |
manifestContent |
owOptions |
logger |
Gets the list of files matching the patterns defined by action.include
Kind: global function
Param | Type | Description |
---|---|---|
action | ManifestAction |
action object from manifest which defines includes |
Prints activation logs messages.
Kind: global function
Param | Type | Description |
---|---|---|
activation | object |
the activation |
strip | boolean |
if true, strips the timestamp which prefixes every log line |
logger | object |
an instance of a logger to emit messages to |
Filters and prints action logs.
Kind: global function
Param | Type | Default | Description |
---|---|---|---|
runtime | object |
runtime (openwhisk) object | |
logger | object |
an instance of a logger to emit messages to | |
limit | number |
maximum number of activations to fetch logs from | |
filterActions | Array |
array of actions to fetch logs from ['pkg1/'] = logs of all deployed actions under package pkg1 ['pkg1/action'] = logs of action 'action' under package 'pkg1' [] = logs of all actions in the namespace | |
strip | boolean |
false |
if true, strips the timestamp which prefixes every log line |
startTime | number |
0 |
time in milliseconds. Only logs after this time will be fetched |
returns path to main function as defined in package.json OR default of index.js note: file MUST exist, caller's responsibility, this method will throw if it does not exist
Kind: global function
Param | Type | Description |
---|---|---|
pkgJson | * |
: path to a package.json file |
Zip a file/folder using archiver
Kind: global function
Param | Type | Default |
---|---|---|
filePath | string |
|
out | string |
|
pathInZip | boolean |
false |
returns key value pairs in an object from the key value array supplied. Used to create parameters object.
Kind: global function
Returns: object
- An object of key value pairs in this format : {Your key1 : 'Your Value 1' , Your key2: 'Your value 2'}
Param | Type | Description |
---|---|---|
inputsArray | Array |
Array in the form of [{'key':'key1', 'value': 'value1'}] |
returns key value array from the object supplied.
Kind: global function
Returns: Array
- An array of key value pairs in this format : [{key : 'Your key 1' , value: 'Your value 1'}, {key : 'Your key 2' , value: 'Your value 2'} ]
Param | Type | Description |
---|---|---|
object | object |
JSON object |
returns key value array from the parameters supplied. Used to create --param and --annotation key value pairs
Kind: global function
Returns: Array
- An array of key value pairs in this format : [{key : 'Your key 1' , value: 'Your value 1'}, {key : 'Your key 2' , value: 'Your value 2'} ]
Param | Type | Description |
---|---|---|
flag | Array |
value from flags.param or flags.annotation |
returns key value array from the json file supplied. Used to create --param-file and annotation-file key value pairs
Kind: global function
Returns: Array
- An array of key value pairs in this format : [{key : 'Your key 1' , value: 'Your value 1'}, {key : 'Your key 2' , value: 'Your value 2'} ]
Param | Type | Description |
---|---|---|
file | string |
from flags['param-file'] or flags['annotation-file] |
returns key value pairs in an object from the parameters supplied. Used to create --param and --annotation key value pairs
Kind: global function
Returns: object
- An object of key value pairs in this format : {Your key1 : 'Your Value 1' , Your key2: 'Your value 2'}
Param | Type | Description |
---|---|---|
flag | Array |
from flags.param or flags.annotation |
parses a package name string and returns the namespace and entity name for a package
Kind: global function
Returns: object
- An object { namespace: string, name: string }
Param | Type | Description |
---|---|---|
name | string |
package name |
returns key value array from the params and/or param-file supplied with more precendence to params.
Kind: global function
Returns: Array
- An array of key value pairs in this format : [{key : 'Your key 1' , value: 'Your value 1'}, {key : 'Your key 2' , value: 'Your value 2'} ]
Param | Type | Description |
---|---|---|
params | Array |
from flags.param or flags.annotation |
paramFilePath | string |
from flags['param-file'] or flags['annotation-file'] |
returns key value object from the params and/or param-file supplied with more precendence to params.
Kind: global function
Returns: object
- An object of key value pairs in this format : {Your key1 : 'Your Value 1' , Your key2: 'Your value 2'}
Param | Type | Description |
---|---|---|
params | Array |
from flags.param or flags.annotation |
paramFilePath | string |
from flags['param-file'] or flags['annotation-file'] |
returns key value pairs from the parameters supplied. Used to create --param-file and --annotation-file key value pairs
Kind: global function
Returns: object
- An object of key value pairs in this format : {Your key1 : 'Your Value 1' , Your key2: 'Your value 2'}
Param | Type | Description |
---|---|---|
file | string |
from flags['param-file'] or flags['annotation-file'] |
Creates an object representation of a sequence.
Kind: global function
Returns: object
- the object representation of the sequence
Param | Type | Description |
---|---|---|
sequenceAction | Array |
the sequence action array |
Creates a union of two objects
Kind: global function
Returns: object
- the union of both objects
Param | Type | Description |
---|---|---|
firstObject | object |
the object to merge into |
secondObject | object |
the object to merge from |
Parse a path pattern
Kind: global function
Returns: Array
- array of matches
Param | Type | Description |
---|---|---|
path | string |
the path to parse |
Process inputs
Kind: global function
Returns: object
- the processed inputs
Param | Type | Description |
---|---|---|
input | object |
the input object to process |
params | object |
the parameters for the input to process |
Create a key-value object from the input
Kind: global function
Returns: object
- the processed input as a key-value object
Param | Type | Description |
---|---|---|
input | object |
the input to process |
Get the deployment yaml file path
Kind: global function
Returns: string
- the deployment yaml path
Get the manifest yaml file path
Kind: global function
Returns: string
- the manifest yaml path
Get the deployment trigger inputs.
Kind: global function
Returns: object
- the deployment trigger inputs
Param | Type | Description |
---|---|---|
deploymentPackages | DeploymentPackages |
the deployment packages |
Get the annotations for an action
Kind: global function
Returns: object
- the action annotation entities
Param | Type | Description |
---|---|---|
action | ManifestAction |
the action manifest object |
createApiRoutes(pkg, pkgName, apiName, allowedActions, allowedSequences, pathOnly) ⇒ Array.<OpenWhiskEntitiesRoute>
Creates an array of route definitions from the given manifest-based package. See https://github.com/apache/openwhisk-wskdeploy/blob/master/parsers/manifest_parser.go#L1187
Kind: global function
Returns: Array.<OpenWhiskEntitiesRoute>
- the array of route entities
Param | Type | Description |
---|---|---|
pkg | ManifestPackage |
The package definition from the manifest. |
pkgName | string |
The name of the package. |
apiName | string |
The name of the HTTP API definition from the manifest. |
allowedActions | Array |
List of action names allowed to be used in routes. |
allowedSequences | Array |
List of sequence names allowed to be used in routes. |
pathOnly | boolean |
Skip action, method and response type in route definitions. |
createSequenceObject(fullName, manifestSequence, packageName) ⇒ OpenWhiskEntitiesAction
Create a sequence object that is compatible with the OpenWhisk API from a parsed manifest object
Kind: global function
Returns: OpenWhiskEntitiesAction
- a sequence object describing the action entity
Param | Type | Description |
---|---|---|
fullName | string |
the full sequence name prefixed with the package, e.g. pkg/sequence |
manifestSequence | ManifestSequence |
a sequence object as defined in a valid manifest file |
packageName | string |
the package name of the sequence, which will be set to for actions in the sequence |
Check the web flags
Kind: global function
Returns: object
- object with the appropriate web flags for an action
Param | Type | Description |
---|---|---|
flag | string | boolean |
the flag to check |
createActionObject(fullName, manifestAction) ⇒ OpenWhiskEntitiesAction
Create an action object compatible with the OpenWhisk API from an action object parsed from the manifest.
Kind: global function
Returns: OpenWhiskEntitiesAction
- the action entity object
Param | Type | Description |
---|---|---|
fullName | string |
the full action name prefixed with the package, e.g. pkg/action |
manifestAction | ManifestAction |
the action object as parsed from the manifest |
processPackage(packages, deploymentPackages, deploymentTriggers, params, [namesOnly], [owOptions]) ⇒ OpenWhiskEntities
Process the manifest and deployment content and returns deployment entities.
Kind: global function
Returns: OpenWhiskEntities
- deployment entities
Param | Type | Default | Description |
---|---|---|---|
packages | ManifestPackages |
the manifest packages | |
deploymentPackages | DeploymentPackages |
the deployment packages | |
deploymentTriggers | DeploymentTrigger |
the deployment triggers | |
params | object |
the package params | |
[namesOnly] | boolean |
false |
if false, set the namespaces as well |
[owOptions] | object |
{} |
additional OpenWhisk options |
setPaths(flags) ⇒ DeploymentFileComponents
Get the deployment file components.
Kind: global function
Returns: DeploymentFileComponents
- fileComponents
Param | Type | Description |
---|---|---|
flags | object |
(manifest + deployment) |
Handle Adobe auth action dependency
This is a temporary solution and needs to be removed when headless apps will be able to validate against app-registry
This function stores the IMS organization id in the Adobe I/O cloud state library which is required by the headless validator.
The IMS org id must be stored beforehand in @adobe/aio-lib-core-config
under the
'project.org.ims_org_id'
key. TODO: pass in imsOrgId
Kind: global function
Param | Type | Description |
---|---|---|
actions | Array.<OpenWhiskEntitiesAction> |
the array of action deployment entities |
owOptions | object |
OpenWhisk options |
imsOrgId | string |
the IMS Org Id |
Deploy all processed entities: can deploy packages, actions, triggers, rules and apis.
Kind: global function
Param | Type | Description |
---|---|---|
entities | OpenWhiskEntitiesAction |
the processed entities |
ow | object |
the OpenWhisk client |
logger | object |
the logger |
imsOrgId | string |
the IMS Org ID |
Undeploy all processed entities: can undeploy packages, actions, triggers, rules and apis. Entity definitions do not need to be complete, only the names are needed for un-deployment.
Kind: global function
Param | Type | Description |
---|---|---|
entities | object |
the processed entities, only names are enough for undeploy |
ow | object |
the OpenWhisk object |
logger | object |
the logger |
syncProject(projectName, manifestPath, manifestContent, entities, ow, logger, imsOrgId, deleteEntities)
Sync a project. This is a higher level function that can be used to sync a local manifest with deployed entities.
syncProject
doesn't only deploy entities it might also undeploy entities that are not
defined in the manifest. This behavior can be disabled via the deleteEntities
boolean
parameter.
Kind: global function
Param | Type | Default | Description |
---|---|---|---|
projectName | string |
the project name | |
manifestPath | string |
the manifest path | |
manifestContent | string |
the manifest content, needed to compute hash | |
entities | OpenWhiskEntities |
the entities, extracted via processPackage |
|
ow | object |
the OpenWhisk object | |
logger | object |
the logger | |
imsOrgId | string |
the IMS Org ID | |
deleteEntities | boolean |
true |
set to true to delete entities |
getProjectEntities(project, isProjectHash, ow) ⇒ Promise.<OpenWhiskEntities>
Get deployed entities for a managed project. This methods retrieves all the deployed
entities for a given project name or project hash. This only works if the project was
deployed using the whisk-managed
annotation. This annotation can be set
pre-deployement using [addManagedProjectAnnotations](#addmanagedprojectannotations)
.
Note that returned apis will always be empty as they don't support annotations and hence are not managed as part of a project.
Kind: global function
Returns: Promise.<OpenWhiskEntities>
- the deployed project entities
Param | Type | Description |
---|---|---|
project | string |
the project name or hash |
isProjectHash | boolean |
set to true if the project is a hash, and not the name |
ow | object |
the OpenWhisk client object |
Add the whisk-managed
annotation to processed entities. This is needed for syncing
managed projects.
Kind: global function
Param | Type | Description |
---|---|---|
entities | OpenWhiskEntities |
the processed entities |
manifestPath | string |
the manifest path |
projectName | string |
the project name |
projectHash | string |
the project hash |
Compute the project hash based on the manifest content and manifest path. This is used for syncing managed projects.
Kind: global function
Returns: string
- the project hash
Param | Type | Description |
---|---|---|
manifestContent | string |
the manifest content |
manifestPath | string |
the manifest path |
Retrieve the project hash from a deployed managed project.
Kind: global function
Returns: Promise.<string>
- the project hash, or '' if not found
Param | Type | Description |
---|---|---|
ow | object |
the OpenWhisk client object |
projectName | string |
the project name |
Kind: global function
Param |
---|
root |
p |
Kind: global function
Param |
---|
root |
p |
Kind: global function
Param |
---|
config |
Kind: global function
Param | Default |
---|---|
config | |
isRemoteDev | false |
isLocalDev | false |
Joins url path parts
Kind: global function
Param | Type | Description |
---|---|---|
...args | string |
url parts |
Kind: global function
Param |
---|
url |
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
apihost | string |
Hostname and optional port for openwhisk platform |
api_key | string |
Authorisation key |
[api] | string |
Full API URL |
[apiversion] | string |
Api version |
[namespace] | string |
Namespace for resource requests |
[ignore_certs] | boolean |
Turns off server SSL/TLS certificate verification |
[key] | string |
Client key to use when connecting to the apihost |
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
actions | ow.Actions |
actions |
activations | ow.Activations |
activations |
namespaces | ow.Namespaces |
namespaces |
packages | ow.Packages |
packages |
rules | ow.Rules |
rules |
triggers | ow.Triggers |
triggers |
routes | ow.Routes |
routes |
ManifestPackages : Array.<ManifestPackage>
The entry point to the information read from the manifest, this can be extracted using setPaths.
The manifest package definition
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
version | string |
the manifest package version |
[license] | string |
the manifest package license, e.g. Apache-2.0 |
[actions] | Array.<ManifestAction> |
Actions in the manifest package |
[sequences] | Array.<ManifestSequence> |
Sequences in the manifest package |
[triggers] | Array.<ManifestTrigger> |
Triggers in the manifest package |
[rules] | Array.<ManifestRule> |
Rules in the manifest package |
[dependencies] | Array.<ManifestDependency> |
Dependencies in the manifest package |
[apis] | Array.<ManifestApi> |
Apis in the manifest package |
The manifest action definition
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
[version] | string |
the manifest action version |
function | string |
the path to the action code |
runtime | string |
the runtime environment or kind in which the action executes, e.g. 'nodejs:12' |
[main] | string |
the entry point to the function |
[inputs] | object |
the list of action default parameters |
[limits] | ManifestActionLimits |
limits for the action |
[web] | string |
indicate if an action should be exported as web, can take the value of: true |
[web-export] | string |
same as web |
[raw-http] | boolean |
indicate if an action should be exported as raw web action, this option is only valid if web or web-export is set to true |
[docker] | string |
the docker container to run the action into |
[annotations] | ManifestActionAnnotations |
the manifest action annotations |
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
include | Array |
array of include glob patterns |
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
dest | string |
destination for included files |
sources | Array |
list of files that matched pattern |
The manifest sequence definition TODO: see https://github.com/apache/openwhisk-wskdeploy/blob/master/specification/html/spec_sequences.md
The manifest trigger definition TODO: see https://github.com/apache/openwhisk-wskdeploy/blob/master/specification/html/spec_triggers.md
The manifest rule definition TODO: see https://github.com/apache/openwhisk-wskdeploy/blob/master/specification/html/spec_rules.md
The manifest api definition TODO: see https://github.com/apache/openwhisk-wskdeploy/blob/master/specification/html/spec_apis.md
The manifest dependency definition TODO
The manifest action limits definition TODO: see https://github.com/apache/openwhisk-wskdeploy/blob/master/specification/html/https://github.com/apache/openwhisk-wskdeploy/blob/master/specification/html/spec_actions.md#valid-limit-keys.md
The manifest action annotations definition TODO: see https://github.com/apache/openwhisk-wskdeploy/blob/master/specification/html/spec_actions.md#action-annotations
The OpenWhisk entities definitions, which are compatible with the openwhisk
node
client module. Can be obtained using (processpackage)[#processpackage] (with onlyNames=true
for un-deployment)
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
apis | Array.<OpenWhiskEntitiesRoute> |
the array of route entities |
actions | Array.<OpenWhiskEntitiesAction> |
the array of action entities |
triggers | Array.<OpenWhiskEntitiesTrigger> |
the array of trigger entities |
rules | Array.<OpenWhiskEntitiesRule> |
the array of rule entities |
pkgAndDeps | Array.<OpenWhiskEntitiesPackage> |
the array of package entities |
The api entity definition
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
name | string |
the api name |
basepath | string |
the api basepath |
relpath | string |
the api relpath |
action | string |
the action name behind the api |
responsettype | string |
the response type, e.g. 'json' |
operation | string |
the http method, e.g 'get' |
The action entity definition TODO
The rule entity definition TODO
The trigger entity definition TODO
The package entity definition TODO
The entry point to the information read from the deployment file, this can be extracted using setPaths. TODO
The deployment trigger definition TODO
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
packages | ManifestPackages |
Packages in the manifest |
deploymentTriggers | Array.<DeploymentTrigger> |
Triggers in the deployment manifest |
deploymentPackages | DeploymentPackages |
Packages in the deployment manifest |
manifestPath | string |
Path to manifest |
manifestContent | object |
Parsed manifest object |
projectName | string |
Name of the project |
LOG_LEVEL=debug <your_call_here>
Prepend the LOG_LEVEL
environment variable and debug
value to the call that invokes your function, on the command line. This should output a lot of debug data for your SDK calls.
Contributions are welcome! Read the Contributing Guide for more information.
This project is licensed under the Apache V2 License. See LICENSE for more information.