Railyard v0.1.0 Railyard.Resource View Source
You probably don't want to use this directly. The Railyard
module creates and
terminates resources processes on demand, depending on the specs that are given to it.
Go look at the Railyard
module first, and if you're still curious how this works,
come back here.
Railyard.Resource defines the GenServer which will be responsible for supervising
a specific instance of a resource. A Railyard.Resource
requires a
Railyard.ResourceSpec
to define its behavior.
Starting a resource does not necessarily perform an action. Resources can either
be started when none existed, or a resource can be started on top of an existing
resource, such as running mix railyard
to provision cloud infrastructure.
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor.
Delete this resource from the running infrastructure.
Ship this resource to the running infrastructure.
Link to this section Functions
child_spec(init_arg) View Source
Returns a specification to start this module under a supervisor.
See Supervisor
.
delete(pid) View Source
Delete this resource from the running infrastructure.
In general, this will deprovision, delete, remove, or otherwise destroy the resource. This should be considered a permanent and unrecoverable action.
If the provider returns :ok, then the GenServer will be shut down as well. If not, the genserver will stay alive, and the return value (assumed to be an error) will be returned to the caller.
eval_property(struct, prop, bindings) View Source
ship(pid, bindings) View Source
Ship this resource to the running infrastructure.
In general, this will cause resources to be provisioned if they don't exist, or brought into compliance with the current resource spec and parameter bindings if it does.
The specific behavior of "shipping" a resource depends on the type of resource.
See Railyard.Provider
for provider details.