Safe Haskell | Safe-Infered |
---|
Parser for the output of the xm list --long
command of Xen
- lispConfigParser :: Parser LispConfig
- findConf :: String -> [LispConfig] -> Result LispConfig
- getValue :: FromLispConfig a => String -> [LispConfig] -> Result a
- extractValues :: LispConfig -> Result [LispConfig]
- isNamed :: String -> LispConfig -> Bool
- parseState :: String -> ActualState
- getDomainConfig :: LispConfig -> Result Domain
- xmListParser :: Parser (Map String Domain)
- xmUptimeParser :: Parser (Map Int UptimeInfo)
- uptimeLineParser :: Parser UptimeInfo
Documentation
lispConfigParser :: Parser LispConfigSource
A parser for parsing generic config files written in the (LISP-like)
format that is the output of the xm list --long
command.
This parser only takes care of the syntactic parse, but does not care
about the semantics.
Note: parsing the double requires checking for the next character in order
to prevent string like 9a to be recognized as the number 9.
findConf :: String -> [LispConfig] -> Result LispConfigSource
getValue :: FromLispConfig a => String -> [LispConfig] -> Result aSource
isNamed :: String -> LispConfig -> BoolSource
parseState :: String -> ActualStateSource
xmListParser :: Parser (Map String Domain)Source
A parser for parsing the output of the xm list --long
command.
It adds the semantic layer on top of lispConfigParser.
It returns a map of domains, with their name as the key.
FIXME: This is efficient under the assumption that only a few fields of the
domain configuration are actually needed. If many of them are required, a
parser able to directly extract the domain config would actually be better.
xmUptimeParser :: Parser (Map Int UptimeInfo)Source
A parser for parsing the output of the xm uptime
command.
uptimeLineParser :: Parser UptimeInfoSource
A helper for parsing a single line of the xm uptime
output.