Couper Documentation

edge

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 nameContextLabel
beta_jobDefinitions Blockrequired

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

NameTypeDefaultDescription
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 unitsDescription
nsnanoseconds
us (or ยตs)microseconds
msmilliseconds
sseconds
mminutes
hhours

Nested Blocks

NameDescription
request

Configures a request (zero or more).