Hi,
I'm trying to specify an InstanceFailover operation from Haskell code.
For reference, these are the fields that make up this operation:
, ("OpInstanceFailover",
[ pInstanceName -- Required
, pShutdownTimeout -- Has default: forceNonNeg
C.defaultShutdownTimeout
, pIgnoreConsistency -- Has default: False
, pMigrationTargetNode -- Optional
, pIgnoreIpolicy -- Has default: False
, pIallocator -- Optional
])
If I specify the operation as:
OpInstanceFailover { opInstanceName = iname }
Then I get:
Warning: Fields of `OpInstanceFailover' not initialised:
opShutdownTimeout,
opIgnoreConsistency, opTargetNode, opIgnoreIpolicy, opIallocator.
Fair enough. I think it'd be ideal to be able not to specify these
fields without a warning, but that's ok if we're not there, or we won't
be. :-)
However, do you have any suggestion how to deal with the default values,
and the NonNegative in particular?
- First I wanted to just re-specify the default values, getting them
from somewhere; but it seems the corresponding field accessors are
not exported from Ganeti.THH (and perhaps they shouldn't be,
indeed).
- So then I tried to just hard-code the values: how do you suggest I
handle the NonNegative case? Would it be okay to just export
forceNonNegative from OpParams.hs?
Thanks,
--
Dato Simó | [email protected]
Corp Fleet Management / Ganeti SRE (Dublin)