Commit 4e84ca27 authored by Iustin Pop's avatar Iustin Pop
Browse files

htools: add parsing of input node-evac messages



This is a lot of duplication with modeMreloc, which will get sorted
out once we convert mreloc to change-group.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent 3667467d
......@@ -192,6 +192,19 @@ parseData body = do
| otherwise -> Bad $ "Invalid relocate mode " ++ s
Bad x -> Bad x
return $ MultiReloc rl_idx rl_mode
| optype == C.iallocatorModeNodeEvac ->
do
rl_names <- extrReq "instances"
rl_insts <- mapM (Container.findByName map_i) rl_names
let rl_idx = map Instance.idx rl_insts
rl_mode <-
case extrReq "evac_mode" of
Ok s | s == C.iallocatorNevacAll -> return ChangeAll
| s == C.iallocatorNevacPri -> return ChangePrimary
| s == C.iallocatorNevacSec -> return ChangeSecondary
| otherwise -> Bad $ "Invalid evacuate mode " ++ s
Bad x -> Bad x
return $ NodeEvacuate rl_idx rl_mode
| otherwise -> fail ("Invalid request type '" ++ optype ++ "'")
return $ Request rqtype cdata
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment