...
Pipelines and Commands are Functions as a Service (FaaS). Their main purpose is to create and maintain data integrations between different systems and implement business logic in a fairly flexible and easy way.
Licenses |
| ||||||||||||||||||
Since |
|
Table of Contents |
---|
Overview
...
Introduction
The main purpose of Pipelines and Commands is to create and maintain data integrations between different systems and to implement business logic in a fairly flexible and easy way:
A pipeline is written in an executable YAML format.
Each pipeline consists of one or more commands.
A command is a component which can create, edit, send data and execute logic.
The output of the first command will become the input of the second, aso.
A pipeline can be executed manually or by a trigger.
Commands are sometimes also referred to as Pipes.
...
The pipeline can be created in your preferred local editor or in the Online Workbench (since version 7.0 (only
,Status colour Blue title ENTERPRISE
).Status colour Purple title CORPORATE To manually execute a pipeline locally you can use the CLI (we will cover these possibilities of the CLI later in this chapter):
pi pipeline file /path/to/your/local/pipeline.pi.yaml
pi pipeline remote key/of/your/pipeline/on/server
pi pipeline uri “inline-pipeline”
But the easiest way to ad-hoc execute a pipeline is by using the Online Workbench of your portal (available since version 7.0 for
,Status colour Blue title ENTERPRISE
licenses).Status colour Purple title CORPORATE
What is a Command?
The most important part of a pipeline is a command. Easily spoken, a command is a single server side task or function which can be executed from outside by its unique name. It is based on the command pattern and function as a service software architecture patterns. It supports input parameters, an input message and can optionally produce an output message:
...
There are many possibilities to execute a single command. This makes sure that for any purpose you can use the best matching approach.
Via Online Workbench
Only:
Status | ||||
---|---|---|---|---|
|
Status | ||||
---|---|---|---|---|
|
Since version 7.0 of PIPEFORCE, the Online Workbench is available. This is an advanced online editor with full code completion support where you can write pipelines and commands to be executed and then run them online. This is the easiest and most preferred way to ad-hoc execute a command or commands in pipelines. Here you can see the log command as an example to be executed there:
...
Via Command Line Interface (CLI)
...
(CLI)
Another approach to execute a single command is by using the Command Line Interface (CLI) (CLI). For example there is a built-in command datetime
which returns the current date time. A call of this command using the CLI would look like this:
...
Info |
---|
Note: Since different terminals handle characters like ? or | for example differently, make sure you wrap the pipeline uri inside quotation marks ( |
Via HTTP GET and POST
...
You can execute any command also as a rest-like endpoint using HTTP GET or POST calls. See this example using curl
to call the datetime
command:
...
Code Block |
---|
curl -H "apitoken: <YOUR_TOKEN>" \ -X GET "https://hub-acme.pipeforce.net/api/v3/command/log?message=HELLO" |
Via online documentation
Only:
Status | ||||
---|---|---|---|---|
|
Status | ||||
---|---|---|---|---|
|
There is a web UI available in the portal in order to document any command enabled for your instance. Furthermore you can also execute commands for testing purposes using this web interface. By default the url to the command form looks like this:
...
Whereas <NAME>
needs to be replaced by the name of the command. Here’s an example of the default command form for the datetime
command:
...
Documentation via CLI
An alternative to see the documentation of all available commands is to use the CLI tool:
...
Tip | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A single command can be executed by using one of these ways: Via Online Workbench of the portalof these ways:
|
What is a Pipeline?
Two or more commands can be combined to a pipeline. If such a pipeline gets executed, the commands in it will be executed by their serial ordering within the pipeline. The output message of the first command will become the input message of the next command and so on. By default, such a pipeline is written in a YAML format.
...
The PDF file my.pdf
is the output from the command drive.read
and will become the input for pdf.stamp
. After pdf.stamp
was executed and has put the stamp on the file, it will send it as output to drive.save
which stores it to the data room. Instead of a PDF file, the message body can also be of any other format like JSON, string or a like.
Info |
---|
Its It's also possible to write your pipeline script in a JSON format. But we recommend using YAML since it is less “noisy”. The pipeline from above rewritten as a JSON would look like this: |
...
Similar to a single command, a pipeline of commands is executed by sending it to server. Its a more advanced version of the “Function as a Service” approach since it can execute a bunch of commands in a predefined order.
Via Online Workbench
Only:
Status | ||||
---|---|---|---|---|
|
Status | ||||
---|---|---|---|---|
|
Since version 7.0 of PIPEFORCE, the Online Workbench is available. This is an advanced online editor with full code completion support where you can write pipelines and commands to be executed and then run them online. This is the easiest and most preferred way to ad-hoc execute a command or pipelines. Here you can see a simple pipeline after its ad-hoc execution as an example:
...
Auto-completion support for pipeline scripts
Note: This is experimental.
In order to enable auto-completion support for pipeline configuration files in your local development editor, you need to add the pipeline schema file to your IDE.
...