Skip to main content

Module param

Module param 

Source
Expand description

astrs param get/set/list/delete (blueprint §17’s Graph-ops row).

  astrs param set <ref> <key> 30     ─► SetParam{scope,key,Integer(30)} ─► Ok
  astrs param get <ref> <key>        ─► GetParam{scope,key,inherited}   ─► ParamValue
  astrs param list <ref> [--node n]  ─► GetParams{scope,prefix}         ─► ParamList
  astrs param delete <ref> <key>     ─► DeleteParam{scope,key}          ─► Ok

§Three scopes, one positional word

astrs_wire::ParamScope has three levels — global, one dataflow, one node — and the CLI spells all three with the argument a user already types: the dataflow reference, plus an optional --node. The literal word global in the dataflow position selects astrs_wire::ParamScope::Global, which is how a cluster-wide default is written without inventing a flag for it.

§Values are plain JSON, not the wire’s tagged form

astrs_wire::Parameter serializes as an externally tagged enum ({"integer": 30}), which is the right thing on the wire and the wrong thing to make a human type. astrs param set flow camera.fps 30 takes plain JSON — 30, 1.5, true, "left", [1,2,3] — and infers the variant, exactly as a user expects. The tagged spelling is still accepted for the one case inference cannot serve: pinning a whole number as a float ('{"float": 30}').

Structs§

ScopeArgs
Arguments shared by every parameter verb.

Enums§

ScopeRef
Where a parameter lives, before the dataflow reference is resolved.

Constants§

GLOBAL_SCOPE_WORD
The word that selects ParamScope::Global in the dataflow position.
WATCH_POLL_INTERVAL
How often watch polls ControlRequest::GetParam.

Functions§

delete
Deletes one parameter.
get
Reads one parameter.
list
Lists a scope’s parameters.
parse_value
Turns the JSON a user typed into a Parameter.
scope_name
A human name for a resolved scope, for output.
set
Writes one parameter.
to_plain_json
A Parameter as the plain JSON parse_value accepts, so astrs param get --json | astrs param set round-trips.
watch
Watches one parameter, printing every value it transitions to.