Safe Haskell | None |
---|
Implementation of the Ganeti Disk config object.
Synopsis
- 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 JSValue Source #
The disk parameters type.
type DRBDSecret = String Source #
An alias for DRBD secrets
data LogicalVolume Source #
Instances
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 |
Instances
Eq DiskLogicalId # | |
Defined in Ganeti.Objects.Disk (==) :: DiskLogicalId -> DiskLogicalId -> Bool (/=) :: DiskLogicalId -> DiskLogicalId -> Bool | |
Show DiskLogicalId # | |
Defined in Ganeti.Objects.Disk showsPrec :: Int -> DiskLogicalId -> ShowS show :: DiskLogicalId -> String showList :: [DiskLogicalId] -> ShowS | |
Arbitrary DiskLogicalId | |
Defined in Test.Ganeti.Objects arbitrary :: Gen DiskLogicalId shrink :: DiskLogicalId -> [DiskLogicalId] |
lidDiskType :: DiskLogicalId -> DiskTemplate Source #
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 -> JSValue Source #
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 DiskLogicalId Source #
Custom decoder for DiskLogicalId. This is manual for now, since we don't have yet automation for separate-key style fields.
Disk data structure.
Instances
Eq Disk # | |
Show Disk # | |
JSON Disk # | |
ArrayObject Disk # | |
Defined in Ganeti.Objects.Disk | |
DictObject Disk # | |
SerialNoObject Disk # | |
Defined in Ganeti.Objects.Disk | |
ForthcomingObject Disk # | |
Defined in Ganeti.Objects.Disk isForthcoming :: Disk -> Bool Source # | |
UuidObject Disk # | |
Defined in Ganeti.Objects.Disk | |
TimeStampObject Disk # | |
SerialNoObjectL Disk # | |
Defined in Ganeti.Objects.Lens | |
UuidObjectL Disk # | |
Defined in Ganeti.Objects.Lens | |
TimeStampObjectL Disk # | |
Defined in Ganeti.Objects.Lens | |
Arbitrary Disk |
|
data ForthcomingDiskData Source #
ForthcomingDiskData | |
|
Instances
data RealDiskData Source #
RealDiskData | |
|
Instances
Eq RealDiskData # | |
Defined in Ganeti.Objects.Disk (==) :: RealDiskData -> RealDiskData -> Bool (/=) :: RealDiskData -> RealDiskData -> Bool | |
Show RealDiskData # | |
Defined in Ganeti.Objects.Disk showsPrec :: Int -> RealDiskData -> ShowS show :: RealDiskData -> String showList :: [RealDiskData] -> ShowS | |
JSON RealDiskData # | |
Defined in Ganeti.Objects.Disk readJSON :: JSValue -> Result RealDiskData showJSON :: RealDiskData -> JSValue readJSONs :: JSValue -> Result [RealDiskData] showJSONs :: [RealDiskData] -> JSValue | |
ArrayObject RealDiskData # | |
Defined in Ganeti.Objects.Disk toJSArray :: RealDiskData -> [JSValue] Source # fromJSArray :: [JSValue] -> Result RealDiskData Source # | |
DictObject RealDiskData # | |
Defined in Ganeti.Objects.Disk toDict :: RealDiskData -> [(String, JSValue)] Source # fromDictWKeys :: [(String, JSValue)] -> WriterT UsedKeys Result RealDiskData Source # fromDict :: [(String, JSValue)] -> Result RealDiskData Source # |
diskMtimeL :: Lens' Disk ClockTime Source #
diskCtimeL :: Lens' Disk ClockTime Source #
diskSerialL :: Lens' Disk Int Source #
diskParamsL :: Lens' Disk (Maybe DiskParams) Source #
diskSpindlesL :: Lens' Disk (Maybe Int) Source #
diskIvNameL :: Lens' Disk String Source #
diskNodesL :: Lens' Disk [String] Source #
diskChildrenL :: Lens' Disk [Disk] Source #
diskLogicalIdL :: Lens Disk Disk (Maybe DiskLogicalId) DiskLogicalId Source #
diskSerial :: Disk -> Int Source #
diskParams :: Disk -> Maybe DiskParams Source #
diskSpindles :: Disk -> Maybe Int Source #
diskIvName :: Disk -> String Source #
diskChildren :: Disk -> [Disk] Source #
diskLogicalId :: Disk -> Maybe DiskLogicalId Source #
diskForthcoming :: Disk -> Bool Source #
loadForthcomingDiskData :: JSValue -> Result ForthcomingDiskData Source #
saveForthcomingDiskData :: ForthcomingDiskData -> JSValue Source #
loadRealDiskData :: JSValue -> Result RealDiskData Source #
saveRealDiskData :: RealDiskData -> JSValue Source #
includesLogicalId :: LogicalVolume -> Disk -> Bool Source #
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.