Safe Haskell | None |
---|
- metaparameters :: HashSet Text
- type Nodename = Text
- type Container = HashMap Text
- data PValue
- data HieraQueryType
- = Priority
- | ArrayMerge
- | HashMerge
- type HieraQueryFunc m = Container Text -> Text -> HieraQueryType -> m (Either Doc (Pair InterpreterWriter (Maybe PValue)))
- data RSearchExpression
- data ClassIncludeType
- type Scope = Text
- type Facts = Container Text
- data TopLevelType
- = TopNode
- | TopDefine
- | TopClass
- | TopSpurious
- data ResDefaults = ResDefaults {
- _defType :: !Text
- _defSrcScope :: !Text
- _defValues :: !(Container PValue)
- _defPos :: !PPosition
- data CurContainerDesc
- = ContRoot
- | ContClass !Text
- | ContDefine !Text !Text !PPosition
- | ContImported !CurContainerDesc
- | ContImport !Nodename !CurContainerDesc
- data CurContainer = CurContainer {
- _cctype :: !CurContainerDesc
- _cctags :: !(HashSet Text)
- data ResRefOverride = ResRefOverride {}
- data ScopeInformation = ScopeInformation {}
- data InterpreterState = InterpreterState {
- _scopes :: !(Container ScopeInformation)
- _loadedClasses :: !(Container (Pair ClassIncludeType PPosition))
- _definedResources :: !(HashMap RIdentifier Resource)
- _curScope :: ![CurContainerDesc]
- _curPos :: !PPosition
- _nestedDeclarations :: !(HashMap (TopLevelType, Text) Statement)
- _extraRelations :: ![LinkInformation]
- _resMod :: ![ResourceModifier]
- data InterpreterReader m = InterpreterReader {
- _nativeTypes :: !(Container PuppetTypeMethods)
- _getStatement :: TopLevelType -> Text -> m (Either Doc Statement)
- _computeTemplateFunction :: Either Text Text -> Text -> Container ScopeInformation -> m (Either Doc Text)
- _pdbAPI :: PuppetDBAPI m
- _externalFunctions :: Container ([PValue] -> InterpreterMonad PValue)
- _thisNodename :: Text
- _hieraQuery :: HieraQueryFunc m
- _ioMethods :: ImpureMethods m
- data ImpureMethods m = ImpureMethods {
- _imGetCurrentCallStack :: m [String]
- _imReadFile :: [Text] -> m (Either String Text)
- _imTraceEvent :: String -> m ()
- _imCallLua :: MVar LuaState -> Text -> [PValue] -> m (Either String PValue)
- data InterpreterInstr a where
- GetNativeTypes :: InterpreterInstr (Container PuppetTypeMethods)
- GetStatement :: TopLevelType -> Text -> InterpreterInstr Statement
- ComputeTemplate :: Either Text Text -> Text -> Container ScopeInformation -> InterpreterInstr Text
- ExternalFunction :: Text -> [PValue] -> InterpreterInstr PValue
- GetNodeName :: InterpreterInstr Text
- HieraQuery :: Container Text -> Text -> HieraQueryType -> InterpreterInstr (Pair InterpreterWriter (Maybe PValue))
- GetCurrentCallStack :: InterpreterInstr [String]
- ErrorThrow :: Doc -> InterpreterInstr a
- ErrorCatch :: InterpreterMonad a -> (Doc -> InterpreterMonad a) -> InterpreterInstr a
- WriterTell :: InterpreterWriter -> InterpreterInstr ()
- WriterPass :: InterpreterMonad (a, InterpreterWriter -> InterpreterWriter) -> InterpreterInstr a
- WriterListen :: InterpreterMonad a -> InterpreterInstr (a, InterpreterWriter)
- PDBInformation :: InterpreterInstr Doc
- PDBReplaceCatalog :: WireCatalog -> InterpreterInstr ()
- PDBReplaceFacts :: [(Nodename, Facts)] -> InterpreterInstr ()
- PDBDeactivateNode :: Nodename -> InterpreterInstr ()
- PDBGetFacts :: Query FactField -> InterpreterInstr [PFactInfo]
- PDBGetResources :: Query ResourceField -> InterpreterInstr [Resource]
- PDBGetNodes :: Query NodeField -> InterpreterInstr [PNodeInfo]
- PDBCommitDB :: InterpreterInstr ()
- PDBGetResourcesOfNode :: Nodename -> Query ResourceField -> InterpreterInstr [Resource]
- ReadFile :: [Text] -> InterpreterInstr Text
- TraceEvent :: String -> InterpreterInstr ()
- CallLua :: MVar LuaState -> Text -> [PValue] -> InterpreterInstr PValue
- newtype Warning = Warning Doc
- type InterpreterLog = Pair Priority Doc
- type InterpreterWriter = [InterpreterLog]
- warn :: (Monad m, MonadWriter InterpreterWriter m) => Doc -> m ()
- debug :: (Monad m, MonadWriter InterpreterWriter m) => Doc -> m ()
- logWriter :: (Monad m, MonadWriter InterpreterWriter m) => Priority -> Doc -> m ()
- type InterpreterMonad = ProgramT InterpreterInstr (State InterpreterState)
- data RIdentifier = RIdentifier {}
- data LinkType
- = RNotify
- | RRequire
- | RBefore
- | RSubscribe
- data ModifierType
- data OverrideType
- = CantOverride
- | Replace
- | CantReplace
- data ResourceCollectorType
- data ResourceModifier = ResourceModifier {}
- data LinkInformation = LinkInformation {
- _linksrc :: !RIdentifier
- _linkdst :: !RIdentifier
- _linkType :: !LinkType
- _linkPos :: !PPosition
- type EdgeMap = HashMap RIdentifier [LinkInformation]
- data Resource = Resource {
- _rid :: !RIdentifier
- _ralias :: !(HashSet Text)
- _rattributes :: !(Container PValue)
- _rrelations :: !(HashMap RIdentifier (HashSet LinkType))
- _rscope :: ![CurContainerDesc]
- _rvirtuality :: !Virtuality
- _rtags :: !(HashSet Text)
- _rpos :: !PPosition
- _rnode :: !Nodename
- type PuppetTypeValidate = Resource -> Either Doc Resource
- data PuppetTypeMethods = PuppetTypeMethods {}
- type FinalCatalog = HashMap RIdentifier Resource
- data DaemonMethods = DaemonMethods {
- _dGetCatalog :: Text -> Facts -> IO (Either Doc (FinalCatalog, EdgeMap, FinalCatalog, [Resource]))
- _dParserStats :: MStats
- _dCatalogStats :: MStats
- _dTemplateStats :: MStats
- data PuppetEdge = PuppetEdge RIdentifier RIdentifier LinkType
- data WireCatalog = WireCatalog {}
- data PFactInfo = PFactInfo {}
- data PNodeInfo = PNodeInfo {}
- data PuppetDBAPI m = PuppetDBAPI {
- pdbInformation :: m Doc
- replaceCatalog :: WireCatalog -> m (Either Doc ())
- replaceFacts :: [(Nodename, Facts)] -> m (Either Doc ())
- deactivateNode :: Nodename -> m (Either Doc ())
- getFacts :: Query FactField -> m (Either Doc [PFactInfo])
- getResources :: Query ResourceField -> m (Either Doc [Resource])
- getNodes :: Query NodeField -> m (Either Doc [PNodeInfo])
- commitDB :: m (Either Doc ())
- getResourcesOfNode :: Nodename -> Query ResourceField -> m (Either Doc [Resource])
- data Query a
- data FactField
- data NodeField
- data ResourceField
- class HasRIdentifier t where
- rIdentifier :: Lens' t RIdentifier
- iname :: Lens' t Text
- itype :: Lens' t Text
- class HasResRefOverride t where
- resRefOverride :: Lens' t ResRefOverride
- rrid :: Lens' t RIdentifier
- rrparams :: Lens' t (Container PValue)
- rrpos :: Lens' t PPosition
- class HasLinkInformation t where
- linkInformation :: Lens' t LinkInformation
- linkPos :: Lens' t PPosition
- linkType :: Lens' t LinkType
- linkdst :: Lens' t RIdentifier
- linksrc :: Lens' t RIdentifier
- class HasResDefaults t where
- class HasResourceModifier t where
- resourceModifier :: Lens' t ResourceModifier
- rmDeclaration :: Lens' t PPosition
- rmModifierType :: Lens' t ModifierType
- rmMutation :: Lens' t (Resource -> InterpreterMonad Resource)
- rmResType :: Lens' t Text
- rmSearch :: Lens' t RSearchExpression
- rmType :: Lens' t ResourceCollectorType
- class HasDaemonMethods t where
- daemonMethods :: Lens' t DaemonMethods
- dCatalogStats :: Lens' t MStats
- dGetCatalog :: Lens' t (Text -> Facts -> IO (Either Doc (FinalCatalog, EdgeMap, FinalCatalog, [Resource])))
- dParserStats :: Lens' t MStats
- dTemplateStats :: Lens' t MStats
- class HasPuppetTypeMethods t where
- class HasScopeInformation t where
- scopeInformation :: Lens' t ScopeInformation
- scopeContainer :: Lens' t CurContainer
- scopeDefaults :: Lens' t (Container ResDefaults)
- scopeExtraTags :: Lens' t (HashSet Text)
- scopeOverrides :: Lens' t (HashMap RIdentifier ResRefOverride)
- scopeParent :: Lens' t (Maybe Text)
- scopeVariables :: Lens' t (Container (Pair (Pair PValue PPosition) CurContainerDesc))
- class HasResource t where
- resource :: Lens' t Resource
- ralias :: Lens' t (HashSet Text)
- rattributes :: Lens' t (Container PValue)
- rid :: Lens' t RIdentifier
- rnode :: Lens' t Nodename
- rpos :: Lens' t PPosition
- rrelations :: Lens' t (HashMap RIdentifier (HashSet LinkType))
- rscope :: Lens' t [CurContainerDesc]
- rtags :: Lens' t (HashSet Text)
- rvirtuality :: Lens' t Virtuality
- class HasInterpreterState t where
- interpreterState :: Lens' t InterpreterState
- curPos :: Lens' t PPosition
- curScope :: Lens' t [CurContainerDesc]
- definedResources :: Lens' t (HashMap RIdentifier Resource)
- extraRelations :: Lens' t [LinkInformation]
- loadedClasses :: Lens' t (Container (Pair ClassIncludeType PPosition))
- nestedDeclarations :: Lens' t (HashMap (TopLevelType, Text) Statement)
- resMod :: Lens' t [ResourceModifier]
- scopes :: Lens' t (Container ScopeInformation)
- class HasInterpreterReader t m | t -> m where
- interpreterReader :: Lens' t (InterpreterReader m)
- computeTemplateFunction :: Lens' t (Either Text Text -> Text -> Container ScopeInformation -> m (Either Doc Text))
- externalFunctions :: Lens' t (Container ([PValue] -> InterpreterMonad PValue))
- getStatement :: Lens' t (TopLevelType -> Text -> m (Either Doc Statement))
- hieraQuery :: Lens' t (HieraQueryFunc m)
- ioMethods :: Lens' t (ImpureMethods m)
- nativeTypes :: Lens' t (Container PuppetTypeMethods)
- pdbAPI :: Lens' t (PuppetDBAPI m)
- thisNodename :: Lens' t Text
- class HasImpureMethods t m | t -> m where
- impureMethods :: Lens' t (ImpureMethods m)
- imCallLua :: Lens' t (MVar LuaState -> Text -> [PValue] -> m (Either String PValue))
- imGetCurrentCallStack :: Lens' t (m [String])
- imReadFile :: Lens' t ([Text] -> m (Either String Text))
- imTraceEvent :: Lens' t (String -> m ())
- class HasCurContainer t where
- curContainer :: Lens' t CurContainer
- cctags :: Lens' t (HashSet Text)
- cctype :: Lens' t CurContainerDesc
- class HasNodename c e | c -> e where
- class HasWVersion c e | c -> e where
- class HasWEdges c e | c -> e where
- class HasWResources c e | c -> e where
- wResources :: Lens' c e
- class HasTransactionUUID c e | c -> e where
- transactionUUID :: Lens' c e
- _wirecatalogWVersionLens :: Lens' WireCatalog Text
- _wirecatalogWResourcesLens :: Lens' WireCatalog (Vector Resource)
- _wirecatalogWEdgesLens :: Lens' WireCatalog (Vector PuppetEdge)
- _wirecatalogTransactionUUIDLens :: Lens' WireCatalog Text
- _wirecatalogNodenameLens :: Lens' WireCatalog Nodename
- class HasFactname c e | c -> e where
- class HasFactval c e | c -> e where
- _pfactinfoNodenameLens :: Lens' PFactInfo Text
- _pfactinfoFactvalLens :: Lens' PFactInfo Text
- _pfactinfoFactnameLens :: Lens' PFactInfo Text
- class HasDeactivated c e | c -> e where
- deactivated :: Lens' c e
- class HasCatalogT c e | c -> e where
- class HasFactsT c e | c -> e where
- class HasReportT c e | c -> e where
- _pnodeinfoReportTLens :: Lens' PNodeInfo (Maybe UTCTime)
- _pnodeinfoNodenameLens :: Lens' PNodeInfo Nodename
- _pnodeinfoFactsTLens :: Lens' PNodeInfo (Maybe UTCTime)
- _pnodeinfoDeactivatedLens :: Lens' PNodeInfo Bool
- _pnodeinfoCatalogTLens :: Lens' PNodeInfo (Maybe UTCTime)
- rcurcontainer :: Resource -> CurContainerDesc
- class MonadThrowPos m where
- throwPosError :: Doc -> m a
- class MonadStack m where
- getCallStack :: m [String]
- tpe :: (MonadStack m, MonadError Doc m, MonadState InterpreterState m) => Doc -> m b
- getCurContainer :: InterpreterMonad CurContainer
- scopeName :: CurContainerDesc -> Text
- getScopeName :: InterpreterMonad Text
- getScope :: InterpreterMonad CurContainerDesc
- eitherDocIO :: IO (Either Doc a) -> IO (Either Doc a)
- interpreterIO :: (MonadThrowPos m, MonadIO m) => IO (Either Doc a) -> m a
- mightFail :: (MonadError Doc m, MonadThrowPos m) => m (Either Doc a) -> m a
- safeDecodeUtf8 :: ByteString -> InterpreterMonad Text
- interpreterError :: InterpreterMonad (Either Doc a) -> InterpreterMonad a
- resourceRelations :: Resource -> [(RIdentifier, LinkType)]
- ifromList :: (Monoid m, At m) => [(Index m, IxValue m)] -> m
- ikeys :: (Eq k, Hashable k) => HashMap k v -> HashSet k
- isingleton :: (Monoid b, At b) => Index b -> IxValue b -> b
- ifromListWith :: (Monoid m, At m) => (IxValue m -> IxValue m -> IxValue m) -> [(Index m, IxValue m)] -> m
- iinsertWith :: At m => (IxValue m -> IxValue m -> IxValue m) -> Index m -> IxValue m -> m -> m
- iunionWith :: (Hashable k, Eq k) => (v -> v -> v) -> HashMap k v -> HashMap k v -> HashMap k v
- fnull :: (Eq x, Monoid x) => x -> Bool
- rel2text :: LinkType -> Text
- rid2text :: RIdentifier -> Text
- text2Scientific :: Text -> Maybe Scientific
- scientific2Number :: Scientific -> Number
- text2Number :: Text -> Maybe Number
Documentation
data HieraQueryType Source
The different kind of hiera queries
Priority | standard hiera query |
ArrayMerge | hiera_array |
HashMerge | hiera_hash |
type HieraQueryFunc mSource
= Container Text | All the variables that Hiera can interpolate, the top level ones being prefixed with :: |
-> Text | The query |
-> HieraQueryType | |
-> m (Either Doc (Pair InterpreterWriter (Maybe PValue))) |
The type of the Hiera API function
data RSearchExpression Source
data TopLevelType Source
This type is used to differenciate the distinct top level types that are exposed by the DSL.
TopNode | This is for node entries. |
TopDefine | This is for defines. |
TopClass | This is for classes. |
TopSpurious | This one is special. It represents top level statements that are not part of a node, define or class. It is defined as spurious because it is not what you are supposed to be. Also the caching system doesn't like them too much right now. |
data ResDefaults Source
ResDefaults | |
|
data CurContainerDesc Source
ContRoot | Contained at node or root level |
ContClass !Text | Contained in a class |
ContDefine !Text !Text !PPosition | Contained in a define, along with the position where this define was ... defined |
ContImported !CurContainerDesc | Dummy container for imported resources, so that we know we must update the nodename |
ContImport !Nodename !CurContainerDesc | This one is used when finalizing imported resources, and contains the current node name |
data CurContainer Source
CurContainer | |
|
data ScopeInformation Source
ScopeInformation | |
|
data InterpreterState Source
InterpreterState | |
|
data InterpreterReader m Source
InterpreterReader | |
|
data ImpureMethods m Source
ImpureMethods | |
|
HasImpureMethods (ImpureMethods m0) m0 |
data InterpreterInstr a whereSource
type InterpreterLog = Pair Priority DocSource
type InterpreterWriter = [InterpreterLog]Source
warn :: (Monad m, MonadWriter InterpreterWriter m) => Doc -> m ()Source
debug :: (Monad m, MonadWriter InterpreterWriter m) => Doc -> m ()Source
logWriter :: (Monad m, MonadWriter InterpreterWriter m) => Priority -> Doc -> m ()Source
type InterpreterMonad = ProgramT InterpreterInstr (State InterpreterState)Source
The main monad
Relationship link type.
data ModifierType Source
ModifierCollector | For collectors, optional resources |
ModifierMustMatch | For stuff like realize |
data OverrideType Source
CantOverride | Overriding forbidden, will throw an error |
Replace | Can silently replace |
CantReplace | Silently ignore errors |
data ResourceModifier Source
data LinkInformation Source
LinkInformation | |
|
type EdgeMap = HashMap RIdentifier [LinkInformation]Source
This is a fully resolved resource that will be used in the
FinalCatalog
.
Resource | |
|
type PuppetTypeValidate = Resource -> Either Doc ResourceSource
This is a function type than can be bound. It is the type of all subsequent validators.
data PuppetTypeMethods Source
data DaemonMethods Source
DaemonMethods | |
|
data PuppetEdge Source
PNodeInfo | |
|
data PuppetDBAPI m Source
PuppetDBAPI | |
|
Pretty straightforward way to define the various PuppetDB queries
Fields for the fact endpoint
Fields for the node endpoint
data ResourceField Source
Fields for the resource endpoint
class HasRIdentifier t whereSource
class HasResRefOverride t whereSource
class HasLinkInformation t whereSource
class HasResDefaults t whereSource
class HasResourceModifier t whereSource
class HasDaemonMethods t whereSource
daemonMethods :: Lens' t DaemonMethodsSource
dCatalogStats :: Lens' t MStatsSource
dGetCatalog :: Lens' t (Text -> Facts -> IO (Either Doc (FinalCatalog, EdgeMap, FinalCatalog, [Resource])))Source
class HasPuppetTypeMethods t whereSource
class HasScopeInformation t whereSource
scopeInformation :: Lens' t ScopeInformationSource
scopeContainer :: Lens' t CurContainerSource
scopeDefaults :: Lens' t (Container ResDefaults)Source
scopeExtraTags :: Lens' t (HashSet Text)Source
scopeOverrides :: Lens' t (HashMap RIdentifier ResRefOverride)Source
scopeParent :: Lens' t (Maybe Text)Source
scopeVariables :: Lens' t (Container (Pair (Pair PValue PPosition) CurContainerDesc))Source
class HasResource t whereSource
resource :: Lens' t ResourceSource
ralias :: Lens' t (HashSet Text)Source
rattributes :: Lens' t (Container PValue)Source
rid :: Lens' t RIdentifierSource
rnode :: Lens' t NodenameSource
rpos :: Lens' t PPositionSource
rrelations :: Lens' t (HashMap RIdentifier (HashSet LinkType))Source
rscope :: Lens' t [CurContainerDesc]Source
class HasInterpreterState t whereSource
interpreterState :: Lens' t InterpreterStateSource
curPos :: Lens' t PPositionSource
curScope :: Lens' t [CurContainerDesc]Source
definedResources :: Lens' t (HashMap RIdentifier Resource)Source
extraRelations :: Lens' t [LinkInformation]Source
loadedClasses :: Lens' t (Container (Pair ClassIncludeType PPosition))Source
nestedDeclarations :: Lens' t (HashMap (TopLevelType, Text) Statement)Source
resMod :: Lens' t [ResourceModifier]Source
class HasInterpreterReader t m | t -> m whereSource
interpreterReader :: Lens' t (InterpreterReader m)Source
computeTemplateFunction :: Lens' t (Either Text Text -> Text -> Container ScopeInformation -> m (Either Doc Text))Source
externalFunctions :: Lens' t (Container ([PValue] -> InterpreterMonad PValue))Source
getStatement :: Lens' t (TopLevelType -> Text -> m (Either Doc Statement))Source
hieraQuery :: Lens' t (HieraQueryFunc m)Source
ioMethods :: Lens' t (ImpureMethods m)Source
nativeTypes :: Lens' t (Container PuppetTypeMethods)Source
pdbAPI :: Lens' t (PuppetDBAPI m)Source
thisNodename :: Lens' t TextSource
class HasImpureMethods t m | t -> m whereSource
impureMethods :: Lens' t (ImpureMethods m)Source
imCallLua :: Lens' t (MVar LuaState -> Text -> [PValue] -> m (Either String PValue))Source
imGetCurrentCallStack :: Lens' t (m [String])Source
imReadFile :: Lens' t ([Text] -> m (Either String Text))Source
imTraceEvent :: Lens' t (String -> m ())Source
HasImpureMethods (ImpureMethods m0) m0 |
class HasCurContainer t whereSource
curContainer :: Lens' t CurContainerSource
class HasNodename c e | c -> e whereSource
class HasWResources c e | c -> e whereSource
wResources :: Lens' c eSource
class HasTransactionUUID c e | c -> e whereSource
transactionUUID :: Lens' c eSource
class HasDeactivated c e | c -> e whereSource
deactivated :: Lens' c eSource
class HasCatalogT c e | c -> e whereSource
class HasReportT c e | c -> e whereSource
tpe :: (MonadStack m, MonadError Doc m, MonadState InterpreterState m) => Doc -> m bSource
interpreterIO :: (MonadThrowPos m, MonadIO m) => IO (Either Doc a) -> m aSource
mightFail :: (MonadError Doc m, MonadThrowPos m) => m (Either Doc a) -> m aSource
interpreterError :: InterpreterMonad (Either Doc a) -> InterpreterMonad aSource
resourceRelations :: Resource -> [(RIdentifier, LinkType)]Source
ifromList :: (Monoid m, At m) => [(Index m, IxValue m)] -> mSource
helper for hashmap, in case we want another kind of map ..
ifromListWith :: (Monoid m, At m) => (IxValue m -> IxValue m -> IxValue m) -> [(Index m, IxValue m)] -> mSource
iinsertWith :: At m => (IxValue m -> IxValue m -> IxValue m) -> Index m -> IxValue m -> m -> mSource
iunionWith :: (Hashable k, Eq k) => (v -> v -> v) -> HashMap k v -> HashMap k v -> HashMap k vSource
rid2text :: RIdentifier -> TextSource
text2Number :: Text -> Maybe NumberSource