Keep B2 client fixes and move VPS implementation to its standalone repository
This commit is contained in:
@@ -201,6 +201,7 @@ def command_runtime(
|
||||
tracked: Annotated[list[str] | None, Query(max_length=32)] = None,
|
||||
) -> Document:
|
||||
from k1link.fleet.equipment_command_catalog import catalog
|
||||
from k1link.fleet.equipment_command_dispatch import supported as scheduler_supported
|
||||
from k1link.fleet.equipment_command_journal import listing
|
||||
from k1link.fleet.equipment_command_runtime import source
|
||||
from k1link.fleet.equipment_operations import KINDS, supported
|
||||
@@ -215,7 +216,7 @@ def command_runtime(
|
||||
**listing(equipment, identifier, before, tracked=tracked or ()),
|
||||
"device": equipment.public(row),
|
||||
"catalog": catalog(equipment, row),
|
||||
"capacity": 32,
|
||||
"capacity": None if scheduler_supported(host) else 32,
|
||||
"durable_kinds": sorted(k for k in KINDS if supported(host or {}, k)),
|
||||
}
|
||||
|
||||
@@ -244,6 +245,21 @@ def cancel_command(identifier: str, request_id: str, response: Response, fleet:
|
||||
)
|
||||
|
||||
|
||||
class RepeatCommandRequest(BaseModel):
|
||||
model_config = ConfigDict(extra="forbid")
|
||||
request_id: str = Field(pattern=r"^[a-f0-9]{32}$")
|
||||
|
||||
|
||||
@router.post("/instances/{identifier}/commands/{original_id}/repeat")
|
||||
def repeat_command(
|
||||
identifier: str, original_id: str, body: RepeatCommandRequest, response: Response, fleet: Fleet
|
||||
) -> Document:
|
||||
from k1link.fleet.equipment_command_repeat import repeat
|
||||
from k1link.web.vps_host_api import store
|
||||
|
||||
return action(response, lambda: repeat(store(fleet), identifier, original_id, body.request_id))
|
||||
|
||||
|
||||
@router.get("/instances/{identifier}/commands/{request_id}/attempts")
|
||||
def command_attempts(
|
||||
identifier: str,
|
||||
|
||||
Reference in New Issue
Block a user