pallet.core.api documentation

Base level API for pallet

action-plan

fn

[service-state environment plan-fn args target-map]

Build the action plan for the specified plan-fn on the given node, within the context of the service-state. The plan-state contains all the settings, etc, for all groups. target-map is a map for the session describing the target.

create-nodes

fn

[compute-service environment group count]

Create count nodes for a group.

environment-execution-settings

fn

[]

Returns execution settings based purely on the environment

environment-image-execution-settings

fn

[]

Returns execution settings based on the environment and the image user.

execute-action-plan

var

Execute the action-plan on the target.

execute-action-plan*

fn

[session executor execute-status-fn {:keys [action-plan phase target-type target]}]

Execute the action-plan on the target.

group-delta

fn

[targets group]

Calculate actual and required counts for a group

group-deltas

fn

[targets groups]

Calculate actual and required counts for a sequence of groups. Returns a map from group to a map with :actual and :target counts.

groups-to-create

fn

[group-deltas]

Return a sequence of groups that currently have no nodes, but will have nodes added.

groups-to-remove

fn

[group-deltas]

Return a sequence of groups that have nodes, but will have all nodes removed.

has-state-flag?

fn

[state-name]

Return a predicate to test for a state-flag having been set.

nodes-to-add

fn

[group-deltas]

Finds the specified number of nodes to be added to the given groups. Returns a map from group to a count of servers to add

nodes-to-remove

fn

[targets group-deltas]

Finds the specified number of nodes to be removed from the given groups. Nodes are selected at random. Returns a map from group to a map with :servers and :all, where :servers is a sequence of severs to remove, and :all is a boolean that is true if all nodes are being removed.

phase-error-exceptions

fn

[result]

Return a sequence of exceptions from phase errors for an operation.

phase-errors

fn

[result]

Return a sequence of phase errors for an operation. Each element in the sequence represents a failed action, and is a map, with :target, :error, :context and all the return value keys for the return value of the failed action.

remove-nodes

fn

[compute-service group {:keys [nodes all]}]

Removes nodes from group. If all is true, then all nodes for the group are being removed.

service-state

fn

[compute-service groups]

Query the available nodes in a compute-service, filtering for nodes in the specified groups. Returns a sequence that contains a node-map for each matching node.

set-state-for-node

fn

[state-name node]

Sets the boolean state-name flag on node.

target-action-plan

var

Build action plans for the specified phase on all nodes or groups in the given target, within the context of the service-state. The plan-state contains all the settings, etc, for all groups.

version

fn

[]

Returns the pallet version.