ganeti

Safe HaskellNone

Ganeti.Types

Contents

Description

Some common Ganeti types.

This holds types common to both core work, and to htools. Types that are very core specific (e.g. configuration objects) should go in Objects, while types that are specific to htools in-memory representation should go into Types.

Synopsis

Generic types

newtype NonNegative a Source

Type that holds a non-negative value.

Constructors

NonNegative 

Fields

fromNonNegative :: a
 

Instances

Eq a => Eq (NonNegative a) 
Show a => Show (NonNegative a) 
(Arbitrary a, Ord a, Num a, Show a) => Arbitrary (NonNegative a) 
(JSON a, Num a, Ord a, Show a) => JSON (NonNegative a) 

mkNonNegative :: (Monad m, Num a, Ord a, Show a) => a -> m (NonNegative a)Source

Smart constructor for NonNegative.

newtype Positive a Source

Type that holds a positive value.

Constructors

Positive 

Fields

fromPositive :: a
 

Instances

Eq a => Eq (Positive a) 
Show a => Show (Positive a) 
(Arbitrary a, Ord a, Num a, Show a) => Arbitrary (Positive a) 
(JSON a, Num a, Ord a, Show a) => JSON (Positive a) 

mkPositive :: (Monad m, Num a, Ord a, Show a) => a -> m (Positive a)Source

Smart constructor for Positive.

newtype Negative a Source

Type that holds a negative value.

Constructors

Negative 

Fields

fromNegative :: a
 

Instances

Eq a => Eq (Negative a) 
Show a => Show (Negative a) 
(Arbitrary a, Ord a, Num a, Show a) => Arbitrary (Negative a) 
(JSON a, Num a, Ord a, Show a) => JSON (Negative a) 

mkNegative :: (Monad m, Num a, Ord a, Show a) => a -> m (Negative a)Source

Smart constructor for Negative.

newtype NonEmpty a Source

Type that holds a non-null list.

Constructors

NonEmpty 

Fields

fromNonEmpty :: [a]
 

Instances

Eq a => Eq (NonEmpty a) 
Show a => Show (NonEmpty a) 
Arbitrary a => Arbitrary (NonEmpty a) 
JSON a => JSON (NonEmpty a) 

mkNonEmpty :: Monad m => [a] -> m (NonEmpty a)Source

Smart constructor for NonEmpty.

type NonEmptyString = NonEmpty CharSource

A simple type alias for non-empty strings.

Ganeti types

data DiskTemplate Source

Instance disk template type.

Instances

Bounded DiskTemplate 
Enum DiskTemplate 
Eq DiskTemplate 
Ord DiskTemplate 
Show DiskTemplate 
Arbitrary DiskTemplate

Custom Arbitrary instance for DiskTemplate, which needs to handle the case of file storage being disabled at configure time.

JSON DiskTemplate 
HasStringRepr DiskTemplate 

diskTemplateFromRaw :: forall m. Monad m => String -> m DiskTemplateSource

data AllocPolicy Source

The Group allocation policy type.

Note that the order of constructors is important as the automatic Ord instance will order them in the order they are defined, so when changing this data type be careful about the interaction with the desired sorting order.

Instances

Bounded AllocPolicy 
Enum AllocPolicy 
Eq AllocPolicy 
Ord AllocPolicy 
Show AllocPolicy 
Arbitrary AllocPolicy 
JSON AllocPolicy 

allocPolicyFromRaw :: forall m. Monad m => String -> m AllocPolicySource

data InstanceStatus Source

The Instance real state type. FIXME: this could be improved to just wrap a NormalState AdminStatus | ErrorState ErrorCondition.

instanceStatusFromRaw :: forall m. Monad m => String -> m InstanceStatusSource

data MigrationMode Source

Migration mode.

Instances

migrationModeFromRaw :: forall m. Monad m => String -> m MigrationModeSource

verifyOptionalChecksFromRaw :: forall m. Monad m => String -> m VerifyOptionalChecksSource

cVErrorCodeFromRaw :: forall m. Monad m => String -> m CVErrorCodeSource

data DdmSimple Source

Dynamic device modification, just add/remove version.

Instances

Bounded DdmSimple 
Enum DdmSimple 
Eq DdmSimple 
Ord DdmSimple 
Show DdmSimple 
Arbitrary DdmSimple 
JSON DdmSimple 

ddmSimpleFromRaw :: forall m. Monad m => String -> m DdmSimpleSource

data DdmFull Source

Dynamic device modification, all operations version.

Instances

Bounded DdmFull 
Enum DdmFull 
Eq DdmFull 
Ord DdmFull 
Show DdmFull 
Arbitrary DdmFull 
JSON DdmFull 

ddmFullFromRaw :: forall m. Monad m => String -> m DdmFullSource

data Hypervisor Source

Hypervisor type definitions.

Constructors

Kvm 
XenPvm 
Chroot 
XenHvm 
Lxc 
Fake 

Instances

Bounded Hypervisor 
Enum Hypervisor 
Eq Hypervisor 
Ord Hypervisor 
Show Hypervisor 
Arbitrary Hypervisor 
JSON Hypervisor 

