123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- from typing import List, Optional
- from pydantic import BaseModel
- class JobInfoBase(BaseModel):
- # 任务执行CRON
- job_cron: str
- # 任务描述
- job_desc: str
- # 执行器路由策略
- executor_route_strategy: str
- # 执行器任务handler
- executor_handler: Optional[str]
- # 执行器任务参数
- executor_param: Optional[str]
- # 阻塞处理策略
- executor_block_strategy: str
- # 任务超时时间, 单位分钟
- executor_timeout: int
- # 失败重试次数
- executor_fail_retry_count: int
- # 增量初始时间
- inc_start_time: Optional[int]
- # datax运行脚本
- job_json: str
- # 增量时间
- replace_param: Optional[str]
- # 分区信息
- partition_info: Optional[str]
- # jvm参数
- jvm_param: Optional[str]
- class JobInfoCreate(JobInfoBase):
- class Config:
- schema_extra = {
- "example": {
- "job_cron": "0 0/2 * * * ?",
- "job_desc": "mysql-mysql同步",
- "executor_route_strategy": "FIRST",
- "executor_handler": "",
- "executor_param": "",
- "executor_block_strategy": "SERIAL_EXECUTION",
- "executor_timeout": 60,
- "executor_fail_retry_count": 2,
- "inc_start_time": 0,
- "job_json": "",
- "replace_param": "-DlastTime='%s' -DcurrentTime='%s'",
- "partition_info": "txn_date,0,yyyy-MM-dd",
- "jvm_param": "",
- }
- }
- class JobInfoUpdate(JobInfoBase):
- # 调度状态: 0-停止 1-运行
- trigger_status: int
- class Config:
- schema_extra = {
- "example": {
- "job_cron": "0 0/2 * * * ?",
- "job_desc": "mysql-mysql同步",
- "executor_route_strategy": "FIRST",
- "executor_handler": "",
- "executor_param": "",
- "executor_block_strategy": "SERIAL_EXECUTION",
- "executor_timeout": 60,
- "executor_fail_retry_count": 2,
- "inc_start_time": 0,
- "job_json": "",
- "trigger_status": 1,
- "replace_param": "-DlastTime='%s' -DcurrentTime='%s'",
- "partition_info": "txn_date,0,yyyy-MM-dd",
- "jvm_param": "",
- }
- }
- class JobInfo(JobInfoBase):
- id: int
- # 创建时间
- create_time: int
- # 更新时间
- update_time: int
- # 创建人
- user_id: int
- # 调度状态: 0-停止 1-运行
- trigger_status: int
- # 上次调度时间
- trigger_last_time: int
- # 下次调度时间
- trigger_next_time: int
- # datax运行脚本
- job_json: str
- # 最近一次执行状态
- last_handle_code: int
- class Config:
- orm_mode = True
|