feat(pipeline): api for updating pipeline

This commit is contained in:
Junyan Qin
2025-03-27 00:47:54 +08:00
parent d8c730341a
commit 6c1ee922de
2 changed files with 16 additions and 1 deletions

View File

@@ -58,6 +58,15 @@ class PipelineService:
)
# TODO: 更新到pipeline manager
async def update_pipeline(self, pipeline_uuid: str, pipeline_data: dict) -> None:
del pipeline_data['uuid']
del pipeline_data['for_version']
del pipeline_data['stages']
await self.ap.persistence_mgr.execute_async(
sqlalchemy.update(persistence_pipeline.LegacyPipeline).where(persistence_pipeline.LegacyPipeline.uuid == pipeline_uuid).values(**pipeline_data)
)
# TODO: 更新到pipeline manager
async def delete_pipeline(self, pipeline_uuid: str) -> None:
await self.ap.persistence_mgr.execute_async(
sqlalchemy.delete(persistence_pipeline.LegacyPipeline).where(persistence_pipeline.LegacyPipeline.uuid == pipeline_uuid)