SwarmOps
ReferenceCommandsswarmops ref txn

Page kind: Reference

swarmops ref txn#

Describes v0.11.0Last changed View as Markdown

Move several refs as one operation, each by compare-and-swap: all of them or none.

Each --move is NAME=EXPECT:TO: EXPECT the full id NAME names now, or new to create it; TO the revision to point it at, or delete. Every expectation is checked under the store's lock before any ref moves: one or more stale ones are E_CAS_MISMATCH, each listed in details.mismatches, and nothing is written. Each move follows ref set's and ref delete's rules. op undo of the operation restores every ref at once.

Metadata
Group
refs
Since
0.11.0
Mutates
yes
Identity required
yes
MCP tool
ref_txn
Envelope op
ref_txn
Exit codes
0
Errors
none

Syntax#

Syntax
swarmops ref txn [OPTIONS] --move <NAME=EXPECT:TO>

Required arguments#

Syntax: --move <NAME=EXPECT:TO>....

One move, NAME=EXPECT:TO, such as release/1=new:main; 1 to 64, each ref once.

Optional arguments#

The command also takes the global options.

Examples#

No recorded example yet.

No recorded example yet.

Return information#

result is a RefTxnResp (swarmops schema RefTxnResp prints its JSON Schema).

FieldTypeRequiredDescription
idstringyesIts id, which undo takes to restore every ref at once.
movesarray of RefMoveOutyesThe moves, in the request's order.
opintegeryesThe operation that recorded every move: its number in op_log.
warningsarray of stringnoProblems found after the moves became durable, such as failed housekeeping; the moves themselves succeeded. Omitted when empty.

Envelope op: ref_txn.

Exit codes:

  • 0: Success.

Errors#

No golden step shows this command failing yet.

Any command that opens a store may also fail with a store error, such as E_NOT_A_REPO, E_IO or E_STORE_CORRUPT; a command line the grammar refuses is E_INVALID_ARG (exit 2).

See also#

On this page