ganeti

Safe HaskellNone

Ganeti.MaintD.MemoryState

Description

Memory copy of the state of the maintenance daemon.

While the autoritative state of the maintenance daemon is stored in the configuration, the daemon keeps a copy of some values at run time, so that they can easily be exposed over HTTP.

This module also provides functions for the mirrored information to update both, the authoritative state and the in-memory copy.

Synopsis

Documentation

data MemoryState Source

In-memory copy of parts of the state of the maintenance daemon.

Constructors

MemoryState 

Fields

msJobs :: [JobId]
 
msEvacuated :: [String]
 
msIncidents :: [Incident]
 

emptyMemoryState :: MemoryStateSource

Inital state of the in-memory copy. All parts will be updated before use, after one round at the latest this copy is up to date.

getJobs :: IORef MemoryState -> ResultT String IO [JobId]Source

Get the list of jobs from the authoritative copy, and update the in-memory copy as well.

clearJobs :: IORef MemoryState -> IO ()Source

Reset the list of active jobs.

appendJobs :: IORef MemoryState -> [JobId] -> IO ()Source

Append jobs to the list of active jobs, if not present already

getEvacuated :: IORef MemoryState -> ResultT String IO [String]Source

Get the list of recently evacuated instances from the authoritative copy and update the in-memory state.

addEvacuated :: IORef MemoryState -> [String] -> IO ()Source

Add names to the list of recently evacuated instances.

rmEvacuated :: IORef MemoryState -> String -> IO ()Source

Remove a name from the list of recently evacuated instances.

getIncidents :: IORef MemoryState -> ResultT String IO [Incident]Source

Get the list of incidents fo the authoritative copy and update the in-memory state.

updateIncident :: IORef MemoryState -> Incident -> IO ()Source

Update an incident.

rmIncident :: IORef MemoryState -> String -> IO ()Source

Remove an incident.