View Source Lightning.SetupUtils (Lightning v2.10.4)
SetupUtils encapsulates logic for setting up initial data for various sites.
Summary
Functions
Creates initial data and returns the created records.
In some (mostly remote-controlled) deployments, it's necessary to create a
user, and apiToken, and multiple credentials (owned by the user) so that later
openfn deploy
calls can make use of these artifacts.
Functions
@spec setup_demo(nil | maybe_improper_list() | map()) :: %{ jobs: [...], projects: [atom() | %{:id => any(), optional(any()) => any()}, ...], users: [atom() | %{:id => any(), optional(any()) => any()}, ...], workflows: [atom() | %{:id => any(), optional(any()) => any()}, ...], workorders: [atom() | %{:id => any(), optional(any()) => any()}, ...] }
Creates initial data and returns the created records.
In some (mostly remote-controlled) deployments, it's necessary to create a
user, and apiToken, and multiple credentials (owned by the user) so that later
openfn deploy
calls can make use of these artifacts.
When run before openfn deploy
, this function makes it possible to set up
an entire lightning instance with a working project (including secrets)
without using the web UI.
Examples
iex> setup_user(%{email: "td@openfn.org", first_name: "taylor", last_name: "downs", password: "shh12345!"}, "secretToken", [%{name: "openmrs", schema: "raw", body: %{"a" => "secret"}}, %{ name: "dhis2", schema: "raw", body: %{"b" => "safe"}}]) :ok