SaltDns.Zones.Plan (Salt v1.0.0)

Applies a list of rrset operations to an in-memory view of a zone.

The state is a map of {name, type} to rrset (the shape of SaltDns.Zones.Validate). Operations are applied in order against the running state, so a later operation sees the effect of an earlier one, and the result is all or nothing: any error leaves the caller with the original state and a list of errors whose paths start with the operation's index.

Operations:

  • {:put, attrs} - replace or create the rrset described by attrs
  • {:delete, name, type} - remove an rrset

Summary

Functions

Applies ops to state; see the module documentation.

Types

op()

@type op() :: {:put, map()} | {:delete, String.t(), String.t()}

state()

@type state() :: %{
  required({String.t(), String.t()}) => SaltDns.Zones.Validate.rrset()
}

Functions

apply_ops(zone, state, ops, opts \\ [])

@spec apply_ops(String.t(), state(), [op()], keyword()) ::
  {:ok, state()} | {:error, [SaltDns.Zones.Error.t()]}

Applies ops to state; see the module documentation.