Clary¶
This high-level pack is intended to be used as the interface with the clary life-cycle manager. It contains actions and sensors that implement such an interface.
This pack requires some configuration, don’t forget to launch st2 pack config
.
Actions¶
- clary.node.comment
Add a logbook comment for given nodes.
hosts
andcomment
parameters are requiredThe
user
parameter is required but defaults toST2
.The
impacting
parameter is required but defaults tofalse
Optionnaly, you can modify this action concurrency by defining the number of HTTP queries to do in parallel with the
concurrency
parameter.- clary.status.next
Retrieve the next authorized statuses than can be reached from the given state.
state
is the only required parameter.- clary.node.status.get
Get the given node status.
The
host
parameter is required.- clary.node.status.set
Set the state for the given nodes.
May fail this the transition from the current state to the given state is forbiden.
The
hosts
,status
andcomment
parameters are required.The
impacting
parameter is required but defaults tofalse
The
user
parameter is required byt defaults toST2
The
concurency
defines the number of API call to do in parallel. Defaults to 4.- clary.node.status.ensure
Ensure that the state for the given nodes is the one given.
This may use intermediate states if some state transition is forbiden.
The
hosts
,status
andcomment
parameters are required.The
impacting
parameter is required but defaults tofalse
The
user
parameter is required byt defaults toST2
The
concurency
defines the number of API call to do in parallel. Defaults to 4.
Sensor¶
clary.ClaryPollingSensor¶
This pack contains a sensor that integrates StackStorm to the Clary life-cycle manager. This sensor is of polling type and uses Clary’s REST API without any configuration required.
This sensor uses the api/events
that lists the event (state transitions) received by Clary.
On first launch, the sensor retrieve the last event ID using bisection (no API call can give this information) and stores it in StackStorm’s keystore (clary.last_event
).
Then, when polling, the sensor tries to get the next events (Using clary.last_event
value) and emits trigger according to the event content.
Only the clary.node.state trigger is emitted and trigger’s payload contains the equipment name (hostname
), and the node’s status (status
) and a transition comment (reason
).