| Safe Haskell | None |
|---|---|
| Language | Haskell98 |
PuppetDB
Description
Common data types for PuppetDB.
Synopsis
- 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
- 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)
- 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 ()
- getPDBFacts :: 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 Source #
A dummy implementation of PuppetDBAPI, that will return empty responses.
getDefaultDB :: PDBType -> IO (Either PrettyError (PuppetDBAPI IO)) Source #
Given a PDBType, will try return a sane default implementation.
pdbConnect :: Manager -> String -> IO (Either PrettyError (PuppetDBAPI IO)) Source #
Given an URL (ie. http://localhost:8080), will return an incomplete PuppetDBAPI.
loadTestDB :: FilePath -> IO (Either PrettyError (PuppetDBAPI IO)) Source #
Initializes the test DB using a file to back its content
generateWireCatalog :: NodeName -> FinalCatalog -> EdgeMap -> WireCatalog Source #
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) Source #
The supported PuppetDB implementations.
Constructors
| PDBRemote | Your standard PuppetDB, queried through the HTTP interface. |
| PDBDummy | A stupid stub, this is the default choice. |
| PDBTest | A slow but handy PuppetDB implementation that is backed by a YAML file. |
Constructors
| NodeInfo | |
Fields
| |
Instances
| FromJSON NodeInfo Source # | |
Defined in PuppetDB.Core | |
| ToJSON NodeInfo Source # | |
Defined in PuppetDB.Core Methods toEncoding :: NodeInfo -> Encoding toJSONList :: [NodeInfo] -> Value toEncodingList :: [NodeInfo] -> Encoding | |
| HasNodeInfo NodeInfo Source # | |
Defined in PuppetDB.Core Methods nodeInfo :: Lens' NodeInfo NodeInfo Source # nodeInfoCatalogT :: Lens' NodeInfo (Maybe UTCTime) Source # nodeInfoDeactivated :: Lens' NodeInfo Bool Source # nodeInfoFactsT :: Lens' NodeInfo (Maybe UTCTime) Source # nodeInfoName :: Lens' NodeInfo NodeName Source # nodeInfoReportT :: Lens' NodeInfo (Maybe UTCTime) Source # | |
class HasNodeInfo c where Source #
Minimal complete definition
Methods
nodeInfo :: Lens' c NodeInfo Source #
nodeInfoCatalogT :: Lens' c (Maybe UTCTime) Source #
nodeInfoDeactivated :: Lens' c Bool Source #
nodeInfoFactsT :: Lens' c (Maybe UTCTime) Source #
nodeInfoName :: Lens' c NodeName Source #
nodeInfoReportT :: Lens' c (Maybe UTCTime) Source #
Instances
| HasNodeInfo NodeInfo Source # | |
Defined in PuppetDB.Core Methods nodeInfo :: Lens' NodeInfo NodeInfo Source # nodeInfoCatalogT :: Lens' NodeInfo (Maybe UTCTime) Source # nodeInfoDeactivated :: Lens' NodeInfo Bool Source # nodeInfoFactsT :: Lens' NodeInfo (Maybe UTCTime) Source # nodeInfoName :: Lens' NodeInfo NodeName Source # nodeInfoReportT :: Lens' NodeInfo (Maybe UTCTime) Source # | |
Pretty straightforward way to define the various PuppetDB queries
Constructors
| QEqual a Text | |
| QG a Integer | |
| QL a Integer | |
| QGE a Integer | |
| QLE a Integer | |
| QMatch Text Text | |
| QAnd [Query a] | |
| QOr [Query a] | |
| QNot (Query a) | |
| QEmpty |
Instances
| FromJSON a => FromJSON (Query a) Source # | |
Defined in PuppetDB.Core | |
| ToJSON a => ToJSON (Query a) Source # | |
Defined in PuppetDB.Core Methods toEncoding :: Query a -> Encoding toJSONList :: [Query a] -> Value toEncodingList :: [Query a] -> Encoding | |
| ToJSON a => ToHttpApiData (Query a) Source # | |
Defined in PuppetDB.Core Methods toUrlPiece :: Query a -> Text toEncodedUrlPiece :: Query a -> Builder toHeader :: Query a -> ByteString toQueryParam :: Query a -> Text | |
Fields for the fact endpoint
Instances
| FromJSON FactField Source # | |
Defined in PuppetDB.Core | |
| ToJSON FactField Source # | |
Defined in PuppetDB.Core Methods toEncoding :: FactField -> Encoding toJSONList :: [FactField] -> Value toEncodingList :: [FactField] -> Encoding | |
Fields for the node endpoint
Instances
| FromJSON NodeField Source # | |
Defined in PuppetDB.Core | |
| ToJSON NodeField Source # | |
Defined in PuppetDB.Core Methods toEncoding :: NodeField -> Encoding toJSONList :: [NodeField] -> Value toEncodingList :: [NodeField] -> Encoding | |
data ResourceField Source #
Fields for the resource endpoint
Instances
| FromJSON ResourceField Source # | |
Defined in PuppetDB.Core | |
| ToJSON ResourceField Source # | |
Defined in PuppetDB.Core Methods toJSON :: ResourceField -> Value toEncoding :: ResourceField -> Encoding toJSONList :: [ResourceField] -> Value toEncodingList :: [ResourceField] -> Encoding | |
data PuppetDBAPI m Source #
Constructors
| PuppetDBAPI | |
Fields
| |