ganeti
Safe HaskellNone

Ganeti.Objects.Disk

Description

Implementation of the Ganeti Disk config object.

Synopsis

Documentation

devType :: String Source #

Constant for the dev_type key entry in the disk config.

type DiskParams = Container JSValue Source #

The disk parameters type.

type DRBDSecret = String Source #

An alias for DRBD secrets

data LogicalVolume Source #

Constructors

LogicalVolume 

Fields

Instances

Instances details
Eq LogicalVolume # 
Instance details

Defined in Ganeti.Objects.Disk

Ord LogicalVolume # 
Instance details

Defined in Ganeti.Objects.Disk

Show LogicalVolume # 
Instance details

Defined in Ganeti.Objects.Disk

Methods

showsPrec :: Int -> LogicalVolume -> ShowS

show :: LogicalVolume -> String

showList :: [LogicalVolume] -> ShowS

JSON LogicalVolume # 
Instance details

Defined in Ganeti.Objects.Disk

Methods

readJSON :: JSValue -> Result LogicalVolume

showJSON :: LogicalVolume -> JSValue

readJSONs :: JSValue -> Result [LogicalVolume]

showJSONs :: [LogicalVolume] -> JSValue

Validatable LogicalVolume #

Check the constraints for VG/LV names (except the /dev/ check).

Instance details

Defined in Ganeti.Objects.Disk

Arbitrary LogicalVolume 
Instance details

Defined in Test.Ganeti.Objects

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.

Constructors

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

Instances details
Eq DiskLogicalId # 
Instance details

Defined in Ganeti.Objects.Disk

Show DiskLogicalId # 
Instance details

Defined in Ganeti.Objects.Disk

Methods

showsPrec :: Int -> DiskLogicalId -> ShowS

show :: DiskLogicalId -> String

showList :: [DiskLogicalId] -> ShowS

Arbitrary DiskLogicalId 
Instance details

Defined in Test.Ganeti.Objects

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.

data Disk Source #

Disk data structure.

Instances

Instances details
Eq Disk # 
Instance details

Defined in Ganeti.Objects.Disk

Methods

(==) :: Disk -> Disk -> Bool

(/=) :: Disk -> Disk -> Bool

Show Disk # 
Instance details

Defined in Ganeti.Objects.Disk

Methods

showsPrec :: Int -> Disk -> ShowS

show :: Disk -> String

showList :: [Disk] -> ShowS

JSON Disk # 
Instance details

Defined in Ganeti.Objects.Disk

Methods

readJSON :: JSValue -> Result Disk

showJSON :: Disk -> JSValue

readJSONs :: JSValue -> Result [Disk]

showJSONs :: [Disk] -> JSValue

ArrayObject Disk # 
Instance details

Defined in Ganeti.Objects.Disk

Methods

toJSArray :: Disk -> [JSValue] Source #

fromJSArray :: [JSValue] -> Result Disk Source #

DictObject Disk # 
Instance details

Defined in Ganeti.Objects.Disk

Methods

toDict :: Disk -> [(String, JSValue)] Source #

fromDictWKeys :: [(String, JSValue)] -> WriterT UsedKeys Result Disk Source #

fromDict :: [(String, JSValue)] -> Result Disk Source #

SerialNoObject Disk # 
Instance details

Defined in Ganeti.Objects.Disk

Methods

serialOf :: Disk -> Int Source #

ForthcomingObject Disk # 
Instance details

Defined in Ganeti.Objects.Disk

Methods

isForthcoming :: Disk -> Bool Source #

UuidObject Disk # 
Instance details

Defined in Ganeti.Objects.Disk

Methods

uuidOf :: Disk -> String Source #

TimeStampObject Disk # 
Instance details

Defined in Ganeti.Objects.Disk

Methods

cTimeOf :: Disk -> ClockTime Source #

mTimeOf :: Disk -> ClockTime Source #

SerialNoObjectL Disk # 
Instance details

Defined in Ganeti.Objects.Lens

Methods

serialL :: Lens' Disk Int Source #

UuidObjectL Disk # 
Instance details

Defined in Ganeti.Objects.Lens

