This document formally describe the project configuration format.
Project configurations are written in YAML, with some restrictions:
- indentation must be exactly 2 whitespace characters. No tabs are allowed.
This document uses Markdown Syntax for Object Notation to describe the JSON schema constraining project description.
A project is an object
representing a collection of OpenWhisk entities (actions, packages, rules, triggers and apis)
and related resources. It also contains metadata, such as name
and version
.
-
name
(string, optional) : the name associated to the entities described in the deployment. When set, do not change this without proper review as commands likeundeploy
may not work as expected.When specified, deployed entities are fully managed.
Unmanaged entities are entities deployed using a tool other than
fsh
, such aswsk
.Partially managed entities are entities described in deployment files and deployed using
fsh
.Compare to partially managed entities, fully managed deployments provide these additional guarantees:
- during deployment:
- entities removed from deployment files are also undeployed
- external (not managed by this deployment) entities are not overwritten. (Conflict detection)
- during undeployment:
- all entities are undeployed, independently of changes in deployment files.
Internally, a fully managed entity contains the annotation called
managed
. - during deployment:
-
basePath
(string, optional): the relative or absolute base path used to resolve relative location. -
version
(string, optional): project version following semver format. -
dependencies
(array, optional): includes external project configurations -
resources
(object, optional): related resources -
packages
(object, optional) -
actions
(object, optional) -
triggers
(object, optional) -
rules
(object, optional) -
apis
(object, optional) -
environments
(object, optional): project environments
name: example
version: 0.1.0
basePath: .
dependencies: # includes other project configuration
actions: # actions in the default package
packages: # actions in packages and package bindings
triggers:
rules:
apis:
An array of dependency
objects.
An object
representing an external project configuration.
Limitation: nested dependencies
are currently not supported.
-
location
(string, required): the URL to the dependent project configuration file.Supported format:
- git:
git+<protocol>://[<user>[:<password>]@]<hostname>[:<port>][:][/]<path>#<commit-ish>
, whereprotocol
is one ofssh
,http
,https
, orfile
. See here for support commit-ish formats. - file:
./<path>
or/<path>
- git:
dependencies:
- location: git+https://github.com/lionelvillard/openwhisk-deploy.git/project.yaml#master
An object of resource
objects
- resource-name (
resource
): define a resource.
An object
representing the resource characteristics.
- name (string, optional): the name of the resource. If not specified, use the associated resource-name key.
- type (string, required): the resource type.
- managed: (boolean, required): whether this resource is managed. A managed resource can be created, updated and deleted. Unmanaged resources are read-only; An error occurs when they do not already exist.
- argument-name (any): resource-specific arguments. See resource type documentation below.
The supported types are:
An object
representing a list of packages. Package name must be unique among the set of package names within a namespace
- package-name (
binding
resourceBinding
|packageContent
|interpolation
)
An object
representing a package binding
bind
(string, required): the name of the package to bindinputs
(parameters
, optional): binding parametersannotations
(annotations
, optional)publish
(boolean, optional, default: false): indicate whether the package is public or private
packages:
utils-binding:
bind: /whisk.system/utils
An object
representing a resource binding
resource
(string, required): the name of aresource
resources:
cloudant:
...
packages:
cloudant-binding:
resource: cloudant
An object
representing the content of a package.
actions
(object, optional): a list of actionsinputs
(parameters
, optional): package parametersannotations
(annotations
, optional)publish
(boolean, optional, default: false): indicate whether the package is public or private
An object
representing a list of action
s.
Actions can be specified in any order, e.g. actions composing sequences can be specified after sequences. An error is raised when a cyclic dependency is detected.
-
action-name (
action
|sequence
|copy
|inline
, optional)where action-name must be unqualified and must be unique among the list of action names.
An object
representing an action. Extends baseAction
-
location
(string, required): the action code location. Either a folder or a file.Relative paths are resolved by using the in-scope
basePath
value. -
kind
(enum, optional): the action kind. Determined automatically (see below)Actual kind Specified Kind Default When nodejs:6 nodejs
nodejs:6
nodejs:defaultfile extension is .js
file name ispackage.json
folder containspackage.json
python:2 python
python:2file extension is .py
python:3 python:3 java java file extension is .jar
php:7.1 php
php:7.1file extension is .php
swift:3.1.1 swift
swift:3.1.1file extension is .swift
swift:3 swift
swift:3docker blackbox file is Dockefile
folder containsDockerfile
action hasimage
property -
main
(string, optional): the action entry point. Only valid for Java (no default), PHP (default ismain
) and Python (default ismain
). -
image
(string, optional): a docker image.
-
package: zip builder.
-
web: syntactic sugar for configurating Web actions.
-
combinator: syntactic sugar for the combinator package.
packages:
utils:
actions:
cat:
location: cat.js
kind: nodejs
mysequence:
sequence: /whisk.system/utils/echo, /whisk.system/utils/cat
actions:
docker-action:
image: openwhisk/dockerskeleton
An object
representing an action to copy.
Extends baseAction
-
copy
(string, optional): the name of the action to copy. Subject to naming resolutionCopy
parameters
,annotations
,limits
and the action executable content. Can be overridden or extended withinputs
,annotations
,limits
The action to copy can either be locally defined (in the same manifest) or already deployed.
packages:
utils:
actions:
mycat: # Copy deployed 'cat' action
copy: /whisk.system/utils/cat
inputs:
lines: Hello Gentle World
mycat2: # Copy locally defined 'mycat' action
copy: mycat
An object
representing an action with inlined code.
Extends baseAction
code
(string, required): the action textual code.kind
(baseAction
enum, required): the required action kind
packages:
utils:
actions:
myecho:
kind: nodejs
code: |
function main(params) {
console.log(params);
return params || {};
}
An object
representing a sequence action. Extends baseAction
-
sequence
(string, required): a comma-separated list of action names.Non-fully qualified action names are resolved as described here
packages:
utils:
actions:
mysequence:
sequence: /whisk.system/utils/echo, /whisk.system/utils/cat
A common set of action properties.
-
limits
(limits
, optional): the action limits -
inputs
(parameters
, optional): action parameters -
annotations
(annotations
, optional)Builtin annotations:
web-export
(true|false): enable/disable web actionraw-http
(true|false): enable/disable raw HTTP handling
-
builder
(builder
, optional): the action builder.
An object
representing a list of trigger
s.
An object
representing a trigger.
inputs
(parameters
, optional): trigger parametersannotations
(annotations
, optional)publish
(boolean, optional, default: false): indicate whether the package is public or private
An object
representing a feed.
feed
(string, required): a feed nameinputs
(parameters
, optional): feed parametersannotations
(annotations
, optional)publish
(boolean, optional, default: false): indicate whether the package is public or private
triggers:
# Trigger named "image-uploaded"
# Creating trigger to fire events when data is inserted
image-uploaded:
feed: openwhisk-cloudant/changes
inputs:
dbname: ${vars.CLOUDANT_DATABASE}
An object
representing a list of rule
s.
- rule-name (
object
,rule
, optional)
An object
representing a rule.
- trigger (string, required): the trigger name. Resolved as described here
- action (string, required): the action name. Resolved as described here
- status (enum
active
|inactive
, optional): whether the rule isactive
orinactive
. Default isactive
rules:
# Rule named "echo-images"
# Creating rule that maps database change trigger to sequence
echo-images:
trigger: image-uploaded
action: write-from-cloudant-sequence
An object
representing a list of api
s.
- apiname (
object
,api
, optional):
An object
representing an api. The format loosely follows the OpenAPI format.
- basePath (string, required): the API base path. LIMITATION: currently it must be the same as the api name
- paths (
apiPaths
, optional): the list of relative paths
Plugin extensions:
swagger
: describes routes in Swagger.
apis:
/hello:
basePath: /hello
paths:
/world:
get: hello
An object
representing a list of relative api path
s.
- relpath (object,
apiPath
, optional):
An object
representing a path.
get
(string, optional): the action name of the GET operationput
(string, optional): the action name of the PUT operationpost
(string, optional): the action name of the POST operationdelete
(string, optional): the action name of the DELETE operationoptions
(string, optional): the action name of the OPTIONS operationhead
(string, optional): the action name of the HEAD operationpatch
(string, optional): the action name of the PATCH operation
An object
representing a list of parameters
- key (string |
interpolation
, optional)
Action parameters:
packages:
utils:
actions:
cat:
location: cat.js
inputs:
mykey: myvalue
An object
representing a list of annotations.
{key}
(string |interpolation
, optional)
An object
representing action limits
memory
(integer, optional, default: 256): the maximum memory limit in MB for the actionlogsize
(integer, optional, default:10): the maximum log size limit in MB for the actiontimeout
(integer, optional, default:60000): the timeout limit in milliseconds after which the action is terminated
plugin
(string, required): the name of the plugin
An object
representing the action builder.
Extensible: see builder
contribution point.
name
(string, required): the name of the builder plugin.- paramname (any): the plugin input parameters
actions:
zipaction:
builder:
name: package
excludes:
- *.ts
A string
of the form ${ expr }
where expr
is interpreted as a Javascript expression returning a JSON value. This expression is evaluated in a sandbox initialized to this object:
vars
: anobject
containing resolved variable values in addition to built-in variables.
The built-in variables are:
envname
: name of the current environment
An object
representing a list of environment
s.
- name (object,
environment
, optional): the named environment. Useenvname
in interpolations to get the current environment name.
An object
representing a set of policies attached to the environment.
writable
(boolean, optional): dictate which deployment mode to use when deploying projects.
Non-fully qualified entity names are resolved as follows:
- partially qualified names (
packageName/actionName
) are resolved using the enclosing namespace - unqualified names (
actionName
) are resolved using the enclosing package name (if any) and namespace.