Revision ae960018

b/src/Ganeti/Query/Network.hs
31 31
import qualified Data.Map as Map
32 32

  
33 33
import Ganeti.Config
34
import Ganeti.Network
34 35
import Ganeti.Objects
35 36
import Ganeti.Query.Language
36 37
import Ganeti.Query.Common
......
54 55
     FieldSimple (rsMaybeUnavail . networkMacPrefix), QffNormal)
55 56
  , (FieldDefinition "network_type" "NetworkType" QFTOther "Network type",
56 57
     FieldSimple (rsMaybeUnavail . networkNetworkType), QffNormal)
58
  , (FieldDefinition "free_count" "FreeCount" QFTOther "Number of free IPs",
59
     FieldSimple (rsMaybeNoData . fmap getFreeCount . createAddressPool),
60
     QffNormal)
61
  , (FieldDefinition "map" "Map" QFTText "Map of the network's reserved IPs",
62
     FieldSimple (rsMaybeNoData . fmap getMap . createAddressPool),
63
     QffNormal)
64
  , (FieldDefinition "reserved_count" "ReservedCount" QFTOther
65
       "Number of reserved IPs",
66
     FieldSimple (rsMaybeNoData . fmap getReservedCount . createAddressPool),
67
     QffNormal)
57 68
  , (FieldDefinition "group_list" "GroupList" QFTOther "List of node groups",
58 69
     FieldConfig (\cfg -> rsNormal . getGroupConnections cfg . networkUuid),
59
       QffNormal)
70
     QffNormal)
71
  , (FieldDefinition "group_cnt" "GroupCount" QFTOther "Number of node groups",
72
     FieldConfig (\cfg -> rsNormal . length . getGroupConnections cfg
73
       . networkUuid), QffNormal)
60 74
  ] ++
61 75
  uuidFields "Network" ++
62 76
  serialFields "Network" ++
......
68 82
  Map.fromList $ map (\v@(f, _, _) -> (fdefName f, v)) networkFields
69 83

  
70 84
-- TODO: the following fields are not implemented yet: external_reservations,
71
-- free_count, group_cnt, inst_cnt, inst_list, map, reserved_count, serial_no,
72
-- tags, uuid
85
-- inst_cnt, inst_list

Also available in: Unified diff