65 lines
2.0 KiB
Python
65 lines
2.0 KiB
Python
from pydantic import BaseModel, Field
|
|||
|
|
from typing import Dict, Any, List, Optional
|
||
|
|
|
||
|
|
class DeployRequest(BaseModel):
|
||
|
|
pipeline_id: str
|
||
|
|
description: Optional[str] = "Dynamic Lakehouse Pipeline"
|
||
|
|
schedule: Optional[str] = "0 */1 * * *"
|
||
|
|
nodes: List[Dict[str, Any]]
|
||
|
|
edges: List[Dict[str, Any]]
|
||
|
|
notes: Optional[List[Dict[str, Any]]] = None
|
||
|
|
spec_yaml: Optional[str] = ""
|
||
|
|
bundle_name: Optional[str] = "dlh-core-ingestion"
|
||
|
|
version: Optional[str] = "v1.0.0"
|
||
|
|
|
||
|
|
class DraftRequest(BaseModel):
|
||
|
|
pipeline_id: str
|
||
|
|
description: Optional[str] = "Dynamic Lakehouse Pipeline Draft"
|
||
|
|
schedule: Optional[str] = "0 */1 * * *"
|
||
|
|
nodes: List[Dict[str, Any]]
|
||
|
|
edges: List[Dict[str, Any]]
|
||
|
|
notes: Optional[List[Dict[str, Any]]] = None
|
||
|
|
bundle_name: Optional[str] = "dlh-core-ingestion"
|
||
|
|
|
||
|
|
class PublishVersionRequest(BaseModel):
|
||
|
|
pipeline_id: str
|
||
|
|
version_tag: str = Field(..., description="Semantic version tag, e.g. v1.0.0, v1.1.0")
|
||
|
|
changelog: Optional[str] = "Released new pipeline version via MERICA Studio"
|
||
|
|
bundle_name: Optional[str] = "dlh-core-ingestion"
|
||
|
|
nodes: Optional[List[Dict[str, Any]]] = None
|
||
|
|
edges: Optional[List[Dict[str, Any]]] = None
|
||
|
|
notes: Optional[List[Dict[str, Any]]] = None
|
||
|
|
|
||
|
|
class RevertVersionRequest(BaseModel):
|
||
|
|
version_tag: str
|
||
|
|
|
||
|
|
class VersionSnapshotItem(BaseModel):
|
||
|
|
version: str
|
||
|
|
pipeline_id: str
|
||
|
|
bundle_name: str
|
||
|
|
changelog: str
|
||
|
|
published_at: str
|
||
|
|
nodes_count: int
|
||
|
|
edges_count: int
|
||
|
|
snapshot_filename: str
|
||
|
|
|
||
|
|
class VersionListResponse(BaseModel):
|
||
|
|
pipeline_id: str
|
||
|
|
current_version: Optional[str]
|
||
|
|
bundle_name: str
|
||
|
|
versions: List[VersionSnapshotItem]
|
||
|
|
|
||
|
|
class PipelineItem(BaseModel):
|
||
|
|
id: str
|
||
|
|
description: Optional[str] = ""
|
||
|
|
schedule: Optional[str] = "0 */1 * * *"
|
||
|
|
nodes: List[Dict[str, Any]] = []
|
||
|
|
edges: List[Dict[str, Any]] = []
|
||
|
|
is_draft: bool = False
|
||
|
|
status: str = "deployed"
|
||
|
|
bundle_name: Optional[str] = "dlh-core-ingestion"
|
||
|
|
version: Optional[str] = "v1.0.0"
|
||
|
|
|
||
|
|
class PipelineListResponse(BaseModel):
|
||
|
|
pipelines: List[Dict[str, Any]]
|