This is straightforward, as the call has no parameters and a very simple return 
type.

Signed-off-by: Iustin Pop <[email protected]>
---
 src/Ganeti/Rpc.hs | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/src/Ganeti/Rpc.hs b/src/Ganeti/Rpc.hs
index 3f86e3d..73d22ca 100644
--- a/src/Ganeti/Rpc.hs
+++ b/src/Ganeti/Rpc.hs
@@ -66,6 +66,9 @@ module Ganeti.Rpc
   , RpcCallTestDelay(..)
   , RpcResultTestDelay(..)
 
+  , RpcCallExportList(..)
+  , RpcResultExportList(..)
+
   , rpcTimeoutFromRaw -- FIXME: Not used anywhere
   ) where
 
@@ -440,7 +443,6 @@ instance Rpc RpcCallStorageList RpcResultStorageList where
 
 -- ** TestDelay
 
-
 -- | Call definition for test delay.
 $(buildObject "RpcCallTestDelay" "rpcCallTestDelay"
   [ simpleField "duration" [t| Double |]
@@ -464,3 +466,23 @@ instance RpcCall RpcCallTestDelay where
 
 instance Rpc RpcCallTestDelay RpcResultTestDelay where
   rpcResultFill _ res = fromJSValueToRes res id
+
+-- ** ExportList
+
+-- | Call definition for export list.
+
+$(buildObject "RpcCallExportList" "rpcCallExportList" [])
+
+-- | Result definition for export list.
+$(buildObject "RpcResultExportList" "rpcResExportList"
+  [ simpleField "exports" [t| [String] |]
+  ])
+
+instance RpcCall RpcCallExportList where
+  rpcCallName _          = "export_list"
+  rpcCallTimeout _       = rpcTimeoutToRaw Fast
+  rpcCallAcceptOffline _ = False
+  rpcCallData _          = J.encode
+
+instance Rpc RpcCallExportList RpcResultExportList where
+  rpcResultFill _ res = fromJSValueToRes res RpcResultExportList
-- 
1.8.1.3

Reply via email to