This module is part of the Apache OpenWhisk project.
This project allows developers to define actions, packages, rules and triggers from annotations on java classes.
The following softwares are required to use this project:
- Maven v3.3.x or above
- Java 8 or above
- OpenWhisk CLI
- openwhisk-update-maven-plugin
All of the annotations are added at the class level. You can define more than one annotation per class.
The @Action annotation defines an OpenWhisk action:
@Action(name = "simple-function", packageName = "test", parameters = { @Parameter(key = "Name", value = "Bob") })
public class FunctionApp {
The @ActionSequence annotation defines an OpenWhisk action sequence:
@Action(name = "simple-function", packageName = "test", parameters = { @Parameter(key = "Name", value = "Bob") })
public class FunctionApp {
The @Package annotation defines an OpenWhisk package:
@Package(name = "test")
public class FunctionApp {
Our recommendation would be to add this to a package-info.java class for the package containing the actions / code for a particular package.
The @Rule annotation defines an OpenWhisk rule:
@Rule(actionName="test/simple-function", name = "dostuffrule", triggerName="dostuff")
public class FunctionApp {
The @Trigger annotation defines an OpenWhisk trigger:
@Trigger(feed = "/whisk.system/alarms/alarm", name = "dostuff", parameters = { @Parameter(key = "cron", value = "5 * * * *")})
public class FunctionApp {