You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
|
|
class TaskInstance extends Model
|
|
|
|
|
{
|
|
|
|
|
use HasFactory;
|
|
|
|
|
|
|
|
|
|
protected $fillable = [
|
|
|
|
|
'dag_id',
|
|
|
|
|
'dag_run_id',
|
|
|
|
|
'airflow_id',
|
|
|
|
|
'task_id',
|
|
|
|
|
'state',
|
|
|
|
|
'execution_date',
|
|
|
|
|
'start_date',
|
|
|
|
|
'end_date',
|
|
|
|
|
'log',
|
|
|
|
|
'metadata',
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
protected $casts = [
|
|
|
|
|
'metadata' => 'array',
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Связь с Airflow кластером.
|
|
|
|
|
*/
|
|
|
|
|
public function airflow()
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(Airflow::class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Связь с моделью DAG.
|
|
|
|
|
*/
|
|
|
|
|
public function dag()
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(dag::class);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Связь с моделью DAGRun.
|
|
|
|
|
*/
|
|
|
|
|
public function dagRun()
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(dag_run::class);
|
|
|
|
|
}
|
|
|
|
|
}
|