language-puppet-1.4.6.3: Tools to parse and evaluate the Puppet DSL.

Safe HaskellNone
LanguageHaskell98

PuppetDB

Description

Common data types for PuppetDB.

Synopsis

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.

data PDBType 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.

Instances
Eq PDBType Source # 
Instance details

Defined in PuppetDB.Core

Methods

(==) :: PDBType -> PDBType -> Bool #

(/=) :: PDBType -> PDBType -> Bool #

Read PDBType Source # 
Instance details

Defined in PuppetDB.Core

data NodeInfo Source #

Instances
FromJSON NodeInfo Source # 
Instance details

Defined in PuppetDB.Core

Methods

parseJSON :: Value -> Parser NodeInfo

parseJSONList :: Value -> Parser [NodeInfo]

ToJSON NodeInfo Source # 
Instance details

Defined in PuppetDB.Core

Methods

toJSON :: NodeInfo -> Value

toEncoding :: NodeInfo -> Encoding

toJSONList :: [NodeInfo] -> Value

toEncodingList :: [NodeInfo] -> Encoding

HasNodeInfo NodeInfo Source # 
Instance details

Defined in PuppetDB.Core

class HasNodeInfo c where Source #

Minimal complete definition

nodeInfo

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 #

data Query a 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 # 
Instance details

Defined in PuppetDB.Core

Methods

parseJSON :: Value -> Parser (Query a)

parseJSONList :: Value -> Parser [Query a]

ToJSON a => ToJSON (Query a) Source # 
Instance details

Defined in PuppetDB.Core

Methods

toJSON :: Query a -> Value

toEncoding :: Query a -> Encoding

toJSONList :: [Query a] -> Value

toEncodingList :: [Query a] -> Encoding

ToJSON a => ToHttpApiData (Query a) Source # 
Instance details

Defined in PuppetDB.Core

data FactField Source #

Fields for the fact endpoint

Constructors

FName 
FValue 
FCertname 
Instances
FromJSON FactField Source # 
Instance details

Defined in PuppetDB.Core

Methods

parseJSON :: Value -> Parser FactField

parseJSONList :: Value -> Parser [FactField]

ToJSON FactField Source # 
Instance details

Defined in PuppetDB.Core

Methods

toJSON :: FactField -> Value

toEncoding :: FactField -> Encoding

toJSONList :: [FactField] -> Value

toEncodingList :: [FactField] -> Encoding

data NodeField Source #

Fields for the node endpoint

Constructors

NName 
NFact Text 
Instances
FromJSON NodeField Source # 
Instance details

Defined in PuppetDB.Core

Methods

parseJSON :: Value -> Parser NodeField

parseJSONList :: Value -> Parser [NodeField]

ToJSON NodeField Source # 
Instance details

Defined in PuppetDB.Core

Methods

toJSON :: NodeField -> Value

toEncoding :: NodeField -> Encoding

toJSONList :: [NodeField] -> Value

toEncodingList :: [NodeField] -> Encoding

data ResourceField Source #

Fields for the resource endpoint

Instances
FromJSON ResourceField Source # 
Instance details

Defined in PuppetDB.Core

Methods

parseJSON :: Value -> Parser ResourceField

parseJSONList :: Value -> Parser [ResourceField]

ToJSON ResourceField Source # 
Instance details

Defined in PuppetDB.Core

Methods

toJSON :: ResourceField -> Value

toEncoding :: ResourceField -> Encoding

toJSONList :: [ResourceField] -> Value

toEncodingList :: [ResourceField] -> Encoding