Default Space
The account's default Space, the order to try when it is offline, and where a new task runs now.
The relay keeps one default Space per account: where a new task runs unless you pick another. Devices.spaces_settings reads it, set_spaces_settings replaces it, and resolve_default_space says where a task goes now: the default when it is online, else the next online computer in fallback (while fallback_on), else this computer. A new computer is never made. cua spaces default is the same from the CLI.
Default Space#
Methods of Devices.
Devices.spaces_settings#
The account's default Space and fallback order. A relay that predates them answers "the Cua relay needs an update".
async def spaces_settings(self) -> SpacesSettingsReturns SpacesSettings · Async · Raises CuaError
Devices.set_spaces_settings#
Replaces the account's default Space settings (the whole object;
updated_at is set by the relay). Returns what the relay saved.
async def set_spaces_settings(self, settings: SpacesSettings) -> SpacesSettings| Parameter | Type | Default |
|---|---|---|
settings | SpacesSettings | required |
Returns SpacesSettings · Async · Raises CuaError
Devices.resolve_default_space#
Where the default Space resolves now: the first online entry of the default, the fallback order, then this computer (its own relay machine id, when it has one). Creates nothing.
async def resolve_default_space(self) -> DefaultSpaceReturns DefaultSpace · Async · Raises CuaError
SpacesSettings record#
The account's default Space and the order to try when it is offline.
Returned by Devices.set_spaces_settings, Devices.spaces_settings.
| Field | Type | Default | Description |
|---|---|---|---|
default_space / defaultSpace | Option<String> | relay:<machine> or relay:<machine>/<name>; none when unset. | |
fallback | Vec<String> | The order to try when the default is offline; empty means every online computer you can use, oldest first. | |
fallback_on / fallbackOn | bool | false: only the default, then this device. | |
updated_at / updatedAt | u64 | Unix seconds the relay saved it (ignored when writing). |
DefaultSpace record#
Where the default Space resolves now.
Returned by Devices.resolve_default_space.
| Field | Type | Default | Description |
|---|---|---|---|
space | Option<String> | The first online entry; none when this device is the answer (reason here). | |
reason | String | default, fallback, here or unset. | |
default_space / defaultSpace | Option<String> | The chosen default, online or not. | |
default_online / defaultOnline | Option<bool> | Whether the default is online; none when unset. | |
order | Vec<DefaultSpaceStep> | The order the relay tried. |
DefaultSpaceStep record#
One entry of the order Devices.resolve_default_space tried.
| Field | Type | Default | Description |
|---|---|---|---|
space | String | The Space id. | |
name | String | Its display name. | |
online | bool | Connected and sharing now. | |
role | String | default, fallback or here. |