View Source Lightning.Runs (Lightning v2.10.4)

Gathers operations to create, update and delete Runs.

Summary

Functions

Enqueue a run to be processed.

Get a run by id.

Returns only the dataclip body as a string

Returns only the dataclip request as a string

Get a run by id, preloading the snapshot and its credential.

Returns a run's dataclip formatted for use as state.

Creates a Step for a given run and job.

Clears the body and request fields of the dataclip associated with the given run.

Functions

Link to this function

append_run_log(run, params, scrubber \\ nil)

View Source
Link to this function

complete_run(run, params)

View Source
@spec complete_run(Lightning.Run.t(), %{optional(any()) => any()}) ::
  {:ok, Lightning.Run.t()} | {:error, Ecto.Changeset.t(Lightning.Run.t())}
Link to this function

complete_step(params, options \\ Lightning.Runs.RunOptions)

View Source
@spec complete_step(map(), Lightning.Runs.RunOptions) ::
  {:ok, Lightning.Invocation.Step.t()} | {:error, Ecto.Changeset.t()}

Enqueue a run to be processed.

@spec get(Ecto.UUID.t(), [{:include, term()}]) :: Lightning.Run.t() | nil

Get a run by id.

Optionally preload associations by passing a list of atoms to :include.

Lightning.Runs.get(id, include: [:workflow])

Returns only the dataclip body as a string

Link to this function

get_dataclip_request(run)

View Source

Returns only the dataclip request as a string

@spec get_for_worker(Ecto.UUID.t()) :: Lightning.Run.t() | nil

Get a run by id, preloading the snapshot and its credential.

@spec get_input(Lightning.Run.t()) :: String.t() | nil

Returns a run's dataclip formatted for use as state.

Only http_request and kafka dataclips are changed, their body is nested inside a "data" key and request data is added as a "request" key.

See LightingWeb.RunChannel.handlein("fetch:dataclip", , _) for more details.

Link to this function

get_log_lines(run, order \\ :asc)

View Source
Link to this function

get_project_id_for_run(run)

View Source
@spec get_project_id_for_run(Lightning.Run.t()) :: Ecto.UUID.t() | nil
@spec mark_run_lost(Lightning.Run.t()) :: {:ok, any()} | {:error, any()}
Link to this function

mark_steps_lost(steps_query)

View Source
@spec mark_steps_lost(Ecto.Queryable.t()) :: {:ok, non_neg_integer()}
Link to this function

start_run(run, params \\ %{})

View Source
@spec start_step(Lightning.Run.t(), map()) ::
  {:ok, Lightning.Invocation.Step.t()} | {:error, Ecto.Changeset.t()}

Creates a Step for a given run and job.

The Step is created and marked as started at the current time.

See Lightning.Runs.Events.subscribe/1.

@spec update_run(Ecto.Changeset.t(Lightning.Run.t())) ::
  {:ok, Lightning.Run.t()} | {:error, Ecto.Changeset.t(Lightning.Run.t())}
Link to this function

update_runs(update_query, updates)

View Source
@spec wipe_dataclips(Lightning.Run.t()) :: :ok

Clears the body and request fields of the dataclip associated with the given run.