Job (Beta)
The beta_job
block lets you define recurring requests or sequences with an given interval. The job runs at startup
and for every interval and has an own log type: job
which represents the starting point with an uid for tracing
purposes.
Block name | Context | Label |
---|---|---|
beta_job | Definitions Block | required |
Example
# ...
definitions {
beta_job "update_data" {
# Execute once at the start of Couper and then every minute
interval = "1m"
request "origin" {
url = "/api/v1/exports/data"
backend = "read"
}
request "update" {
url = "/update"
body = backend_responses.origin.body
backend = "write"
}
}
backend "read" {
origin = "${env.MY_ORIGIN}"
basic_auth = env.MY_AUTH
}
backend "write" {
origin = "${env.ORIGIN_DATABASE}"
}
}
Attributes
Name | Type | Default | Description |
---|---|---|---|
custom_log_fields | object | - | Log fields for custom logging. Inherited by nested blocks. |
interval | duration | - | Execution interval. |
Duration
Values of type duration are provided as number string followed by a unit listed below.
Example: timeout = "300s"
Duration units | Description |
---|---|
ns | nanoseconds |
us (or ยตs ) | microseconds |
ms | milliseconds |
s | seconds |
m | minutes |
h | hours |
Nested Blocks
Name | Description |
---|---|
request | Configures a request (zero or more). |