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
@spec complete_run(Lightning.Run.t(), %{optional(any()) => any()}) :: {:ok, Lightning.Run.t()} | {:error, Ecto.Changeset.t(Lightning.Run.t())}
@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
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.
@spec get_project_id_for_run(Lightning.Run.t()) :: Ecto.UUID.t() | nil
@spec mark_run_lost(Lightning.Run.t()) :: {:ok, any()} | {:error, any()}
@spec mark_steps_lost(Ecto.Queryable.t()) :: {:ok, non_neg_integer()}
@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.
@spec update_run(Ecto.Changeset.t(Lightning.Run.t())) :: {:ok, Lightning.Run.t()} | {:error, Ecto.Changeset.t(Lightning.Run.t())}
@spec wipe_dataclips(Lightning.Run.t()) :: :ok
Clears the body and request fields of the dataclip associated with the given run.