Safe Haskell | Safe |
---|
Ganeti.Hypervisor.Xen.XmParser
Description
Parser for the output of the xm list --long
command of Xen
Synopsis
- lispConfigParser :: Parser LispConfig
- xmListParser :: Parser (Map String Domain)
- xmUptimeParser :: Parser (Map Int UptimeInfo)
- uptimeLineParser :: Parser UptimeInfo
Documentation
lispConfigParser :: Parser LispConfig Source #
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.
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 UptimeInfo Source #
A helper for parsing a single line of the xm uptime
output.