ReqManagedAgents.Provisioner (ReqManagedAgents v0.9.0)

Copy Markdown View Source

Hash-keyed provision cache. ensure/3 returns a cached provider handle for a given {provider, spec}, calling provider.provision/2 only on a miss. The handle is the durable artifact; where the {hash → handle} mapping lives is pluggable via the ReqManagedAgents.Provisioner.Store behaviour (:store option) — in-process ETS by default, or a persistent store (e.g. Store.File) for reuse across OS processes.

Summary

Functions

ensure(provider, spec, opts \\ [])

@spec ensure(module(), ReqManagedAgents.Provider.spec(), keyword()) ::
  {:ok, ReqManagedAgents.Provider.handle()} | {:error, term()}

ensure_agent(client, agent_spec, opts \\ [])

See ReqManagedAgents.Provisioner.Agents.ensure_agent/3.

ensure_environment(client, env_spec, opts \\ [])

See ReqManagedAgents.Provisioner.Environments.ensure_environment/3.

evict(handle, opts \\ [])

@spec evict(
  ReqManagedAgents.Provider.handle(),
  keyword()
) :: :ok

Drop any cache entry whose value is handle (called after teardown). With a persistent store (e.g. Store.File) the handle must be JSON-encodable — same constraint as ensure/3's store writes; non-encodable values raise.

prune_agents(client, base, opts \\ [])

See ReqManagedAgents.Provisioner.Agents.prune_agents/3.

prune_environments(client, base, opts \\ [])

See ReqManagedAgents.Provisioner.Environments.prune_environments/3.

resolve(ref, opts \\ [])

See ReqManagedAgents.Provisioner.Environments.resolve/2.

resolve_agent(ref, opts \\ [])

See ReqManagedAgents.Provisioner.Agents.resolve_agent/2.

tag(base, tag, digest_or_handle, opts \\ [])

See ReqManagedAgents.Provisioner.Environments.tag/4.

tag_agent(base, tag, digest_or_handle, opts \\ [])

See ReqManagedAgents.Provisioner.Agents.tag_agent/4.