Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

ybatch

ybatch runs a file of commands against a running yuno, one after another, each waiting for the previous response. It is the unattended, file-driven member of the control-plane family — use it for automation, provisioning, and smoke tests. For interactive use or one-off commands reach for ycommand instead; ybatch is what you point at a checked-in script.

Usage

ybatch [options] FILE

FILE is a positional argument: the path to the commands file (see Commands file format below). The connection and authentication options match ycommand.

# Run a provisioning script against the local agent
ybatch provision.ybatch

# Against a remote agent, authenticating via OIDC discovery
ybatch --url wss://host:1993 \
       --issuer https://auth.example.com/realms/yuneta/ \
       --client-id yuneta --user_id alice --user_passw '••••••' \
       provision.ybatch

Run ybatch --help for the full flag list.

Commands file format

The file is a sequence of relaxed-JSON objects (single quotes and unquoted keys are accepted), each with a command key. Objects are read by brace matching, so they may span multiple lines and any text outside a { ... } block is ignored (handy for free-form comments between commands).

# A ybatch script (text outside { } is ignored)

{command: 'list-yunos'}

{command: 'stats-yuno yuno_role=logcenter'}

# Keep going even if this one fails:
{command: '-command-yuno yuno_role=logcenter command=reset-counters'}

# Equivalent, explicit form:
{command: 'reset-counters', ignore_fail: true}
FieldMeaning
commandThe command string, exactly as you would type it in ycommand (with arg=val, service=…, etc.). Required.
ignore_failIf true, a failure of this command does not abort the batch.
- prefixA leading - on the command value is shorthand for ignore_fail: true (the same convention ycommand uses).

By default the first failing command stops the batch; mark the commands that are allowed to fail with the - prefix or ignore_fail.

Options

OptionShortPurpose
--url=<url>-uYuno to connect to. Default ws://127.0.0.1:1991.
--yuno_role=<role>-ORemote yuno role.
--yuno_name=<name>-oRemote yuno name.
--yuno_service=<svc>-STarget service. Default __default_service__.
--config-file=<file>-fLoad settings from a JSON config file (or files).
--print-pPrint the resulting configuration and exit.
--verbose=<level>-lVerbose level.

Authentication uses the same OAuth2 / OIDC flags as ycommand (--issuer/-I, --token-endpoint/-T, --end-session-endpoint/-E, --client-id/-Z, --user_id/-x, --user_passw/-X, --jwt/-j) — see Authentication (OAuth2 / OIDC).

See also