| Safe Haskell | None |
|---|---|
| Language | Haskell98 |
PuppetDB
Description
Common data types for PuppetDB.
- dummyPuppetDB :: Monad m => PuppetDBAPI m
- getDefaultDB :: PDBType -> IO (Either PrettyError (PuppetDBAPI IO))
- pdbConnect :: Manager -> String -> IO (Either PrettyError (PuppetDBAPI IO))
- loadTestDB :: FilePath -> IO (Either PrettyError (PuppetDBAPI IO))
- generateWireCatalog :: NodeName -> FinalCatalog -> EdgeMap -> WireCatalog
- puppetDBFacts :: NodeName -> PuppetDBAPI IO -> IO (HashMap Text PValue)
- data PDBType
- data NodeInfo = NodeInfo {
- _nodeInfoName :: !NodeName
- _nodeInfoDeactivated :: !Bool
- _nodeInfoCatalogT :: !(Maybe UTCTime)
- _nodeInfoFactsT :: !(Maybe UTCTime)
- _nodeInfoReportT :: !(Maybe UTCTime)
- class HasNodeInfo c where
- data Query a
- data FactField
- data NodeField
- data ResourceField
- data PuppetDBAPI m = PuppetDBAPI {
- pdbInformation :: m Doc
- replaceCatalog :: WireCatalog -> ExceptT PrettyError m ()
- replaceFacts :: [(NodeName, Facts)] -> ExceptT PrettyError m ()
- deactivateNode :: NodeName -> ExceptT PrettyError m ()
- getFacts :: Query FactField -> ExceptT PrettyError m [FactInfo]
- getResources :: Query ResourceField -> ExceptT PrettyError m [Resource]
- getNodes :: Query NodeField -> ExceptT PrettyError m [NodeInfo]
- commitDB :: ExceptT PrettyError m ()
- getResourcesOfNode :: NodeName -> Query ResourceField -> ExceptT PrettyError m [Resource]
Documentation
dummyPuppetDB :: Monad m => PuppetDBAPI m #
A dummy implementation of PuppetDBAPI, that will return empty responses.
getDefaultDB :: PDBType -> IO (Either PrettyError (PuppetDBAPI IO)) #
Given a PDBType, will try return a sane default implementation.
pdbConnect :: Manager -> String -> IO (Either PrettyError (PuppetDBAPI IO)) #
Given an URL (ie. http://localhost:8080), will return an incomplete PuppetDBAPI.
loadTestDB :: FilePath -> IO (Either PrettyError (PuppetDBAPI IO)) #
Initializes the test DB using a file to back its content
generateWireCatalog :: NodeName -> FinalCatalog -> EdgeMap -> WireCatalog #
Turns a FinalCatalog and EdgeMap into a document that can be
serialized and fed to puppet apply.
puppetDBFacts :: NodeName -> PuppetDBAPI IO -> IO (HashMap Text PValue) #
The supported PuppetDB implementations.
Constructors
| NodeInfo | |
Fields
| |
class HasNodeInfo c where #
Minimal complete definition
Methods
nodeInfo :: Lens' c NodeInfo #
nodeInfoCatalogT :: Lens' c (Maybe UTCTime) #
nodeInfoDeactivated :: Lens' c Bool #
nodeInfoFactsT :: Lens' c (Maybe UTCTime) #
nodeInfoName :: Lens' c NodeName #
nodeInfoReportT :: Lens' c (Maybe UTCTime) #
Instances
Pretty straightforward way to define the various PuppetDB queries
Fields for the fact endpoint
Fields for the node endpoint
data PuppetDBAPI m #
Constructors
| PuppetDBAPI | |
Fields
| |