Revision c14ba680 src/Ganeti/Rpc.hs
b/src/Ganeti/Rpc.hs | ||
---|---|---|
81 | 81 |
|
82 | 82 |
import Ganeti.BasicTypes |
83 | 83 |
import qualified Ganeti.Constants as C |
84 |
import Ganeti.JSON |
|
84 | 85 |
import Ganeti.Logging |
85 | 86 |
import Ganeti.Objects |
86 | 87 |
import Ganeti.THH |
... | ... | |
289 | 290 |
-- | AllInstancesInfo |
290 | 291 |
-- Returns information about all running instances on the given nodes |
291 | 292 |
$(buildObject "RpcCallAllInstancesInfo" "rpcCallAllInstInfo" |
292 |
[ simpleField "hypervisors" [t| [Hypervisor] |] ])
|
|
293 |
[ simpleField "hypervisors" [t| [(Hypervisor, HvParams)] |] ])
|
|
293 | 294 |
|
294 | 295 |
$(buildObject "RpcResultAllInstancesInfo" "rpcResAllInstInfo" |
295 | 296 |
[ simpleField "instances" [t| [(String, InstanceInfo)] |] ]) |
... | ... | |
298 | 299 |
rpcCallName _ = "all_instances_info" |
299 | 300 |
rpcCallTimeout _ = rpcTimeoutToRaw Urgent |
300 | 301 |
rpcCallAcceptOffline _ = False |
301 |
rpcCallData _ call = J.encode [rpcCallAllInstInfoHypervisors call] |
|
302 |
rpcCallData _ call = J.encode ( |
|
303 |
map fst $ rpcCallAllInstInfoHypervisors call, |
|
304 |
GenericContainer . Map.fromList $ rpcCallAllInstInfoHypervisors call) |
|
302 | 305 |
|
303 | 306 |
instance Rpc RpcCallAllInstancesInfo RpcResultAllInstancesInfo where |
304 | 307 |
-- FIXME: Is there a simpler way to do it? |
Also available in: Unified diff