pallet.core.primitives documentation

Base operation primitives for pallet.

async-fsm

fn

[f]

Returns a FSM specification for running the specified function in a future. Assumes failures in the underlying function cause an exception to be thrown, and that the function takes no arguments.

bootstrapped-meta

var

Executes on bootstrapped nodes, with admin user credentials.

build-and-execute-phase

fn

[service-state plan-state environment phase targets execution-settings-f]

Build and execute the specified phase.

target-type : specifies the type of target to run the phase on, :group, :group-nodes, or :group-node-list.

create-group-nodes

fn

[compute-service environment group-counts]

Create nodes for groups.

create-nodes

fn

[compute-service environment group count]

Create count nodes for a group.

default-phase-meta

var

The bootstrap phase is executed with the image credentials, and only not flagged with a :bootstrapped keyword.

execute-action-plan

fn

[service-state plan-state environment execution-settings-f {:keys [action-plan phase target-type target], :as action-plan-map}]

Executes an action-plan on the specified node.

execute-action-plans

fn

[service-state plan-state environment execution-settings-f action-plans]

Execute action-plans, a sequence of action-plan maps. execution-settings-f is a function of target, that returns a map with :user, :executor and :executor-status-fn keys.

execute-and-flag

fn

[state-flag execute-f]
[state-flag]

Return a phase execution function, that will execute a phase on nodes that don't have the specified state flag set. On successful completion the nodes have the state flag set.

execute-on-filtered

fn

[filter-f execute-f]

Return a phase execution function, that will execute a phase on nodes that have the specified state flag set.

execute-on-flagged

fn

[state-flag execute-f]
[state-flag]

Return a phase execution function, that will execute a phase on nodes that have the specified state flag set.

execute-on-unflagged

fn

[state-flag execute-f]
[state-flag]

Return a phase execution function, that will execute a phase on nodes that have the specified state flag set.

phase-errors

fn

[operation]

Return the phase errors for an operation

phases-with-meta

fn

[phases-map phases-meta]

Takes a phases-map and applies the default phase metadata and the phases-meta to the phases in it.

remove-group-nodes

fn

[compute-service group-nodes]

Removes nodes from groups. group-nodes is a map from group to a sequence of nodes

remove-nodes

fn

[compute-service group {:keys [nodes all], :as remove-node-map}]

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

service-state

fn

[compute groups]

Define an operation that builds a representation of the available nodes.

set-state-for-node

fn

[state-name node]

Sets the boolean state-name flag on node.

set-state-for-nodes

fn

[state-name nodes]

Sets the boolean state-name flag on nodes.

successful-result?

fn

[result]

Filters target-results, a map from target to result map, for successful results.

throw-operation-exception

fn

[operation]

If the result has a logged exception, throw it. This will block on the operation being complete or failed.

unbootstrapped-meta

var

Executes on non bootstrapped nodes, with image credentials.