feat(cloud-sdk): expose distributed task status
This commit is contained in:
@@ -107,6 +107,9 @@ def create_cloud_router(
|
||||
workflow_definition_id=task.workflow_definition_id,
|
||||
assigned_device_id=task.assigned_device_id,
|
||||
assigned_host_id=task.assigned_host_id,
|
||||
attempt_count=task.attempt_count,
|
||||
lease_expires_at=task.lease_expires_at,
|
||||
failure_reason=task.failure_reason,
|
||||
)
|
||||
|
||||
@router.get("/devices", response_model=list[DeviceResponse])
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import datetime
|
||||
from typing import Literal
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
@@ -29,6 +30,9 @@ class TaskStatusResponse(BaseModel):
|
||||
workflow_definition_id: str | None = None
|
||||
assigned_device_id: str | None = None
|
||||
assigned_host_id: str | None = None
|
||||
attempt_count: int = 0
|
||||
lease_expires_at: datetime | None = None
|
||||
failure_reason: str | None = None
|
||||
|
||||
|
||||
class DeviceResponse(BaseModel):
|
||||
|
||||
Reference in New Issue
Block a user