JobData/app/api/v1/pipeline.py

19 lines
613 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from fastapi import APIRouter
from app.core.scheduler import ecs_full_pipeline_job
pipeline_router = APIRouter(tags=["ECS任务"])
@pipeline_router.get("/trigger", summary="立即触发ECS全流程任务无需鉴权")
async def trigger_ecs_pipeline():
"""
主动触发一次 ECS 全流程任务(删除→创建→安装云助手→执行命令)
参数:无
返回:执行状态提示
用途:提供手动触发入口,便于在控制台或外部系统调用
"""
await ecs_full_pipeline_job()
return {"code": 200, "message": "ECS 全流程任务已触发执行"}