jobs:create
rai jobs:create [OPTIONS]Create a job.
--payload-json accepts a JSON object and is applied last, so it can
override values composed from convenience flags such as --database,
--raw-code, --inputs-json, and --headers-json.
The composed payload always includes convenience keys such as:
raw_codeinputs- optionally
headersandtimeout_mins
For Logic, it also adds transaction-style keys such as:
dbnamequeryv1_inputs
Examples
Section titled “Examples”Logic:
rai jobs:create --type Logic --name TEST --database my_db --raw-code 'def output = 1'
Logic with explicit payload:
rai jobs:create --type Logic --name TEST --payload-json '{"dbname":"my_db","query":"def output = 1"}'
Prescriptive with explicit payload:
rai jobs:create --type Prescriptive --name TEST --payload-json '{"raw_code":"solve {}","inputs":{"x":1}}'
Options
Section titled “Options”| Option | Type | Description |
|---|---|---|
--type | text | Job type (Logic/Prescriptive/Predictive). |
--reasoner-name, --name | text | Reasoner name to run on (optional). |
--database | text | Database (required for Logic when composing a payload). |
--raw-code | text | Raw code for payload construction. |
--raw-code-file | file | |
--inputs-json | text | Inputs JSON object (default: ). |
--headers-json | text | Headers JSON object (optional). |
--language | text | Default: rel. |
--payload-json | text | JSON object to override/extend the composed payload; must decode to a dict. Default: {}. |
--timeout-mins | integer | |
--timeout-s | float | Timeout in seconds while waiting until the job reaches a terminal state. Default: 900.0. |
--poll-interval-s | float | Polling interval in seconds while waiting until the job reaches a terminal state. Default: 0.5. |
--bypass-index | Boolean | Default: False. |
--gi-setup-skipped | Boolean | Default: False. |
--readonly, --readwrite | Boolean | Default: True. |
--wait | Boolean | Wait until the job reaches a terminal state before returning. Default: False. |