exlab_wizard.api.routers.staging#

/staging router. Backend Spec §13.7, §13.8.

Three endpoints back the orchestrator’s staging panel:

  • GET /staging – enumerate every staged run with its lifecycle state, file count, byte total, and elapsed time since last activity.

  • POST /staging/{run_path}/force-sync – enqueue an immediate NAS sync for a specific run (used when the operator wants to skip the watcher’s polling latency).

  • POST /staging/{run_path}/clear – delete the local staging copy of a sync-verified run (the manual-mode action from §13.7).

All three return 503 with {"code": "orchestrator_disabled"} when config.orchestrator.enabled is False – the router is only mounted when the flag is True (see api.app.create_app()), but the guard is kept here so a misconfigured deployment surfaces a clear error.

Functions

build_staging_router()

Construct the /staging router.

Classes

ClearResponse(**data)

POST /staging/{run_path}/clear response.

ForceSyncResponse(**data)

POST /staging/{run_path}/force-sync response.

StagedRunRow(**data)

One staging-panel row.

StagingListResponse(**data)

GET /staging response.

class exlab_wizard.api.routers.staging.ClearResponse(**data)[source]#

Bases: BaseModel

POST /staging/{run_path}/clear response.

Parameters:

data (Any)

bytes_freed: int#
files_freed: int#
model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

run_path: str#
class exlab_wizard.api.routers.staging.ForceSyncResponse(**data)[source]#

Bases: BaseModel

POST /staging/{run_path}/force-sync response.

Parameters:

data (Any)

job_id: str | None#
model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

run_path: str#
state: str#
class exlab_wizard.api.routers.staging.StagedRunRow(**data)[source]#

Bases: BaseModel

One staging-panel row. Backend Spec §13.8.

Parameters:

data (Any)

byte_total: int#
current_state: str#
elapsed_seconds_since_last_activity: int#
equipment_id: str#
file_count: int#
last_activity_at: str#
model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

path: str#
project_name: str#
run_kind: str#
class exlab_wizard.api.routers.staging.StagingListResponse(**data)[source]#

Bases: BaseModel

GET /staging response.

Parameters:

data (Any)

model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

runs: list[StagedRunRow]#
exlab_wizard.api.routers.staging.build_staging_router()[source]#

Construct the /staging router. Backend Spec §13.7, §13.8.

Return type:

APIRouter