Documentation
¶
Overview ¶
Package api provieds information about Scheduler HTTP endpoints.
Index ¶
- func Routes() map[EndpointID]Endpoint
- type DagRunRestartInput
- type DagRunTaskStatus
- type DagRunTriggerInput
- type Endpoint
- type EndpointID
- type StatusCounts
- type TaskPos
- type TaskToExec
- type Timestamp
- type UIDagrunDetails
- type UIDagrunList
- type UIDagrunRow
- type UIDagrunStats
- type UIDagrunTask
- type UITaskLogRecord
- type UITaskLogs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DagRunRestartInput ¶ added in v0.0.11
DagRunRestartInput defines input structure for restarting DAG run.
type DagRunTaskStatus ¶
type DagRunTaskStatus struct { DagId string `json:"dagId"` ExecTs string `json:"execTs"` TaskId string `json:"taskId"` Retry int `json:"retry"` Status string `json:"status"` TaskErr *string `json:"taskError"` }
DagRunTaskStatus contains information about DAG run task status and potential execution error.
type DagRunTriggerInput ¶ added in v0.0.10
type DagRunTriggerInput struct {
DagId string `json:"dagId"`
}
DagRunTriggerInput defines input structure for scheduling new DAG run execution.
type EndpointID ¶
type EndpointID int
Identifier for Scheduler server endpoints.
const ( // Endpoint for taking the first task to be executed from Scheduler // internal queue. EndpointDagTaskPop EndpointID = iota // Endpoint for updating status of given DAG run task. EndpointDagTaskUpdate // Endpoint for scheduling new DAG run (externally). EndpointDagRunTrigger // Endpoint for restarting DAG run (externally). EndpointDagRunRestart // Endpoint return current status of Scheduler. EndpointState // Endpoint returns statistics on DAG runs and scheduler queues. EndpointUiDagrunStats // Endpoint returns data on N latest DAG runs. EndpointUiDagrunLatest // Endpoint returns detailed data on given DAG run. EndpointUiDagrunDetails // Endpoint returns DAG run task information for single task. EndpointUiDagrunTaskDetails )
type StatusCounts ¶
type StatusCounts struct { Success int `json:"success"` Failed int `json:"failed"` Scheduled int `json:"scheduled"` Running int `json:"running"` }
StatusCounts keeps mapping between statuses (of dagruns, task execution, etc) and their frequencies.
type TaskPos ¶ added in v0.0.7
TaskPos represents a Task position in a DAG. Root starts in (D=1,W=1).
type TaskToExec ¶
type TaskToExec struct { DagId string `json:"dagId"` ExecTs string `json:"execTs"` TaskId string `json:"taskId"` Retry int `json:"retry"` }
TaskToExec contains information about a task which is scheduled to be executed. Primarily to communicate between Scheduler and Executors.
type Timestamp ¶
type Timestamp struct { ToDisplay string `json:"toDisplay"` Date string `json:"date"` Time string `json:"time"` Timezone string `json:"timezone"` }
Timestamp represents information about timestamp. ToDisplay is the field which will be displayed on the UI as the main information. Other details, like timezone might be used in tooltips.
func ToTimestamp ¶
ToTimestamp converts given time into UI Timestamp information.
type UIDagrunDetails ¶ added in v0.0.7
type UIDagrunDetails struct { RunId int64 `json:"runId"` DagId string `json:"dagId"` ExecTs Timestamp `json:"execTs"` Status string `json:"status"` Duration string `json:"duration"` Tasks []UIDagrunTask `json:"tasks"` }
UIDagrunDetails represents details on a single DAG run, including its tasks and their log records.
type UIDagrunRow ¶
type UIDagrunRow struct { RunId int64 `json:"runId"` DagId string `json:"dagId"` ExecTs Timestamp `json:"execTs"` InsertTs Timestamp `json:"insertTs"` Status string `json:"status"` StatusUpdateTs Timestamp `json:"statusUpdateTs"` Duration string `json:"duration"` TaskNum int `json:"taskNum"` TaskCompletedNum int `json:"taskCompletedNum"` }
UIDagrunRow represents information on a single DAG run on the main UI page.
type UIDagrunStats ¶
type UIDagrunStats struct { Dagruns StatusCounts `json:"dagruns"` DagrunTasks StatusCounts `json:"dagrunTasks"` DagrunQueueLen int `json:"dagrunQueueLen"` TaskSchedulerQueueLen int `json:"taskSchedulerQueueLen"` GoroutinesNum int `json:"goroutinesNum"` }
UIDagrunStats is a struct for statistics on DAG runs and related metrics for the main UI page.
type UIDagrunTask ¶ added in v0.0.7
type UIDagrunTask struct { TaskId string `json:"taskId"` Retry int `json:"retry"` InsertTs Timestamp `json:"insertTs"` TaskNoStarted bool `json:"taskNotStarted"` Status string `json:"status"` Pos TaskPos `json:"taskPosition"` Duration string `json:"duration"` Config string `json:"configJson"` TaskLogs UITaskLogs `json:"taskLogs"` }
UIDagrunTask represents information of single DAG run task, including execution logs.
type UITaskLogRecord ¶ added in v0.0.7
type UITaskLogRecord struct { InsertTs Timestamp `json:"insertTs"` Level string `json:"level"` Message string `json:"message"` AttributesJson string `json:"attributesJson"` }
UITaskLogRecord represents task log records with assumed DAG run and task information.
type UITaskLogs ¶ added in v0.0.7
type UITaskLogs struct { LogRecordsCount int `json:"logRecordsCount"` LoadedRecords int `json:"loadedRecords"` Records []UITaskLogRecord `json:"logRecords"` }
UITaskLogs represents information on DAG run task logs. By default read only fixed number of log records, to limit the request body size and on demand more log records can be loaded in a separate call.