ganeti
Safe HaskellNone

Ganeti.JSON

Description

JSON utility functions.

Synopsis

JSON-related functions

type JSField = (String, JSValue) Source #

A type alias for a field of a JSRecord.

type JSRecord = [JSField] Source #

A type alias for the list-based representation of J.JSObject.

readJSONWithDesc Source #

Arguments

:: JSON a 
=> String

description of a

-> JSValue

input value

-> Result a 

Annotate readJSON error messages with descriptions of what is being parsed into what.

fromJResult :: (Monad m, MonadFail m) => String -> Result a -> m a Source #

Converts a JSON Result into a monadic value.

fromJResultE :: (Error e, MonadError e m) => String -> Result a -> m a Source #

Converts a JSON Result into a MonadError value.

readEitherString :: MonadFail m => JSValue -> m String Source #

Tries to read a string from a JSON value.

In case the value was not a string, we fail the read (in the context of the current monad.

loadJSArray Source #

Arguments

:: MonadFail m 
=> String

Operation description (for error reporting)

-> String

Input message

-> m [JSObject JSValue] 

Converts a JSON message into an array of JSON objects.

buildNoKeyError :: JSRecord -> String -> String Source #

Helper function for missing-key errors

fromObj :: (JSON a, MonadFail m) => JSRecord -> String -> m a Source #

Reads the value of a key in a JSON object.

maybeFromObj :: (JSON a, MonadFail m) => JSRecord -> String -> m (Maybe a) Source #

Reads the value of an optional key in a JSON object. Missing keys, or keys that have a 'null' value, will be returned as Nothing, otherwise we attempt deserialisation and return a Just value.

fromObjWithDefault :: (JSON a, MonadFail m) => JSRecord -> String -> a -> m a Source #

Reads the value of a key in a JSON object with a default if missing. Note that both missing keys and keys with value 'null' will cause the default value to be returned.

arrayMaybeFromJVal :: (JSON a, Monad m, MonadFail m) => JSValue -> m [Maybe a] Source #

arrayMaybeFromObj :: (JSON a, MonadFail m) => JSRecord -> String -> m [Maybe a] Source #

Reads an array of optional items

tryArrayMaybeFromObj Source #

Arguments

:: JSON a 
=> String

Textual "owner" in error messages

-> JSRecord

The object array

-> String

The desired key from the object

-> Result [Maybe a] 

Wrapper for arrayMaybeFromObj with better diagnostic

fromKeyValue Source #

Arguments

:: (JSON a, MonadFail m) 
=> String

The key name

-> JSValue

The value to read

-> m a 

Reads a JValue, that originated from an object key.

fromJVal :: (Monad m, MonadFail m, JSON a) => JSValue -> m a Source #

Small wrapper over readJSON.

fromJValE :: (Error e, MonadError e m, JSON a) => JSValue -> m a Source #

Small wrapper over readJSON for MonadError.

jsonHead :: JSON b => [a] -> (a -> b) -> JSValue Source #

Helper function that returns Null or first element of the list.

getMaybeJsonHead :: JSON b => [a] -> (a -> Maybe b) -> JSValue Source #

Helper for extracting Maybe values from a possibly empty list.

getMaybeJsonElem :: JSON b => [a] -> Int -> (a -> Maybe b) -> JSValue Source #

Helper for extracting Maybe values from a list that might be too short.

asJSObject :: (Monad m, MonadFail m) => JSValue -> m (JSObject JSValue) Source #

Converts a JSON value into a JSON object.

asObjectList :: (Monad m, MonadFail m) => [JSValue] -> m [JSObject JSValue] Source #

Coneverts a list of JSON values into a list of JSON objects.

tryFromObj Source #

Arguments

:: JSON a 
=> String

Textual "owner" in error messages

-> JSRecord

The object array

-> String

The desired key from the object

-> Result a 

Try to extract a key from an object with better error reporting than fromObj.

toArray :: (Monad m, MonadFail m) => JSValue -> m [JSValue] Source #

Ensure a given JSValue is actually a JSArray.

optionalJSField :: JSON a => String -> Maybe a -> Maybe JSField Source #

Creates a Maybe JSField. If the value string is Nothing, the JSField will be Nothing as well.

optFieldsToObj :: [Maybe JSField] -> JSValue Source #

Creates an object with all the non-Nothing fields of the given list.

Container type (special type for JSON serialisation)

class HasStringRepr a where Source #

Class of types that can be converted from Strings. This is similar to the Read class, but it's using a different serialisation format, so we have to define a separate class. Mostly useful for custom key types in JSON dictionaries, which have to be backed by strings.

Methods

fromStringRepr :: MonadFail m => String -> m a Source #

toStringRepr :: a -> String Source #

Instances

Instances details
HasStringRepr String #

Trivial instance HasStringRepr for String.

Instance details

Defined in Ganeti.JSON

Methods

fromStringRepr :: MonadFail m => String -> m String Source #

toStringRepr :: String -> String Source #

HasStringRepr ByteString # 
Instance details

Defined in Ganeti.JSON

Methods

fromStringRepr :: MonadFail m => String -> m ByteString Source #

toStringRepr :: ByteString -> String Source #

HasStringRepr DiskTemplate # 
Instance details

Defined in Ganeti.Types

Methods

fromStringRepr :: MonadFail m => String -> m DiskTemplate Source #

toStringRepr :: DiskTemplate -> String Source #

HasStringRepr Hypervisor # 
Instance details

Defined in Ganeti.Types

Methods

fromStringRepr :: MonadFail m => String -> m Hypervisor Source #

toStringRepr :: Hypervisor -> String Source #

HasStringRepr SSKey # 
Instance details

Defined in Ganeti.Ssconf

Methods

fromStringRepr :: MonadFail m => String -> m SSKey Source #

toStringRepr :: SSKey -> String Source #

newtype GenericContainer a b Source #

The container type, a wrapper over Data.Map

Constructors

GenericContainer 

Fields

Instances

Instances details
Arbitrary OsParams 
Instance details

Defined in Test.Ganeti.Objects

Arbitrary GroupDiskParams

No real arbitrary instance for GroupDiskParams yet.

Instance details

Defined in Test.Ganeti.Objects

Arbitrary IAllocatorParams 
Instance details

Defined in Test.Ganeti.Objects

Arbitrary ClusterNicParams 
Instance details

Defined in Test.Ganeti.Objects

Arbitrary ClusterOsParamsPrivate 
Instance details

Defined in Test.Ganeti.Objects

Arbitrary ClusterOsParams 
Instance details

Defined in Test.Ganeti.Objects

Arbitrary ClusterBeParams 
Instance details

Defined in Test.Ganeti.Objects

Arbitrary OsHvParams

No real arbitrary instance for OsHvParams yet.

Instance details

Defined in Test.Ganeti.Objects

Arbitrary ClusterHvParams

No real arbitrary instance for ClusterHvParams yet.

Instance details

Defined in Test.Ganeti.Objects

Functor (GenericContainer a) # 
Instance details

Defined in Ganeti.JSON

Methods

fmap :: (a0 -> b) -> GenericContainer a a0 -> GenericContainer a b

(<$) :: a0 -> GenericContainer a b -> GenericContainer a a0

Foldable (GenericContainer a) # 
Instance details

Defined in Ganeti.JSON

Methods

fold :: Monoid m => GenericContainer a m -> m

foldMap :: Monoid m => (a0 -> m) -> GenericContainer a a0 -> m

foldMap' :: Monoid m => (a0 -> m) -> GenericContainer a a0 -> m

foldr :: (a0 -> b -> b) -> b -> GenericContainer a a0 -> b

foldr' :: (a0 -> b -> b) -> b -> GenericContainer a a0 -> b

foldl :: (b -> a0 -> b) -> b -> GenericContainer a a0 -> b

foldl' :: (b -> a0 -> b) -> b -> GenericContainer a a0 -> b

foldr1 :: (a0 -> a0 -> a0) -> GenericContainer a a0 -> a0

foldl1 :: (a0 -> a0 -> a0) -> GenericContainer a a0 -> a0

toList :: GenericContainer a a0 -> [a0]

null :: GenericContainer a a0 -> Bool

length :: GenericContainer a a0 -> Int

elem :: Eq a0 => a0 -> GenericContainer a a0 -> Bool

maximum :: Ord a0 => GenericContainer a a0 -> a0

minimum :: Ord a0 => GenericContainer a a0 -> a0

sum :: Num a0 => GenericContainer a a0 -> a0

product :: Num a0 => GenericContainer a a0 -> a0

Traversable (GenericContainer a) # 
Instance details

Defined in Ganeti.JSON

Methods

traverse :: Applicative f => (a0 -> f b) -> GenericContainer a a0 -> f (GenericContainer a b)

sequenceA :: Applicative f => GenericContainer a (f a0) -> f (GenericContainer a a0)

mapM :: Monad m => (a0 -> m b) -> GenericContainer a a0 -> m (GenericContainer a b)

sequence :: Monad m => GenericContainer a (m a0) -> m (GenericContainer a a0)

Arbitrary (Container DataCollectorConfig) 
Instance details

Defined in Test.Ganeti.Objects

(Eq a, Eq b) => Eq (GenericContainer a b) # 
Instance details

Defined in Ganeti.JSON

Methods

(==) :: GenericContainer a b -> GenericContainer a b -> Bool

(/=) :: GenericContainer a b -> GenericContainer a b -> Bool

(Ord a, Ord b) => Ord (GenericContainer a b) # 
Instance details

Defined in Ganeti.JSON

(Show a, Show b) => Show (GenericContainer a b) # 
Instance details

Defined in Ganeti.JSON

Methods

showsPrec :: Int -> GenericContainer a b -> ShowS

show :: GenericContainer a b -> String

showList :: [GenericContainer a b] -> ShowS

(HasStringRepr a, Ord a, JSON b) => JSON (GenericContainer a b) # 
Instance details

Defined in Ganeti.JSON

Methods

readJSON :: JSValue -> Result (GenericContainer a b)

showJSON :: GenericContainer a b -> JSValue

readJSONs :: JSValue -> Result [GenericContainer a b]

showJSONs :: [GenericContainer a b] -> JSValue

(NFData a, NFData b) => NFData (GenericContainer a b) # 
Instance details

Defined in Ganeti.JSON

Methods

rnf :: GenericContainer a b -> ()

emptyContainer :: GenericContainer a b Source #

The empty container.

type Container = GenericContainer ByteString Source #

Type alias for string keys.

containerFromList :: Ord a => [(a, b)] -> GenericContainer a b Source #

Creates a GenericContainer from a list of key-value pairs.

lookupContainer :: (Monad m, Ord a) => m b -> a -> GenericContainer a b -> m b Source #

Looks up a value in a container with a default value. If a key has no value, a given monadic default is returned. This allows simple error handling, as the default can be mzero, failError etc.

alterContainerL :: (Functor f, Ord a) => a -> (Maybe b -> f (Maybe b)) -> GenericContainer a b -> f (GenericContainer a b) Source #

Updates a value inside a container. The signature of the function is crafted so that it can be directly used as a lens.

readContainer :: (MonadFail m, HasStringRepr a, Ord a, JSON b) => JSObject JSValue -> m (GenericContainer a b) Source #

Container loader.

showContainer :: (HasStringRepr a, JSON b) => GenericContainer a b -> JSValue Source #

Container dumper.

Types that (de)serialize in a special form of JSON

newtype UsedKeys Source #

Constructors

UsedKeys (Maybe (Set Text)) 

mkUsedKeys :: Set Text -> UsedKeys Source #

class DictObject a where Source #

Class of objects that can be converted from and to JSObject lists-format.

Minimal complete definition

toDict, fromDictWKeys

Methods

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

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

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

Instances

Instances details
DictObject LVInfo # 
Instance details

Defined in Ganeti.Storage.Lvm.Types

Methods

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

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

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

DictObject Diskstats # 
Instance details

Defined in Ganeti.Storage.Diskstats.Types

Methods

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

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

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

DictObject CPUavgload # 
Instance details

Defined in Ganeti.Cpu.Types

Methods

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

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

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

DictObject CPUstat # 
Instance details

Defined in Ganeti.Cpu.Types

Methods

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

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

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

DictObject PartialNicParams # 
Instance details

Defined in Ganeti.Objects.Nic

Methods

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

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

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

DictObject FilledNicParams # 
Instance details

Defined in Ganeti.Objects.Nic

Methods

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

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

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

DictObject PartialNic # 
Instance details

Defined in Ganeti.Objects.Nic

Methods

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

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

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

DictObject ISpec # 
Instance details

Defined in Ganeti.HTools.Types

Methods

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

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

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

DictObject MinMaxISpecs # 
Instance details

Defined in Ganeti.HTools.Types

Methods

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

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

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

DictObject IPolicy # 
Instance details

Defined in Ganeti.HTools.Types

Methods

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

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

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

DictObject PartialBeParams # 
Instance details

Defined in Ganeti.Objects.Instance

Methods

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

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

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

DictObject FilledBeParams # 
Instance details

Defined in Ganeti.Objects.Instance

Methods

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

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

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

DictObject Instance # 
Instance details

Defined in Ganeti.Objects.Instance

Methods

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

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

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

DictObject ForthcomingInstanceData # 
Instance details

Defined in Ganeti.Objects.Instance

Methods

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

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

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

DictObject RealInstanceData # 
Instance details

Defined in Ganeti.Objects.Instance

Methods

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

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

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

DictObject ConfdReqQ # 
Instance details

Defined in Ganeti.Confd.Types

Methods

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

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

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

DictObject ConfdRequest # 
Instance details

Defined in Ganeti.Confd.Types

Methods

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

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

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

DictObject ConfdReply # 
Instance details

Defined in Ganeti.Confd.Types

Methods

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

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

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

DictObject SignedMessage # 
Instance details

Defined in Ganeti.Confd.Types

Methods

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

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

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

DictObject FieldDefinition # 
Instance details

Defined in Ganeti.Query.Language

Methods

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

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

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

DictObject QueryResult # 
Instance details

Defined in Ganeti.Query.Language

Methods

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

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

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

DictObject QueryFieldsResult # 
Instance details

Defined in Ganeti.Query.Language

Methods

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

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

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

DictObject INicParams # 
Instance details

Defined in Ganeti.OpParams

Methods

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

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

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

DictObject IDiskParams # 
Instance details

Defined in Ganeti.OpParams

Methods

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

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

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

DictObject OpCode # 
Instance details

Defined in Ganeti.OpCodes

Methods

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

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

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

DictObject MetaOpCode # 
Instance details

Defined in Ganeti.OpCodes

Methods

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

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

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

DictObject CommonOpParams # 
Instance details

Defined in Ganeti.OpCodes

Methods

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

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

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

DictObject QueuedOpCode # 
Instance details

Defined in Ganeti.JQueue.Objects

Methods

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

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

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

DictObject QueuedJob # 
Instance details

Defined in Ganeti.JQueue.Objects

Methods

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

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

fromDict :: [(String, JSValue)] -> Result QueuedJob 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 #

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 #

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 #

DictObject Network # 
Instance details

Defined in Ganeti.Objects

Methods

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

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

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

DictObject DataCollectorConfig # 
Instance details

Defined in Ganeti.Objects

Methods

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

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

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

DictObject PartialISpecParams # 
Instance details

Defined in Ganeti.Objects

Methods

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

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

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

DictObject FilledISpecParams # 
Instance details

Defined in Ganeti.Objects

Methods

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

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

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

DictObject MinMaxISpecs # 
Instance details

Defined in Ganeti.Objects

Methods

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

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

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

DictObject PartialIPolicy # 
Instance details

Defined in Ganeti.Objects

Methods

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

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

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

DictObject FilledIPolicy # 
Instance details

Defined in Ganeti.Objects

Methods

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

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

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

DictObject PartialNDParams # 
Instance details

Defined in Ganeti.Objects

Methods

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

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

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

DictObject FilledNDParams # 
Instance details

Defined in Ganeti.Objects

Methods

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

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

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

DictObject Node # 
Instance details

Defined in Ganeti.Objects

Methods

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

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

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

DictObject NodeGroup # 
Instance details

Defined in Ganeti.Objects

Methods

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

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

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

DictObject FilterRule # 
Instance details

Defined in Ganeti.Objects

Methods

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

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

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

DictObject Cluster # 
Instance details

Defined in Ganeti.Objects

Methods

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

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

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

DictObject ConfigData # 
Instance details

Defined in Ganeti.Objects

Methods

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

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

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

DictObject MasterNetworkParameters # 
Instance details

Defined in Ganeti.Objects

Methods

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

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

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

DictObject LuxiOp # 
Instance details

Defined in Ganeti.Luxi

Methods

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

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

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

DictObject DCStatus # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

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

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

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

DictObject DCReport # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

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

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

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

DictObject InstStatus # 
Instance details

Defined in Ganeti.DataCollectors.InstStatusTypes

Methods

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

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

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

DictObject ReportData # 
Instance details

Defined in Ganeti.DataCollectors.InstStatusTypes

Methods

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

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

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

DictObject RpcCallInstanceInfo # 
Instance details

Defined in Ganeti.Rpc

Methods

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

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

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

DictObject InstanceInfo # 
Instance details

Defined in Ganeti.Rpc

Methods

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

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

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

DictObject RpcResultInstanceInfo # 
Instance details

Defined in Ganeti.Rpc

Methods

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

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

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

DictObject RpcCallAllInstancesInfo # 
Instance details

Defined in Ganeti.Rpc

Methods

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

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

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

DictObject RpcResultAllInstancesInfo # 
Instance details

Defined in Ganeti.Rpc

Methods

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

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

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

DictObject InstanceConsoleInfoParams # 
Instance details

Defined in Ganeti.Rpc

Methods

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

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

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

DictObject RpcCallInstanceConsoleInfo # 
Instance details

Defined in Ganeti.Rpc

Methods

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

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

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

DictObject InstanceConsoleInfo # 
Instance details

Defined in Ganeti.Rpc

Methods

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

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

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

DictObject RpcResultInstanceConsoleInfo # 
Instance details

Defined in Ganeti.Rpc

Methods

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

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

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

DictObject RpcCallInstanceList # 
Instance details

Defined in Ganeti.Rpc

Methods

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

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

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

DictObject RpcResultInstanceList # 
Instance details

Defined in Ganeti.Rpc

Methods

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

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

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

DictObject RpcCallNodeInfo # 
Instance details

Defined in Ganeti.Rpc

Methods

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

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

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

DictObject StorageInfo # 
Instance details

Defined in Ganeti.Rpc

Methods

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

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

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

DictObject HvInfo # 
Instance details

Defined in Ganeti.Rpc

Methods

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

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

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

DictObject RpcResultNodeInfo # 
Instance details

Defined in Ganeti.Rpc

Methods

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

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

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

DictObject RpcCallVersion # 
Instance details

Defined in Ganeti.Rpc

Methods

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

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

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

DictObject RpcResultVersion # 
Instance details

Defined in Ganeti.Rpc

Methods

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

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

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

DictObject RpcCallStorageList # 
Instance details

Defined in Ganeti.Rpc

Methods

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

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

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

DictObject RpcResultStorageList # 
Instance details

Defined in Ganeti.Rpc

Methods

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

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

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

DictObject RpcCallTestDelay # 
Instance details

Defined in Ganeti.Rpc

Methods

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

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

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

DictObject RpcCallExportList # 
Instance details

Defined in Ganeti.Rpc

Methods

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

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

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

DictObject RpcResultExportList # 
Instance details

Defined in Ganeti.Rpc

Methods

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

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

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

DictObject RpcCallJobqueueUpdate # 
Instance details

Defined in Ganeti.Rpc

Methods

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

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

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

DictObject RpcCallJobqueueRename # 
Instance details

Defined in Ganeti.Rpc

Methods

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

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

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

DictObject RpcCallSetWatcherPause # 
Instance details

Defined in Ganeti.Rpc

Methods

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

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

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

DictObject RpcCallSetDrainFlag # 
Instance details

Defined in Ganeti.Rpc

Methods

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

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

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

DictObject RpcCallUploadFile # 
Instance details

Defined in Ganeti.Rpc

Methods

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

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

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

DictObject RpcCallWriteSsconfFiles # 
Instance details

Defined in Ganeti.Rpc

Methods

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

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

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

DictObject RpcCallNodeActivateMasterIp # 
Instance details

Defined in Ganeti.Rpc

Methods

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

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

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

DictObject RpcResultNodeActivateMasterIp # 
Instance details

Defined in Ganeti.Rpc

Methods

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

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

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

DictObject RpcCallMasterNodeName # 
Instance details

Defined in Ganeti.Rpc

Methods

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

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

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

DictObject RpcResultMasterNodeName # 
Instance details

Defined in Ganeti.Rpc

Methods

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

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

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

DictObject TempResState # 
Instance details

Defined in Ganeti.WConfd.TempRes

Methods

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

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

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

showJSONtoDict :: DictObject a => a -> JSValue Source #

A default implementation of showJSON using toDict.

readJSONfromDict :: DictObject a => JSValue -> Result a Source #

A default implementation of readJSON using fromDict. Checks that the input value is a JSON object and converts it using fromDict. Also checks the input contains only the used keys returned by fromDict.

class ArrayObject a where Source #

Class of objects that can be converted from and to [JSValue] with a fixed length and order.

Methods

toJSArray :: a -> [JSValue] Source #

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

Instances

Instances details
ArrayObject LVInfo # 
Instance details

Defined in Ganeti.Storage.Lvm.Types

Methods

toJSArray :: LVInfo -> [JSValue] Source #

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

ArrayObject Diskstats # 
Instance details

Defined in Ganeti.Storage.Diskstats.Types

Methods

toJSArray :: Diskstats -> [JSValue] Source #

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

ArrayObject CPUavgload # 
Instance details

Defined in Ganeti.Cpu.Types

Methods

toJSArray :: CPUavgload -> [JSValue] Source #

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

ArrayObject CPUstat # 
Instance details

Defined in Ganeti.Cpu.Types

Methods

toJSArray :: CPUstat -> [JSValue] Source #

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

ArrayObject PartialNicParams # 
Instance details

Defined in Ganeti.Objects.Nic

Methods

toJSArray :: PartialNicParams -> [JSValue] Source #

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

ArrayObject FilledNicParams # 
Instance details

Defined in Ganeti.Objects.Nic

Methods

toJSArray :: FilledNicParams -> [JSValue] Source #

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

ArrayObject PartialNic # 
Instance details

Defined in Ganeti.Objects.Nic

Methods

toJSArray :: PartialNic -> [JSValue] Source #

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

ArrayObject ISpec # 
Instance details

Defined in Ganeti.HTools.Types

Methods

toJSArray :: ISpec -> [JSValue] Source #

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

ArrayObject MinMaxISpecs # 
Instance details

Defined in Ganeti.HTools.Types

Methods

toJSArray :: MinMaxISpecs -> [JSValue] Source #

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

ArrayObject IPolicy # 
Instance details

Defined in Ganeti.HTools.Types

Methods

toJSArray :: IPolicy -> [JSValue] Source #

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

ArrayObject PartialBeParams # 
Instance details

Defined in Ganeti.Objects.Instance

Methods

toJSArray :: PartialBeParams -> [JSValue] Source #

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

ArrayObject FilledBeParams # 
Instance details

Defined in Ganeti.Objects.Instance

Methods

toJSArray :: FilledBeParams -> [JSValue] Source #

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

ArrayObject Instance # 
Instance details

Defined in Ganeti.Objects.Instance

Methods

toJSArray :: Instance -> [JSValue] Source #

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

ArrayObject ForthcomingInstanceData # 
Instance details

Defined in Ganeti.Objects.Instance

ArrayObject RealInstanceData # 
Instance details

Defined in Ganeti.Objects.Instance

Methods

toJSArray :: RealInstanceData -> [JSValue] Source #

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

ArrayObject ConfdReqQ # 
Instance details

Defined in Ganeti.Confd.Types

Methods

toJSArray :: ConfdReqQ -> [JSValue] Source #

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

ArrayObject ConfdRequest # 
Instance details

Defined in Ganeti.Confd.Types

Methods

toJSArray :: ConfdRequest -> [JSValue] Source #

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

ArrayObject ConfdReply # 
Instance details

Defined in Ganeti.Confd.Types

Methods

toJSArray :: ConfdReply -> [JSValue] Source #

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

ArrayObject SignedMessage # 
Instance details

Defined in Ganeti.Confd.Types

Methods

toJSArray :: SignedMessage -> [JSValue] Source #

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

ArrayObject FieldDefinition # 
Instance details

Defined in Ganeti.Query.Language

Methods

toJSArray :: FieldDefinition -> [JSValue] Source #

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

ArrayObject QueryResult # 
Instance details

Defined in Ganeti.Query.Language

Methods

toJSArray :: QueryResult -> [JSValue] Source #

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

ArrayObject QueryFieldsResult # 
Instance details

Defined in Ganeti.Query.Language

Methods

toJSArray :: QueryFieldsResult -> [JSValue] Source #

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

ArrayObject INicParams # 
Instance details

Defined in Ganeti.OpParams

Methods

toJSArray :: INicParams -> [JSValue] Source #

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

ArrayObject IDiskParams # 
Instance details

Defined in Ganeti.OpParams

Methods

toJSArray :: IDiskParams -> [JSValue] Source #

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

ArrayObject CommonOpParams # 
Instance details

Defined in Ganeti.OpCodes

Methods

toJSArray :: CommonOpParams -> [JSValue] Source #

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

ArrayObject QueuedOpCode # 
Instance details

Defined in Ganeti.JQueue.Objects

Methods

toJSArray :: QueuedOpCode -> [JSValue] Source #

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

ArrayObject QueuedJob # 
Instance details

Defined in Ganeti.JQueue.Objects

Methods

toJSArray :: QueuedJob -> [JSValue] Source #

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

ArrayObject Disk # 
Instance details

Defined in Ganeti.Objects.Disk

Methods

toJSArray :: Disk -> [JSValue] Source #

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

ArrayObject ForthcomingDiskData # 
Instance details

Defined in Ganeti.Objects.Disk

Methods

toJSArray :: ForthcomingDiskData -> [JSValue] Source #

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

ArrayObject RealDiskData # 
Instance details

Defined in Ganeti.Objects.Disk

Methods

toJSArray :: RealDiskData -> [JSValue] Source #

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

ArrayObject Network # 
Instance details

Defined in Ganeti.Objects

Methods

toJSArray :: Network -> [JSValue] Source #

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

ArrayObject DataCollectorConfig # 
Instance details

Defined in Ganeti.Objects

Methods

toJSArray :: DataCollectorConfig -> [JSValue] Source #

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

ArrayObject PartialISpecParams # 
Instance details

Defined in Ganeti.Objects

Methods

toJSArray :: PartialISpecParams -> [JSValue] Source #

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

ArrayObject FilledISpecParams # 
Instance details

Defined in Ganeti.Objects

Methods

toJSArray :: FilledISpecParams -> [JSValue] Source #

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

ArrayObject MinMaxISpecs # 
Instance details

Defined in Ganeti.Objects

Methods

toJSArray :: MinMaxISpecs -> [JSValue] Source #

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

ArrayObject PartialIPolicy # 
Instance details

Defined in Ganeti.Objects

Methods

toJSArray :: PartialIPolicy -> [JSValue] Source #

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

ArrayObject FilledIPolicy # 
Instance details

Defined in Ganeti.Objects

Methods

toJSArray :: FilledIPolicy -> [JSValue] Source #

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

ArrayObject PartialNDParams # 
Instance details

Defined in Ganeti.Objects

Methods

toJSArray :: PartialNDParams -> [JSValue] Source #

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

ArrayObject FilledNDParams # 
Instance details

Defined in Ganeti.Objects

Methods

toJSArray :: FilledNDParams -> [JSValue] Source #

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

ArrayObject Node # 
Instance details

Defined in Ganeti.Objects

Methods

toJSArray :: Node -> [JSValue] Source #

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

ArrayObject NodeGroup # 
Instance details

Defined in Ganeti.Objects

Methods

toJSArray :: NodeGroup -> [JSValue] Source #

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

ArrayObject FilterRule # 
Instance details

Defined in Ganeti.Objects

Methods

toJSArray :: FilterRule -> [JSValue] Source #

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

ArrayObject Cluster # 
Instance details

Defined in Ganeti.Objects

Methods

toJSArray :: Cluster -> [JSValue] Source #

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

ArrayObject ConfigData # 
Instance details

Defined in Ganeti.Objects

Methods

toJSArray :: ConfigData -> [JSValue] Source #

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

ArrayObject MasterNetworkParameters # 
Instance details

Defined in Ganeti.Objects

ArrayObject DCStatus # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

toJSArray :: DCStatus -> [JSValue] Source #

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

ArrayObject DCReport # 
Instance details

Defined in Ganeti.DataCollectors.Types

Methods

toJSArray :: DCReport -> [JSValue] Source #

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

ArrayObject InstStatus # 
Instance details

Defined in Ganeti.DataCollectors.InstStatusTypes

Methods

toJSArray :: InstStatus -> [JSValue] Source #

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

ArrayObject ReportData # 
Instance details

Defined in Ganeti.DataCollectors.InstStatusTypes

Methods

toJSArray :: ReportData -> [JSValue] Source #

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

ArrayObject RpcCallInstanceInfo # 
Instance details

Defined in Ganeti.Rpc

Methods

toJSArray :: RpcCallInstanceInfo -> [JSValue] Source #

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

ArrayObject InstanceInfo # 
Instance details

Defined in Ganeti.Rpc

Methods

toJSArray :: InstanceInfo -> [JSValue] Source #

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

ArrayObject RpcResultInstanceInfo # 
Instance details

Defined in Ganeti.Rpc

Methods

toJSArray :: RpcResultInstanceInfo -> [JSValue] Source #

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

ArrayObject RpcCallAllInstancesInfo # 
Instance details

Defined in Ganeti.Rpc

ArrayObject RpcResultAllInstancesInfo # 
Instance details

Defined in Ganeti.Rpc

ArrayObject InstanceConsoleInfoParams # 
Instance details

Defined in Ganeti.Rpc

ArrayObject RpcCallInstanceConsoleInfo # 
Instance details

Defined in Ganeti.Rpc

ArrayObject InstanceConsoleInfo # 
Instance details

Defined in Ganeti.Rpc

Methods

toJSArray :: InstanceConsoleInfo -> [JSValue] Source #

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

ArrayObject RpcResultInstanceConsoleInfo # 
Instance details

Defined in Ganeti.Rpc

ArrayObject RpcCallInstanceList # 
Instance details

Defined in Ganeti.Rpc

Methods

toJSArray :: RpcCallInstanceList -> [JSValue] Source #

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

ArrayObject RpcResultInstanceList # 
Instance details

Defined in Ganeti.Rpc

Methods

toJSArray :: RpcResultInstanceList -> [JSValue] Source #

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

ArrayObject RpcCallNodeInfo # 
Instance details

Defined in Ganeti.Rpc

Methods

toJSArray :: RpcCallNodeInfo -> [JSValue] Source #

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

ArrayObject StorageInfo # 
Instance details

Defined in Ganeti.Rpc

Methods

toJSArray :: StorageInfo -> [JSValue] Source #

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

ArrayObject HvInfo # 
Instance details

Defined in Ganeti.Rpc

Methods

toJSArray :: HvInfo -> [JSValue] Source #

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

ArrayObject RpcResultNodeInfo # 
Instance details

Defined in Ganeti.Rpc

Methods

toJSArray :: RpcResultNodeInfo -> [JSValue] Source #

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

ArrayObject RpcCallVersion # 
Instance details

Defined in Ganeti.Rpc

Methods

toJSArray :: RpcCallVersion -> [JSValue] Source #

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

ArrayObject RpcResultVersion # 
Instance details

Defined in Ganeti.Rpc

Methods

toJSArray :: RpcResultVersion -> [JSValue] Source #

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

ArrayObject RpcCallStorageList # 
Instance details

Defined in Ganeti.Rpc

Methods

toJSArray :: RpcCallStorageList -> [JSValue] Source #

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

ArrayObject RpcResultStorageList # 
Instance details

Defined in Ganeti.Rpc

Methods

toJSArray :: RpcResultStorageList -> [JSValue] Source #

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

ArrayObject RpcCallTestDelay # 
Instance details

Defined in Ganeti.Rpc

Methods

toJSArray :: RpcCallTestDelay -> [JSValue] Source #

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

ArrayObject RpcCallExportList # 
Instance details

Defined in Ganeti.Rpc

Methods

toJSArray :: RpcCallExportList -> [JSValue] Source #

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

ArrayObject RpcResultExportList # 
Instance details

Defined in Ganeti.Rpc

Methods

toJSArray :: RpcResultExportList -> [JSValue] Source #

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

ArrayObject RpcCallJobqueueUpdate # 
Instance details

Defined in Ganeti.Rpc

Methods

toJSArray :: RpcCallJobqueueUpdate -> [JSValue] Source #

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

ArrayObject RpcCallJobqueueRename # 
Instance details

Defined in Ganeti.Rpc

Methods

toJSArray :: RpcCallJobqueueRename -> [JSValue] Source #

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

ArrayObject RpcCallSetWatcherPause # 
Instance details

Defined in Ganeti.Rpc

Methods

toJSArray :: RpcCallSetWatcherPause -> [JSValue] Source #

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

ArrayObject RpcCallSetDrainFlag # 
Instance details

Defined in Ganeti.Rpc

Methods

toJSArray :: RpcCallSetDrainFlag -> [JSValue] Source #

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

ArrayObject RpcCallUploadFile # 
Instance details

Defined in Ganeti.Rpc

Methods

toJSArray :: RpcCallUploadFile -> [JSValue] Source #

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

ArrayObject RpcCallWriteSsconfFiles # 
Instance details

Defined in Ganeti.Rpc

ArrayObject RpcCallNodeActivateMasterIp # 
Instance details

Defined in Ganeti.Rpc

ArrayObject RpcResultNodeActivateMasterIp # 
Instance details

Defined in Ganeti.Rpc

ArrayObject RpcCallMasterNodeName # 
Instance details

Defined in Ganeti.Rpc

Methods

toJSArray :: RpcCallMasterNodeName -> [JSValue] Source #

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

ArrayObject RpcResultMasterNodeName # 
Instance details

Defined in Ganeti.Rpc

ArrayObject TempResState # 
Instance details

Defined in Ganeti.WConfd.TempRes

Methods

toJSArray :: TempResState -> [JSValue] Source #

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

General purpose data types for working with JSON

newtype MaybeForJSON a Source #

A Maybe newtype that allows for serialization more appropriate to the semantics of Maybe and JSON in our calls. Does not produce needless and confusing dictionaries.

In particular, JSNull corresponds to Nothing. This also means that this `Maybe a` newtype should not be used with a values that themselves can serialize to null.

Constructors

MaybeForJSON 

Fields

Instances

Instances details
Eq a => Eq (MaybeForJSON a) # 
Instance details

Defined in Ganeti.JSON

Methods

(==) :: MaybeForJSON a -> MaybeForJSON a -> Bool

(/=) :: MaybeForJSON a -> MaybeForJSON a -> Bool

Ord a => Ord (MaybeForJSON a) # 
Instance details

Defined in Ganeti.JSON

Methods

compare :: MaybeForJSON a -> MaybeForJSON a -> Ordering

(<) :: MaybeForJSON a -> MaybeForJSON a -> Bool

(<=) :: MaybeForJSON a -> MaybeForJSON a -> Bool

(>) :: MaybeForJSON a -> MaybeForJSON a -> Bool

(>=) :: MaybeForJSON a -> MaybeForJSON a -> Bool

max :: MaybeForJSON a -> MaybeForJSON a -> MaybeForJSON a

min :: MaybeForJSON a -> MaybeForJSON a -> MaybeForJSON a

Show a => Show (MaybeForJSON a) # 
Instance details

Defined in Ganeti.JSON

Methods

showsPrec :: Int -> MaybeForJSON a -> ShowS

show :: MaybeForJSON a -> String

showList :: [MaybeForJSON a] -> ShowS

JSON a => JSON (MaybeForJSON a) # 
Instance details

Defined in Ganeti.JSON

Methods

readJSON :: JSValue -> Result (MaybeForJSON a)

showJSON :: MaybeForJSON a -> JSValue

readJSONs :: JSValue -> Result [MaybeForJSON a]

showJSONs :: [MaybeForJSON a] -> JSValue

Arbitrary a => Arbitrary (MaybeForJSON a) 
Instance details

Defined in Test.Ganeti.JSON

newtype TimeAsDoubleJSON Source #

Constructors

TimeAsDoubleJSON 

Fields

Instances

Instances details
Eq TimeAsDoubleJSON # 
Instance details

Defined in Ganeti.JSON

Ord TimeAsDoubleJSON # 
Instance details

Defined in Ganeti.JSON

Show TimeAsDoubleJSON # 
Instance details

Defined in Ganeti.JSON

Methods

showsPrec :: Int -> TimeAsDoubleJSON -> ShowS

show :: TimeAsDoubleJSON -> String

showList :: [TimeAsDoubleJSON] -> ShowS

JSON TimeAsDoubleJSON # 
Instance details

Defined in Ganeti.JSON

Methods

readJSON :: JSValue -> Result TimeAsDoubleJSON

showJSON :: TimeAsDoubleJSON -> JSValue

readJSONs :: JSValue -> Result [TimeAsDoubleJSON]

showJSONs :: [TimeAsDoubleJSON] -> JSValue

Arbitrary TimeAsDoubleJSON 
Instance details

Defined in Test.Ganeti.JSON

newtype Tuple5 a b c d e Source #

Constructors

Tuple5 

Fields

Instances

Instances details
(JSON a, JSON b, JSON c, JSON d, JSON e) => JSON (Tuple5 a b c d e) # 
Instance details

Defined in Ganeti.JSON

Methods

readJSON :: JSValue -> Result (Tuple5 a b c d e)

showJSON :: Tuple5 a b c d e -> JSValue

readJSONs :: JSValue -> Result [Tuple5 a b c d e]

showJSONs :: [Tuple5 a b c d e] -> JSValue

nestedAccessByKey :: [String] -> JSValue -> Result JSValue Source #

Look up a value in a JSON object. Accessing ["a", "b", "c"] on an object is equivalent as accessing myobject.a.b.c on a JavaScript object.

An error is returned if the object doesn't have such an accessor or if any value during the nested access is not an object at all.

nestedAccessByKeyDotted :: String -> JSValue -> Result JSValue Source #

Same as nestedAccessByKey, but accessing with a dotted string instead (like nestedAccessByKeyDotted "a.b.c").

branchOnField Source #

Arguments

:: String

fieldname to branch on

-> (JSValue -> Result a)

decoding function if field is present and true; field will already be removed in the input

-> (JSValue -> Result a)

decoding function otherwise

-> JSValue 
-> Result a 

Branch decoding on a field in a JSON object.

addField :: (String, JSValue) -> JSValue -> JSValue Source #

Add a field to a JSON object; to nothing, if the argument is not an object.

maybeParseMap :: JSON a => JSValue -> Maybe (Map String a) Source #

Maybe obtain a map from a JSON object.

Orphan instances

NFData JSValue # 
Instance details

Methods

rnf :: JSValue -> ()

NFData a => NFData (JSObject a) # 
Instance details

Methods

rnf :: JSObject a -> ()