workflow apis (#326)

Co-authored-by: Shuchang Zheng <wintonzheng0325@gmail.com>
This commit is contained in:
Kerem Yilmaz 2024-05-16 10:51:22 -07:00 committed by GitHub
parent 50026f33c2
commit 72d25cd37d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 364 additions and 19 deletions

View file

@ -107,8 +107,22 @@ class UnknownBlockType(SkyvernException):
class WorkflowNotFound(SkyvernHTTPException):
def __init__(self, workflow_id: str) -> None:
super().__init__(f"Workflow {workflow_id} not found", status_code=status.HTTP_404_NOT_FOUND)
def __init__(
self,
workflow_id: str | None = None,
workflow_permanent_id: str | None = None,
version: int | None = None,
) -> None:
workflow_repr = ""
if workflow_id:
workflow_repr = f"workflow_id={workflow_id}"
if workflow_permanent_id:
if version:
workflow_repr = f"workflow_permanent_id={workflow_permanent_id}, version={version}"
else:
workflow_repr = f"workflow_permanent_id={workflow_permanent_id}"
super().__init__(f"Workflow not found. {workflow_repr}", status_code=status.HTTP_404_NOT_FOUND)
class WorkflowRunNotFound(SkyvernException):