View Source Lightning.Jobs (Lightning v2.10.4)

The Jobs context.

Summary

Functions

Returns an %Ecto.Changeset{} for tracking job changes.

Returns the list of downstream jobs for a given job, optionally matching a specific trigger type. When downstream_jobs_for is called without a trigger that means its between jobs when it called with a trigger that means we are starting from outside the pipeline

Gets a single job.

Returns the list of jobs excluding the one given.

Returns the list of jobs.

Updates a job.

Functions

Link to this function

change_job(job, attrs \\ %{})

View Source

Returns an %Ecto.Changeset{} for tracking job changes.

Examples

iex> change_job(job)
%Ecto.Changeset{data: %Job{}}
Link to this function

create_job(attrs \\ %{}, actor)

View Source

Creates a job.

Examples

iex> create_job(%{field: value})
{:ok, %Job{}}

iex> create_job(%{field: bad_value})
{:error, %Ecto.Changeset{}}
Link to this function

get_downstream_jobs_for(job, edge_condition \\ nil)

View Source

Returns the list of downstream jobs for a given job, optionally matching a specific trigger type. When downstream_jobs_for is called without a trigger that means its between jobs when it called with a trigger that means we are starting from outside the pipeline

Gets a single job.

Raises Ecto.NoResultsError if the Job does not exist.

Examples

iex> get_job!(123)
%Job{}

iex> get_job!(456)
** (Ecto.NoResultsError)
Link to this function

get_job_with_credential(id)

View Source
Link to this function

get_upstream_jobs_for(map)

View Source
@spec get_upstream_jobs_for(Lightning.Workflows.Job.t()) :: [
  Lightning.Workflows.Job.t()
]

Returns the list of jobs excluding the one given.

Link to this function

jobs_for_project(project)

View Source
@spec jobs_for_project(Lightning.Projects.Project.t()) :: [
  Lightning.Workflows.Job.t()
]
Link to this function

jobs_for_project_query(project)

View Source
@spec jobs_for_project_query(Lightning.Projects.Project.t()) :: Ecto.Queryable.t()

Returns the list of jobs.

Link to this function

list_jobs_for_workflow(workflow)

View Source
@spec list_jobs_for_workflow(Lightning.Workflows.Workflow.t()) ::
  [Lightning.Workflows.Job.t(), ...] | []

Updates a job.

Examples

iex> update_job(job, %{field: new_value})
{:ok, %Job{}}

iex> update_job(job, %{field: bad_value})
{:error, %Ecto.Changeset{}}