|
|
## On-demand starts
|
|
|
|
|
|
This task example tasks will create a 500 MiB file in the directory `tmp` with random data.
|
|
|
|
|
|
- It is started on demand via login & web interface or
|
|
|
- anonymously by calling the webhook at `<baseurl>/run/webhook/0ec52a80-942a-4953-91a4-46b55e6839dc`):
|
|
|
|
|
|
```json
|
|
|
{
|
|
|
"type": "ondemand",
|
|
|
"exec": "system",
|
|
|
"args": [
|
|
|
"/usr/bin/dd",
|
|
|
"if=/dev/urandom",
|
|
|
"of=random_file_500MB.dat",
|
|
|
"bs=1MB",
|
|
|
"count=500"
|
|
|
],
|
|
|
"cwd": "/tmp",
|
|
|
"tokens": ["0ec52a80-942a-4953-91a4-46b55e6839dc"],
|
|
|
"info": "## About randomtest\n\nrandomtest is a relativly long-running example."
|
|
|
}
|
|
|
```
|
|
|
|
|
|
## Scheduled starts
|
|
|
|
|
|
Here is a complex schedule example. `Notepad.exe` will be started
|
|
|
|
|
|
- on Mon-Sat on the 29th or 30th
|
|
|
- of October/November/December,
|
|
|
- every minute
|
|
|
- between 12 and 15 o'clock.
|
|
|
- If the instance of `notepad.exe` keeps running, no new instance will be spawned from this task.
|
|
|
|
|
|
```json
|
|
|
{
|
|
|
"type": "schedule",
|
|
|
"schedule": "* 12-15 29,30 10-12 1-6",
|
|
|
"exec": "system",
|
|
|
"args": [
|
|
|
"notepad.exe", "test.txt"
|
|
|
],
|
|
|
"cwd": "C:/temp"
|
|
|
}
|
|
|
```
|
|
|
|
|
|
## Using secrets/environments
|
|
|
|
|
|
This example has an `env` variable named `TAIL_FILE`. The value `/tmp/test` is not visible from the web interface.
|
|
|
|
|
|
```json
|
|
|
{
|
|
|
"type": "keepalive",
|
|
|
"exec": "system",
|
|
|
"args": [
|
|
|
"bash", "-c",
|
|
|
"tail -f $TAIL_FILE"
|
|
|
],
|
|
|
"cwd": "/tmp",
|
|
|
"env": {
|
|
|
"TAIL_FILE": "/tmp/test"
|
|
|
},
|
|
|
"info": "## About tailf\n\ntailf helps you watching `/tmp/test.log`"
|
|
|
}
|
|
|
```
|
|
|
|
|
|
## Exec type for Talend® jobs
|
|
|
|
|
|
Exported [Talend®](https://www.talend.com/de/products/talend-open-studio/) jobs are executed with the system's default Java runtime environment.
|
|
|
|
|
|
- In this example, the job context is set to `Test`
|
|
|
- and the start/max memory is set to 256 MiB/1024 GiB.
|
|
|
|
|
|
```json
|
|
|
{
|
|
|
"type": "keepalive",
|
|
|
"exec": "talend",
|
|
|
"package": "/opt/talend/talend-demo-job-with-subtask.zip",
|
|
|
"args": [
|
|
|
"--context=Test",
|
|
|
"-Xms256M",
|
|
|
"-Xmx1024M"
|
|
|
],
|
|
|
"cwd": "/tmp",
|
|
|
"info": "## About talendexample\n\nDeflate and keepalive talend demo job"
|
|
|
}
|
|
|
``` |