Safe Haskell | None |
---|
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.
- data MemoryState = MemoryState {
- msJobs :: [JobId]
- msEvacuated :: [String]
- msIncidents :: [Incident]
- msJobsL :: Lens' MemoryState [JobId]
- msIncidentsL :: Lens' MemoryState [Incident]
- msEvacuatedL :: Lens' MemoryState [String]
- emptyMemoryState :: MemoryState
- getJobs :: IORef MemoryState -> ResultT String IO [JobId]
- clearJobs :: IORef MemoryState -> IO ()
- appendJobs :: IORef MemoryState -> [JobId] -> IO ()
- getEvacuated :: IORef MemoryState -> ResultT String IO [String]
- addEvacuated :: IORef MemoryState -> [String] -> IO ()
- rmEvacuated :: IORef MemoryState -> String -> IO ()
- getIncidents :: IORef MemoryState -> ResultT String IO [Incident]
- updateIncident :: IORef MemoryState -> Incident -> IO ()
- rmIncident :: IORef MemoryState -> String -> IO ()
Documentation
data MemoryState Source
In-memory copy of parts of the state of the maintenance daemon.
MemoryState | |
|
msJobsL :: Lens' MemoryState [JobId]Source
msIncidentsL :: Lens' MemoryState [Incident]Source
msEvacuatedL :: Lens' MemoryState [String]Source
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.