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.
hostsandcommentparameters are requiredThe
userparameter is required but defaults toST2.The
impactingparameter is required but defaults tofalseOptionnaly, you can modify this action concurrency by defining the number of HTTP queries to do in parallel with the
concurrencyparameter.- clary.status.next
Retrieve the next authorized statuses than can be reached from the given state.
stateis the only required parameter.- clary.node.status.get
Get the given node status.
The
hostparameter 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,statusandcommentparameters are required.The
impactingparameter is required but defaults tofalseThe
userparameter is required byt defaults toST2The
concurencydefines 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,statusandcommentparameters are required.The
impactingparameter is required but defaults tofalseThe
userparameter is required byt defaults toST2The
concurencydefines 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).