Revision a957e150 htools/Ganeti/Objects.hs
b/htools/Ganeti/Objects.hs | ||
---|---|---|
53 | 53 |
, Node(..) |
54 | 54 |
, AllocPolicy(..) |
55 | 55 |
, NodeGroup(..) |
56 |
, IpFamily(..) |
|
57 |
, ipFamilyToVersion |
|
56 | 58 |
, Cluster(..) |
57 | 59 |
, ConfigData(..) |
58 | 60 |
) where |
... | ... | |
251 | 253 |
, ("DTPlain", 'C.dtPlain) |
252 | 254 |
, ("DTBlock", 'C.dtBlock) |
253 | 255 |
, ("DTDrbd8", 'C.dtDrbd8) |
256 |
, ("DTRados", 'C.dtRbd) |
|
254 | 257 |
]) |
255 | 258 |
$(makeJSONInstance ''DiskTemplate) |
256 | 259 |
|
... | ... | |
302 | 305 |
, simpleField "group" [t| String |] |
303 | 306 |
, simpleField "master_capable" [t| Bool |] |
304 | 307 |
, simpleField "vm_capable" [t| Bool |] |
305 |
-- , simpleField "ndparams" [t| PartialNDParams |]
|
|
308 |
, simpleField "ndparams" [t| PartialNDParams |]
|
|
306 | 309 |
, simpleField "powered" [t| Bool |] |
307 | 310 |
] |
308 | 311 |
++ timeStampFields |
... | ... | |
329 | 332 |
$(buildObject "NodeGroup" "group" $ |
330 | 333 |
[ simpleField "name" [t| String |] |
331 | 334 |
, defaultField [| [] |] $ simpleField "members" [t| [String] |] |
332 |
-- , simpleField "ndparams" [t| PartialNDParams |]
|
|
335 |
, simpleField "ndparams" [t| PartialNDParams |]
|
|
333 | 336 |
, simpleField "alloc_policy" [t| AllocPolicy |] |
334 | 337 |
] |
335 | 338 |
++ timeStampFields |
336 | 339 |
++ uuidFields |
337 | 340 |
++ serialFields) |
338 | 341 |
|
342 |
-- | IP family type |
|
343 |
$(declareIADT "IpFamily" |
|
344 |
[ ("IpFamilyV4", 'C.ip4Family) |
|
345 |
, ("IpFamilyV6", 'C.ip6Family) |
|
346 |
]) |
|
347 |
$(makeJSONInstance ''IpFamily) |
|
348 |
|
|
349 |
-- | Conversion from IP family to IP version. This is needed because |
|
350 |
-- Python uses both, depending on context. |
|
351 |
ipFamilyToVersion :: IpFamily -> Int |
|
352 |
ipFamilyToVersion IpFamilyV4 = C.ip4Version |
|
353 |
ipFamilyToVersion IpFamilyV6 = C.ip6Version |
|
354 |
|
|
339 | 355 |
-- * Cluster definitions |
340 | 356 |
$(buildObject "Cluster" "cluster" $ |
341 | 357 |
[ simpleField "rsahostkeypub" [t| String |] |
... | ... | |
344 | 360 |
, simpleField "mac_prefix" [t| String |] |
345 | 361 |
, simpleField "volume_group_name" [t| String |] |
346 | 362 |
, simpleField "reserved_lvs" [t| [String] |] |
347 |
-- , simpleField "drbd_usermode_helper" [t| String |]
|
|
363 |
, optionalField $ simpleField "drbd_usermode_helper" [t| String |]
|
|
348 | 364 |
-- , simpleField "default_bridge" [t| String |] |
349 | 365 |
-- , simpleField "default_hypervisor" [t| String |] |
350 | 366 |
, simpleField "master_node" [t| String |] |
351 | 367 |
, simpleField "master_ip" [t| String |] |
352 | 368 |
, simpleField "master_netdev" [t| String |] |
353 |
-- , simpleField "master_netmask" [t| String |] |
|
369 |
, simpleField "master_netmask" [t| Int |] |
|
370 |
, simpleField "use_external_mip_script" [t| Bool |] |
|
354 | 371 |
, simpleField "cluster_name" [t| String |] |
355 | 372 |
, simpleField "file_storage_dir" [t| String |] |
356 |
-- , simpleField "shared_file_storage_dir" [t| String |]
|
|
373 |
, simpleField "shared_file_storage_dir" [t| String |]
|
|
357 | 374 |
, simpleField "enabled_hypervisors" [t| [String] |] |
358 | 375 |
-- , simpleField "hvparams" [t| [(String, [(String, String)])] |] |
359 | 376 |
-- , simpleField "os_hvp" [t| [(String, String)] |] |
360 | 377 |
, simpleField "beparams" [t| Container FilledBEParams |] |
361 |
-- , simpleField "osparams" [t| [(String, String)] |]
|
|
378 |
, simpleField "osparams" [t| Container (Container String) |]
|
|
362 | 379 |
, simpleField "nicparams" [t| Container FilledNICParams |] |
363 |
-- , simpleField "ndparams" [t| FilledNDParams |]
|
|
380 |
, simpleField "ndparams" [t| FilledNDParams |] |
|
364 | 381 |
, simpleField "candidate_pool_size" [t| Int |] |
365 | 382 |
, simpleField "modify_etc_hosts" [t| Bool |] |
366 | 383 |
, simpleField "modify_ssh_setup" [t| Bool |] |
367 | 384 |
, simpleField "maintain_node_health" [t| Bool |] |
368 |
, simpleField "uid_pool" [t| [Int] |]
|
|
385 |
, simpleField "uid_pool" [t| [(Int, Int)] |]
|
|
369 | 386 |
, simpleField "default_iallocator" [t| String |] |
370 | 387 |
, simpleField "hidden_os" [t| [String] |] |
371 | 388 |
, simpleField "blacklisted_os" [t| [String] |] |
372 |
, simpleField "primary_ip_family" [t| Int |]
|
|
389 |
, simpleField "primary_ip_family" [t| IpFamily |]
|
|
373 | 390 |
, simpleField "prealloc_wipe_disks" [t| Bool |] |
374 | 391 |
] |
375 | 392 |
++ serialFields |
Also available in: Unified diff