af_job.py 710 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. from pydantic import BaseModel
  2. from typing import List
  3. from app.schemas import AirflowTask
  4. class AirflowJobBase(BaseModel):
  5. tasks: List[AirflowTask]
  6. name: str
  7. dependence: List=[]
  8. cron: str
  9. desc: str
  10. route_strategy: str
  11. block_strategy: str
  12. executor_timeout: int
  13. executor_fail_retry_count: int
  14. trigger_status: int
  15. class AirflowJobCreate(AirflowJobBase):
  16. job_type: int
  17. job_mode: int
  18. user_id: int
  19. class AirflowJobUpdate(AirflowJobBase):
  20. pass
  21. # update_time: int
  22. class AirflowJob(AirflowJobBase):
  23. id: int
  24. create_time: int
  25. update_time: int
  26. user_id: int
  27. job_type: int
  28. job_mode: int
  29. class Config:
  30. orm_mode = True