Safe Haskell | None |
---|
Implementation of the Ganeti Disk config object.
- devType :: String
- type DiskParams = Container JSValue
- type DRBDSecret = String
- data LogicalVolume = LogicalVolume {}
- data DiskLogicalId
- = LIDPlain LogicalVolume
- | LIDDrbd8 String String Int Int Int (Private DRBDSecret)
- | LIDFile FileDriver String
- | LIDSharedFile FileDriver String
- | LIDGluster FileDriver String
- | LIDBlockDev BlockDriver String
- | LIDRados String String
- | LIDExt String String
- lidDiskType :: DiskLogicalId -> DiskTemplate
- lidEncodeType :: DiskLogicalId -> [(String, JSValue)]
- encodeDLId :: DiskLogicalId -> JSValue
- encodeFullDLId :: DiskLogicalId -> (JSValue, [(String, JSValue)])
- decodeDLId :: [(String, JSValue)] -> JSValue -> Result DiskLogicalId
- data Disk
- data ForthcomingDiskData = ForthcomingDiskData {
- forthcomingDiskLogicalId :: Maybe DiskLogicalId
- forthcomingDiskChildren :: [Disk]
- forthcomingDiskNodes :: [String]
- forthcomingDiskIvName :: String
- forthcomingDiskSize :: Maybe Int
- forthcomingDiskMode :: DiskMode
- forthcomingDiskName :: Maybe String
- forthcomingDiskSpindles :: Maybe Int
- forthcomingDiskParams :: Maybe DiskParams
- forthcomingDiskUuid :: ByteString
- forthcomingDiskSerial :: Int
- forthcomingDiskCtime :: ClockTime
- forthcomingDiskMtime :: ClockTime
- data RealDiskData = RealDiskData {
- realDiskLogicalId :: DiskLogicalId
- realDiskChildren :: [Disk]
- realDiskNodes :: [String]
- realDiskIvName :: String
- realDiskSize :: Int
- realDiskMode :: DiskMode
- realDiskName :: Maybe String
- realDiskSpindles :: Maybe Int
- realDiskParams :: Maybe DiskParams
- realDiskUuid :: ByteString
- realDiskSerial :: Int
- realDiskCtime :: ClockTime
- realDiskMtime :: ClockTime
- diskMtimeL :: Lens' Disk ClockTime
- diskCtimeL :: Lens' Disk ClockTime
- diskSerialL :: Lens' Disk Int
- diskUuidL :: Lens' Disk ByteString
- diskParamsL :: Lens' Disk (Maybe DiskParams)
- diskSpindlesL :: Lens' Disk (Maybe Int)
- diskNameL :: Lens' Disk (Maybe String)
- diskModeL :: Lens' Disk DiskMode
- diskSizeL :: Lens Disk Disk (Maybe Int) Int
- diskIvNameL :: Lens' Disk String
- diskNodesL :: Lens' Disk [String]
- diskChildrenL :: Lens' Disk [Disk]
- diskLogicalIdL :: Lens Disk Disk (Maybe DiskLogicalId) DiskLogicalId
- diskMtime :: Disk -> ClockTime
- diskCtime :: Disk -> ClockTime
- diskSerial :: Disk -> Int
- diskUuid :: Disk -> ByteString
- diskParams :: Disk -> Maybe DiskParams
- diskSpindles :: Disk -> Maybe Int
- diskName :: Disk -> Maybe String
- diskMode :: Disk -> DiskMode
- diskSize :: Disk -> Maybe Int
- diskIvName :: Disk -> String
- diskNodes :: Disk -> [String]
- diskChildren :: Disk -> [Disk]
- diskLogicalId :: Disk -> Maybe DiskLogicalId
- diskForthcoming :: Disk -> Bool
- loadForthcomingDiskData :: JSValue -> Result ForthcomingDiskData
- saveForthcomingDiskData :: ForthcomingDiskData -> JSValue
- loadRealDiskData :: JSValue -> Result RealDiskData
- saveRealDiskData :: RealDiskData -> JSValue
- includesLogicalId :: LogicalVolume -> Disk -> Bool
Documentation
type DiskParams = Container JSValueSource
The disk parameters type.
type DRBDSecret = StringSource
An alias for DRBD secrets
data LogicalVolume Source
Eq LogicalVolume | |
Ord LogicalVolume | |
Show LogicalVolume | |
Arbitrary LogicalVolume | |
JSON LogicalVolume | |
Validatable LogicalVolume | Check the constraints for a VGLV names (except the \@\dev/@ check). |
data DiskLogicalId Source
The disk configuration type. This includes the disk type itself,
for a more complete consistency. Note that since in the Python
code-base there's no authoritative place where we document the
logical id, this is probably a good reference point. There is a bijective
correspondence between the DiskLogicalId
constructors and DiskTemplate
.
LIDPlain LogicalVolume | Volume group, logical volume |
LIDDrbd8 String String Int Int Int (Private DRBDSecret) | NodeA, NodeB, Port, MinorA, MinorB, Secret |
LIDFile FileDriver String | Driver, path |
LIDSharedFile FileDriver String | Driver, path |
LIDGluster FileDriver String | Driver, path |
LIDBlockDev BlockDriver String | Driver, path (must be under /dev) |
LIDRados String String | Unused, path |
LIDExt String String | ExtProvider, unique name |
Eq DiskLogicalId | |
Show DiskLogicalId | |
Arbitrary DiskLogicalId |
lidDiskType :: DiskLogicalId -> DiskTemplateSource
Mapping from a logical id to a disk type.
lidEncodeType :: DiskLogicalId -> [(String, JSValue)]Source
Builds the extra disk_type field for a given logical id.
encodeDLId :: DiskLogicalId -> JSValueSource
Custom encoder for DiskLogicalId (logical id only).
encodeFullDLId :: DiskLogicalId -> (JSValue, [(String, JSValue)])Source
Custom encoder for DiskLogicalId, composing both the logical id and the extra disk_type field.
decodeDLId :: [(String, JSValue)] -> JSValue -> Result DiskLogicalIdSource
Custom decoder for DiskLogicalId. This is manual for now, since we don't have yet automation for separate-key style fields.
Disk data structure.
Eq Disk | |
Show Disk | |
Arbitrary Disk |
|
JSON Disk | |
ArrayObject Disk | |
DictObject Disk | |
SerialNoObject Disk | |
ForthcomingObject Disk | |
UuidObject Disk | |
TimeStampObject Disk | |
SerialNoObjectL Disk | |
UuidObjectL Disk | |
TimeStampObjectL Disk |
data ForthcomingDiskData Source
ForthcomingDiskData | |
|
data RealDiskData Source
RealDiskData | |
|
diskMtimeL :: Lens' Disk ClockTimeSource
diskCtimeL :: Lens' Disk ClockTimeSource
diskSerialL :: Lens' Disk IntSource
diskParamsL :: Lens' Disk (Maybe DiskParams)Source
diskSpindlesL :: Lens' Disk (Maybe Int)Source
diskIvNameL :: Lens' Disk StringSource
diskNodesL :: Lens' Disk [String]Source
diskChildrenL :: Lens' Disk [Disk]Source
diskLogicalIdL :: Lens Disk Disk (Maybe DiskLogicalId) DiskLogicalIdSource
diskSerial :: Disk -> IntSource
diskParams :: Disk -> Maybe DiskParamsSource
diskSpindles :: Disk -> Maybe IntSource
diskIvName :: Disk -> StringSource
diskChildren :: Disk -> [Disk]Source
diskLogicalId :: Disk -> Maybe DiskLogicalIdSource
diskForthcoming :: Disk -> BoolSource
loadForthcomingDiskData :: JSValue -> Result ForthcomingDiskDataSource
saveForthcomingDiskData :: ForthcomingDiskData -> JSValueSource
loadRealDiskData :: JSValue -> Result RealDiskDataSource
saveRealDiskData :: RealDiskData -> JSValueSource
includesLogicalId :: LogicalVolume -> Disk -> BoolSource
Determines whether a disk or one of his children has the given logical id (determined by the volume group name and by the logical volume name). This can be true only for DRBD or LVM disks.