Revision 294bb337 htools/Ganeti/HTools/CLI.hs

b/htools/Ganeti/HTools/CLI.hs
47 47
  , oExTags
48 48
  , oExecJobs
49 49
  , oGroup
50
  , oIDisk
51
  , oIMem
52
  , oIVcpus
53 50
  , oInstMoves
54 51
  , oLuxiSocket
55 52
  , oMachineReadable
......
73 70
  , oSelInst
74 71
  , oShowHelp
75 72
  , oShowVer
73
  , oStdSpec
76 74
  , oTieredSpec
77 75
  , oVerbose
78 76
  ) where
......
263 261
            (ReqArg (\ f o -> Ok o { optGroup = Just f }) "ID")
264 262
            "the ID of the group to balance"
265 263

  
266
oIDisk :: OptType
267
oIDisk = Option "" ["disk"]
268
         (ReqArg (\ d opts -> do
269
                    dsk <- annotateResult "--disk option" (parseUnit d)
270
                    let ospec = optISpec opts
271
                        nspec = ospec { rspecDsk = dsk }
272
                    return $ opts { optISpec = nspec }) "DISK")
273
         "disk size for instances"
274

  
275
oIMem :: OptType
276
oIMem = Option "" ["memory"]
277
        (ReqArg (\ m opts -> do
278
                   mem <- annotateResult "--memory option" (parseUnit m)
279
                   let ospec = optISpec opts
280
                       nspec = ospec { rspecMem = mem }
281
                   return $ opts { optISpec = nspec }) "MEMORY")
282
        "memory size for instances"
283

  
284
oIVcpus :: OptType
285
oIVcpus = Option "" ["vcpus"]
286
          (ReqArg (\ p opts -> do
287
                     vcpus <- tryRead "--vcpus option" p
288
                     let ospec = optISpec opts
289
                         nspec = ospec { rspecCpu = vcpus }
290
                     return $ opts { optISpec = nspec }) "NUM")
291
          "number of virtual cpus for instances"
292

  
293 264
oLuxiSocket :: OptType
294 265
oLuxiSocket = Option "L" ["luxi"]
295 266
              (OptArg ((\ f opts -> Ok opts { optLuxi = Just f }) .
......
408 379
           (NoArg (\ opts -> Ok opts { optShowVer = True}))
409 380
           "show the version of the program"
410 381

  
382
oStdSpec :: OptType
383
oStdSpec = Option "" ["standard-alloc"]
384
             (ReqArg (\ inp opts -> do
385
                        tspec <- parseISpecString "standard" inp
386
                        return $ opts { optISpec = tspec } )
387
              "STDSPEC")
388
             "enable standard specs allocation, given as 'disk,ram,cpu'"
389

  
411 390
oTieredSpec :: OptType
412 391
oTieredSpec = Option "" ["tiered-alloc"]
413 392
             (ReqArg (\ inp opts -> do

Also available in: Unified diff