Revision cdac0552 src/Ganeti/HsConstants.hs
b/src/Ganeti/HsConstants.hs | ||
---|---|---|
36 | 36 |
-} |
37 | 37 |
module Ganeti.HsConstants where |
38 | 38 |
|
39 |
import Data.List ((\\)) |
|
39 | 40 |
import Data.Map (Map) |
40 | 41 |
import qualified Data.Map as Map (fromList) |
41 | 42 |
|
... | ... | |
49 | 50 |
import qualified Ganeti.Runtime as Runtime |
50 | 51 |
import Ganeti.Types |
51 | 52 |
import qualified Ganeti.Types as Types |
53 |
import Ganeti.Confd.Types (ConfdRequestType(..), ConfdReqField(..), |
|
54 |
ConfdReplyStatus(..), ConfdNodeRole(..), |
|
55 |
ConfdErrorType(..)) |
|
56 |
import qualified Ganeti.Confd.Types as Types |
|
52 | 57 |
|
53 | 58 |
-- * 'autoconf' constants for Python only ('autotools/build-bash-completion') |
54 | 59 |
|
... | ... | |
154 | 159 |
protocolVersion = buildVersion configMajor configMinor configRevision |
155 | 160 |
|
156 | 161 |
-- * User separation |
162 |
|
|
157 | 163 |
daemonsGroup :: String |
158 | 164 |
daemonsGroup = Runtime.daemonGroup (ExtraGroup DaemonsGroup) |
159 | 165 |
|
... | ... | |
1225 | 1231 |
elogJqueueTest :: String |
1226 | 1232 |
elogJqueueTest = Types.eLogTypeToRaw ELogJqueueTest |
1227 | 1233 |
|
1234 |
-- * Confd |
|
1235 |
|
|
1236 |
confdProtocolVersion :: Int |
|
1237 |
confdProtocolVersion = ConstantUtils.confdProtocolVersion |
|
1238 |
|
|
1239 |
-- Confd request type |
|
1240 |
|
|
1241 |
confdReqPing :: Int |
|
1242 |
confdReqPing = Types.confdRequestTypeToRaw ReqPing |
|
1243 |
|
|
1244 |
confdReqNodeRoleByname :: Int |
|
1245 |
confdReqNodeRoleByname = Types.confdRequestTypeToRaw ReqNodeRoleByName |
|
1246 |
|
|
1247 |
confdReqNodePipByInstanceIp :: Int |
|
1248 |
confdReqNodePipByInstanceIp = Types.confdRequestTypeToRaw ReqNodePipByInstPip |
|
1249 |
|
|
1250 |
confdReqClusterMaster :: Int |
|
1251 |
confdReqClusterMaster = Types.confdRequestTypeToRaw ReqClusterMaster |
|
1252 |
|
|
1253 |
confdReqNodePipList :: Int |
|
1254 |
confdReqNodePipList = Types.confdRequestTypeToRaw ReqNodePipList |
|
1255 |
|
|
1256 |
confdReqMcPipList :: Int |
|
1257 |
confdReqMcPipList = Types.confdRequestTypeToRaw ReqMcPipList |
|
1258 |
|
|
1259 |
confdReqInstancesIpsList :: Int |
|
1260 |
confdReqInstancesIpsList = Types.confdRequestTypeToRaw ReqInstIpsList |
|
1261 |
|
|
1262 |
confdReqNodeDrbd :: Int |
|
1263 |
confdReqNodeDrbd = Types.confdRequestTypeToRaw ReqNodeDrbd |
|
1264 |
|
|
1265 |
confdReqNodeInstances :: Int |
|
1266 |
confdReqNodeInstances = Types.confdRequestTypeToRaw ReqNodeInstances |
|
1267 |
|
|
1268 |
confdReqs :: FrozenSet Int |
|
1269 |
confdReqs = |
|
1270 |
ConstantUtils.mkSet . |
|
1271 |
map Types.confdRequestTypeToRaw $ |
|
1272 |
[minBound..] \\ [ReqNodeInstances] |
|
1273 |
|
|
1274 |
-- * Confd request type |
|
1275 |
|
|
1276 |
confdReqfieldName :: Int |
|
1277 |
confdReqfieldName = Types.confdReqFieldToRaw ReqFieldName |
|
1278 |
|
|
1279 |
confdReqfieldIp :: Int |
|
1280 |
confdReqfieldIp = Types.confdReqFieldToRaw ReqFieldIp |
|
1281 |
|
|
1282 |
confdReqfieldMnodePip :: Int |
|
1283 |
confdReqfieldMnodePip = Types.confdReqFieldToRaw ReqFieldMNodePip |
|
1284 |
|
|
1285 |
-- * Confd repl status |
|
1286 |
|
|
1287 |
confdReplStatusOk :: Int |
|
1288 |
confdReplStatusOk = Types.confdReplyStatusToRaw ReplyStatusOk |
|
1289 |
|
|
1290 |
confdReplStatusError :: Int |
|
1291 |
confdReplStatusError = Types.confdReplyStatusToRaw ReplyStatusError |
|
1292 |
|
|
1293 |
confdReplStatusNotimplemented :: Int |
|
1294 |
confdReplStatusNotimplemented = Types.confdReplyStatusToRaw ReplyStatusNotImpl |
|
1295 |
|
|
1296 |
confdReplStatuses :: FrozenSet Int |
|
1297 |
confdReplStatuses = |
|
1298 |
ConstantUtils.mkSet $ map Types.confdReplyStatusToRaw [minBound..] |
|
1299 |
|
|
1300 |
-- * Confd node role |
|
1301 |
|
|
1302 |
confdNodeRoleMaster :: Int |
|
1303 |
confdNodeRoleMaster = Types.confdNodeRoleToRaw NodeRoleMaster |
|
1304 |
|
|
1305 |
confdNodeRoleCandidate :: Int |
|
1306 |
confdNodeRoleCandidate = Types.confdNodeRoleToRaw NodeRoleCandidate |
|
1307 |
|
|
1308 |
confdNodeRoleOffline :: Int |
|
1309 |
confdNodeRoleOffline = Types.confdNodeRoleToRaw NodeRoleOffline |
|
1310 |
|
|
1311 |
confdNodeRoleDrained :: Int |
|
1312 |
confdNodeRoleDrained = Types.confdNodeRoleToRaw NodeRoleDrained |
|
1313 |
|
|
1314 |
confdNodeRoleRegular :: Int |
|
1315 |
confdNodeRoleRegular = Types.confdNodeRoleToRaw NodeRoleRegular |
|
1316 |
|
|
1228 | 1317 |
-- * A few common errors for confd |
1229 | 1318 |
|
1230 |
confdErrorArgument :: Int
|
|
1231 |
confdErrorArgument = 3
|
|
1319 |
confdErrorUnknownEntry :: Int
|
|
1320 |
confdErrorUnknownEntry = Types.confdErrorTypeToRaw ConfdErrorUnknownEntry
|
|
1232 | 1321 |
|
1233 | 1322 |
confdErrorInternal :: Int |
1234 |
confdErrorInternal = 2
|
|
1323 |
confdErrorInternal = Types.confdErrorTypeToRaw ConfdErrorInternal
|
|
1235 | 1324 |
|
1236 |
confdErrorUnknownEntry :: Int
|
|
1237 |
confdErrorUnknownEntry = 1
|
|
1325 |
confdErrorArgument :: Int
|
|
1326 |
confdErrorArgument = Types.confdErrorTypeToRaw ConfdErrorArgument
|
|
1238 | 1327 |
|
1239 |
-- Confd request query fields |
|
1328 |
-- * Confd request query fields
|
|
1240 | 1329 |
|
1241 | 1330 |
confdReqqLink :: String |
1242 | 1331 |
confdReqqLink = ConstantUtils.confdReqqLink |
Also available in: Unified diff