hypervisorFromRaw :: forall m. Monad m => String -> m HypervisorSource

data OobCommand Source

Oob command type.

Instances

Bounded OobCommand 
Enum OobCommand 
Eq OobCommand 
Ord OobCommand 
Show OobCommand 
Arbitrary OobCommand 
JSON OobCommand 

oobCommandFromRaw :: forall m. Monad m => String -> m OobCommandSource

data StorageType Source

Storage type.

Instances

Bounded StorageType 
Enum StorageType 
Eq StorageType 
Ord StorageType 
Show StorageType 
Arbitrary StorageType

Custom Arbitrary instance for StorageType, which needs to handle the case of file storage being disabled at configure time.

JSON StorageType 

storageTypeFromRaw :: forall m. Monad m => String -> m StorageTypeSource

data NodeEvacMode Source

Node evac modes.

Instances

nodeEvacModeFromRaw :: forall m. Monad m => String -> m NodeEvacModeSource

data FileDriver Source

The file driver type.

Constructors

FileLoop 
FileBlktap 

Instances

Bounded FileDriver 
Enum FileDriver 
Eq FileDriver 
Ord FileDriver 
Show FileDriver 
Arbitrary FileDriver 
JSON FileDriver 

fileDriverFromRaw :: forall m. Monad m => String -> m FileDriverSource

data InstCreateMode Source

The instance create mode.

instCreateModeFromRaw :: forall m. Monad m => String -> m InstCreateModeSource

data RebootType Source

Reboot type.

Instances

Bounded RebootType 
Enum RebootType 
Eq RebootType 
Ord RebootType 
Show RebootType 
Arbitrary RebootType 
JSON RebootType 

rebootTypeFromRaw :: forall m. Monad m => String -> m RebootTypeSource

data ExportMode Source

Export modes.

Instances

Bounded ExportMode 
Enum ExportMode 
Eq ExportMode 
Ord ExportMode 
Show ExportMode 
Arbitrary ExportMode 
JSON ExportMode 

exportModeFromRaw :: forall m. Monad m => String -> m ExportModeSource

data IAllocatorTestDir Source

IAllocator run types (OpTestIAllocator).

iAllocatorTestDirFromRaw :: forall m. Monad m => String -> m IAllocatorTestDirSource

iAllocatorModeFromRaw :: forall m. Monad m => String -> m IAllocatorModeSource

data NICMode Source

Network mode.

Constructors

NMBridged 
NMRouted 
NMOvs 

Instances

Bounded NICMode 
Enum NICMode 
Eq NICMode 
Ord NICMode 
Show NICMode 
Arbitrary NICMode 
JSON NICMode 

nICModeFromRaw :: forall m. Monad m => String -> m NICModeSource

data JobStatus Source

The JobStatus data type. Note that this is ordered especially such that greater/lesser comparison on values of this type makes sense.

Instances

Bounded JobStatus 
Enum JobStatus 
Eq JobStatus 
Ord JobStatus 
Show JobStatus 
Arbitrary JobStatus 
JSON JobStatus 

jobStatusFromRaw :: forall m. Monad m => String -> m JobStatusSource

finalizedJobStatusFromRaw :: forall m. Monad m => String -> m FinalizedJobStatusSource

newtype JobId Source

The Ganeti job type.

Constructors

JobId 

Fields

fromJobId :: Int
 

Instances

Eq JobId 
Show JobId 
Arbitrary JobId 
JSON JobId 

makeJobId :: Monad m => Int -> m JobIdSource

Builds a job ID.

makeJobIdS :: Monad m => String -> m JobIdSource

Builds a job ID from a string.

parseJobId :: Monad m => JSValue -> m JobIdSource

type RelativeJobId = Negative IntSource

Relative job ID type alias.

data JobIdDep Source

Job ID dependency.

Instances

Eq JobIdDep 
Show JobIdDep 
Arbitrary JobIdDep 
JSON JobIdDep 

data JobDependency Source

Job Dependency type.

Instances

data OpSubmitPriority Source

Valid opcode priorities for submit.

opSubmitPriorityFromRaw :: forall m. Monad m => Int -> m OpSubmitPrioritySource

parseSubmitPriority :: Monad m => String -> m OpSubmitPrioritySource

Parse submit priorities from a string.

fmtSubmitPriority :: OpSubmitPriority -> StringSource

Format a submit priority as string.

data OpStatus Source

Our ADT for the OpCode status at runtime (while in a job).

Instances

Bounded OpStatus 
Enum OpStatus 
Eq OpStatus 
Ord OpStatus 
Show OpStatus 
Arbitrary OpStatus 
JSON OpStatus 

opStatusFromRaw :: forall m. Monad m => String -> m OpStatusSource

data ELogType Source

Type for the job message type.

Instances

Bounded ELogType 
Enum ELogType 
Eq ELogType 
Ord ELogType 
Show ELogType 
Arbitrary ELogType 
JSON ELogType 

eLogTypeFromRaw :: forall m. Monad m => String -> m ELogTypeSource

type ReasonElem = (String, String, Integer)Source

Type of one element of a reason trail.

type ReasonTrail = [ReasonElem]Source

Type representing a reason trail.