Commit c1c5aab1 authored by Agata Murawska's avatar Agata Murawska
Browse files

Implementation of InstanceList call and result



instance_list call takes a list of hypervisors and returns a list
of running instances.
Signed-off-by: default avatarAgata Murawska <agatamurawska@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 96dad12d
......@@ -44,6 +44,9 @@ module Ganeti.Rpc
, RpcCallAllInstancesInfo(..)
, RpcResultAllInstancesInfo(..)
, RpcCallInstanceList(..)
, RpcResultInstanceList(..)
, rpcTimeoutFromRaw -- FIXME: Not used anywhere
) where
......@@ -226,3 +229,22 @@ instance RpcCall RpcCallAllInstancesInfo where
instance RpcResult RpcResultAllInstancesInfo
instance Rpc RpcCallAllInstancesInfo RpcResultAllInstancesInfo
-- | InstanceList
-- Returns the list of running instances on the given nodes.
$(buildObject "RpcCallInstanceList" "rpcCallInstList" $
[ simpleField "hypervisors" [t| [Hypervisor] |] ])
$(buildObject "RpcResultInstanceList" "rpcResInstList" $
[ simpleField "node" [t| Node |]
, simpleField "instances" [t| [String] |]
])
instance RpcCall RpcCallInstanceList where
rpcCallName _ = "instance_list"
rpcCallTimeout _ = rpcTimeoutToRaw Urgent
rpcCallAcceptOffline _ = False
instance RpcResult RpcResultInstanceList
instance Rpc RpcCallInstanceList RpcResultInstanceList
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