Revision dc623a95

b/htools/Ganeti/Rpc.hs
47 47
  , RpcCallInstanceList(..)
48 48
  , RpcResultInstanceList(..)
49 49

  
50
  , HvInfo(..)
51
  , VgInfo(..)
52
  , RpcCallNodeInfo(..)
53
  , RpcResultNodeInfo(..)
54

  
50 55
  , rpcTimeoutFromRaw -- FIXME: Not used anywhere
51 56
  ) where
52 57

  
......
248 253
instance RpcResult RpcResultInstanceList
249 254

  
250 255
instance Rpc RpcCallInstanceList RpcResultInstanceList
256

  
257
-- | NodeInfo
258
-- Return node information.
259
$(buildObject "RpcCallNodeInfo" "rpcCallNodeInfo" $
260
  [ simpleField "hypervisors" [t| [Hypervisor] |]
261
  , simpleField "volume_groups" [t| [String] |]
262
  ])
263

  
264
$(buildObject "VgInfo" "vgInfo" $
265
  [ simpleField "name" [t| String |]
266
  , simpleField "free" [t| Int |]
267
  , simpleField "size" [t| Int |]
268
  ])
269

  
270
-- | We only provide common fields as described in hv_base.py.
271
$(buildObject "HvInfo" "hvInfo" $
272
  [ simpleField "memory_total" [t| Int |]
273
  , simpleField "memory_free" [t| Int |]
274
  , simpleField "memory_dom0" [t| Int |]
275
  , simpleField "cpu_total" [t| Int |]
276
  , simpleField "cpu_nodes" [t| Int |]
277
  , simpleField "cpu_sockets" [t| Int |]
278
  ])
279

  
280
$(buildObject "RpcResultNodeInfo" "rpcResNodeInfo" $
281
  [ simpleField "boot_id" [t| String |]
282
  , simpleField "vg_info" [t| [VgInfo] |]
283
  , simpleField "hv_info" [t| [HvInfo] |]
284
  ])
285

  
286
instance RpcCall RpcCallNodeInfo where
287
  rpcCallName _ = "node_info"
288
  rpcCallTimeout _ = rpcTimeoutToRaw Urgent
289
  rpcCallAcceptOffline _ = False
290

  
291
instance RpcResult RpcResultNodeInfo
292

  
293
instance Rpc RpcCallNodeInfo RpcResultNodeInfo

Also available in: Unified diff