Hop REST Web Application
Description
The Hop REST web application is deployed as a WAR file hop-rest-<version>.war. You can put this archive in the webapps folder of your favorite server (e.g. Apache Tomcat). We suggest that you rename it to hop.war or that you unzip it in a hop folder.
The base URL
When deployed under a webapps/hop folder you will get the services, detailed below, under the base URL of /hop/api/v1/.
Error responses
Every service reports failures as an HTTP 500 with a text/plain body containing the error message followed by a simple stack trace, for example:
Unable to find service with name 'test' org.apache.hop.core.exception.HopException : Unable to find service with name 'test' at org.apache.hop.rest.v1.resources.ExecutionResource.executeSynchronously(ExecutionResource.java:76)
Configuration
When the web application starts it will look for an environment variable called HOP_REST_CONFIG_FOLDER to determine where it will look for a file called hop-rest.properties. This file can contain the following properties to determine the configuration of the application:
| Property | Description |
|---|---|
| The logging level to use, one of |
| The metadata to use for the web application in the form of a single JSON 'export' file. Use the GUI tools menu or |
| In case the |
| In case the |
Metadata services
The metadata services are deployed under sub-path metadata/.
List the metadata type keys
Type |
|
Path |
|
Produces |
|
Example call |
|
Example output |
|
List the metadata elements for a key
Type |
|
Path |
|
Arguments |
|
Produces |
|
Example call |
|
Example output |
|
Get a metadata element
Type |
|
Path |
|
Arguments |
|
Produces |
|
Example call |
|
Example output |
|
Save a metadata element
Type |
|
Path |
|
Arguments |
|
Consumes |
|
Produces |
|
Example call |
|
Example output | The name of the element that was saved:
|
Delete a metadata element
Type |
|
Path |
|
Arguments |
|
Produces |
|
Example call |
|
Output |
|
Plugins services
The plugins services are deployed under sub-path plugins/.
List all the plugin type classes
Type |
|
Path |
|
Produces |
|
Example call |
|
Example output |
|
List all the plugins for a given type class
Type |
|
Path |
|
Arguments |
|
Produces |
|
Example call |
This call retrieves all the information about all the pipeline engine plugins. |
Example output |
|
Execution services
The 'Execution' services are deployed under sub-path execute/.
Execute a pipeline synchronously
Type |
|
Path |
|
Consumes |
|
Produces | The content type configured on the Web Service metadata element, |
Example call |
|
Example output | The response body is the concatenation of the values of the output field, for every row written by the transform configured in the Web Service metadata element. A pipeline writing a single JSON document in that field produces output like this:
|
The body to post can contain the following options (see also: the example above)
-
service: the name of the Web Service metadata element to use -
runConfig: the name of the pipeline run configuration to use -
variables: a map with variables (or parameters) with their names and values -
bodyContent: this will be set as a variable using the body content variable option in the Web Service metadata.
only synchronous Web Service elements can be executed here. The Asynchronous Web Service endpoints hop/asyncRun and hop/asyncStatus are served by Hop Server, not by this application. |
Execution Information Location services
The execution information location services are deployed under sub-path location/.
Register an execution
Type |
|
Path |
|
Arguments |
|
Consumes |
|
Produces |
|
Example call |
|
Example output |
|
The body to post is a serialized Execution object, the same structure that is returned by Get execution.
Get execution IDs
Type |
|
Path |
|
Arguments |
|
Consumes |
|
Produces |
|
Example call |
|
Example output | The list of execution IDs looks like this:
|
The body to post can contain the following options (see also: the example above)
-
includeChildren: Set this to true if you want to see child executions of workflows and pipelines -
limit: the maximum number of IDs to retrieve or a value ⇐0 to get all IDs
Get execution
Type |
|
Path |
|
Arguments |
|
Produces |
|
Example call |
|
Example output | The execution details look like this:
|
Get execution state
Type |
|
Path |
|
Arguments |
|
Produces |
|
Example call |
|
Example output | The execution state looks like this:
|