Methods

uuidL :: Lens' Disk String Source #

TimeStampObjectL Disk # 
Instance details

Defined in Ganeti.Objects.Lens

Methods

mTimeL :: Lens' Disk ClockTime Source #

Arbitrary Disk

Disk arbitrary instance. Since we don't test disk hierarchy properties, we only generate disks with no children (FIXME), as generating recursive datastructures is a bit more work.

Instance details

Defined in Test.Ganeti.Objects

Methods

arbitrary :: Gen Disk

shrink :: Disk -> [Disk]

data ForthcomingDiskData Source #

Instances

Instances details
Eq ForthcomingDiskData # 
Instance details

Defined in Ganeti.Objects.Disk

Show ForthcomingDiskData # 
Instance details

Defined in Ganeti.Objects.Disk

Methods

showsPrec :: Int -> ForthcomingDiskData -> ShowS

show :: ForthcomingDiskData -> String

showList :: [ForthcomingDiskData] -> ShowS

JSON ForthcomingDiskData # 
Instance details

Defined in Ganeti.Objects.Disk

Methods

readJSON :: JSValue -> Result ForthcomingDiskData

showJSON :: ForthcomingDiskData -> JSValue

readJSONs :: JSValue -> Result [ForthcomingDiskData]

showJSONs :: [ForthcomingDiskData] -> JSValue

ArrayObject ForthcomingDiskData # 
Instance details

Defined in Ganeti.Objects.Disk

Methods

toJSArray :: ForthcomingDiskData -> [JSValue] Source #

fromJSArray :: [JSValue] -> Result ForthcomingDiskData Source #

DictObject ForthcomingDiskData # 
Instance details

Defined in Ganeti.Objects.Disk

Methods

toDict :: ForthcomingDiskData -> [(String, JSValue)] Source #

fromDictWKeys :: [(String, JSValue)] -> WriterT UsedKeys Result ForthcomingDiskData Source #

fromDict :: [(String, JSValue)] -> Result ForthcomingDiskData Source #

data RealDiskData Source #

Constructors

RealDiskData 

Fields

Instances

Instances details
Eq RealDiskData # 
Instance details

Defined in Ganeti.Objects.Disk

Methods

(==) :: RealDiskData -> RealDiskData -> Bool

(/=) :: RealDiskData -> RealDiskData -> Bool

Show RealDiskData # 
Instance details

Defined in Ganeti.Objects.Disk

Methods

showsPrec :: Int -> RealDiskData -> ShowS

show :: RealDiskData -> String

showList :: [RealDiskData] -> ShowS

JSON RealDiskData # 
Instance details

Defined in Ganeti.Objects.Disk

Methods

readJSON :: JSValue -> Result RealDiskData

showJSON :: RealDiskData -> JSValue

readJSONs :: JSValue -> Result [RealDiskData]

showJSONs :: [RealDiskData] -> JSValue

ArrayObject RealDiskData # 
Instance details

Defined in Ganeti.Objects.Disk

Methods

toJSArray :: RealDiskData -> [JSValue] Source #

fromJSArray :: [JSValue] -> Result RealDiskData Source #

DictObject RealDiskData # 
Instance details

Defined in Ganeti.Objects.Disk

Methods

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 #

diskUuidL :: Lens' Disk ByteString Source #

diskSpindlesL :: Lens' Disk (Maybe Int) Source #

diskNameL :: Lens' Disk (Maybe String) Source #

diskSizeL :: Lens Disk Disk (Maybe Int) Int Source #

diskIvNameL :: Lens' Disk String Source #

diskNodesL :: Lens' Disk [String] Source #

diskMtime :: Disk -> ClockTime Source #

diskCtime :: Disk -> ClockTime Source #

diskUuid :: Disk -> ByteString Source #

diskSpindles :: Disk -> Maybe Int Source #

diskName :: Disk -> Maybe String Source #

diskSize :: Disk -> Maybe Int Source #

diskIvName :: Disk -> String Source #

diskNodes :: Disk -> [String] Source #

loadRealDiskData :: JSValue -> Result RealDiskData 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.