| Safe Haskell | None |
|---|---|
| Language | Haskell98 |
Puppet.Language
Description
General puppet language specification.
This module doesn't depend on any other project modules (except for XPrelude). It serves as a common bridge that can be used in PuppetDB or Facter as well as in Puppet.Interpreter or Puppet.Parser.
- showPos :: Position -> Doc
- showPPos :: PPosition -> Doc
- showPPos' :: PPosition -> String
- initialPPos :: FilePath -> PPosition
- type PPosition = Pair Position Position
- type Position = SourcePos
- type NodeName = Text
- type Scope = Text
- data CompRegex = CompRegex !Text !Regex
- stringEscape :: Text -> Text
- capitalizeR :: Text -> Doc
- capitalizeRT :: Text -> Text
- containerComma'' :: Pretty a => [(Doc, a)] -> Doc
- containerComma' :: Pretty a => [(Doc, a)] -> Doc
- containerComma :: Pretty a => Container a -> Doc
- _sourceName :: Lens' Position String
- _sourceLine :: Lens' Position Pos
- _sourceColumn :: Lens' Position Pos
- toPPos :: Text -> Int -> PPosition
- baseNativeTypes :: Container NativeTypeMethods
- defaulttype :: NativeTypeName -> (NativeTypeName, NativeTypeMethods)
- data NativeTypeMethods
- type NativeTypeName = Text
- class HasNativeTypeMethods c where
- data PuppetDirPaths = PuppetDirPaths {}
- class HasPuppetDirPaths c where
- puppetPaths :: FilePath -> PuppetDirPaths
- 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
- class HasResource c where
- data RIdentifier = RIdentifier {}
- class HasRIdentifier c where
- data LinkInformation = LinkInformation {
- _linksrc :: !RIdentifier
- _linkdst :: !RIdentifier
- _linkType :: !LinkType
- _linkPos :: !PPosition
- class HasLinkInformation c where
- data LinkType
- = RRequire
- | RBefore
- | RNotify
- | RSubscribe
- data Virtuality
- data CurContainerDesc
- type FinalCatalog = HashMap RIdentifier Resource
- type EdgeMap = HashMap RIdentifier [LinkInformation]
- data DataType
- = DTType
- | DTString (Maybe Int) (Maybe Int)
- | DTInteger (Maybe Int) (Maybe Int)
- | DTFloat (Maybe Double) (Maybe Double)
- | DTBoolean
- | DTArray DataType Int (Maybe Int)
- | DTHash DataType DataType Int (Maybe Int)
- | DTUndef
- | DTScalar
- | DTData
- | DTOptional DataType
- | NotUndef
- | DTVariant (NonEmpty DataType)
- | DTPattern (NonEmpty CompRegex)
- | DTEnum (NonEmpty Text)
- | DTAny
- | DTCollection
- | DTRegexp (Maybe CompRegex)
- data PValue
- _PRegexp :: Prism' PValue CompRegex
- _PType :: Prism' PValue DataType
- _PNumber :: Prism' PValue Scientific
- _PHash :: Prism' PValue (Container PValue)
- _PArray :: Prism' PValue (Vector PValue)
- _PResourceReference :: Prism' PValue (Text, Text)
- _PString :: Prism' PValue Text
- _PUndef :: Prism' PValue ()
- _PBoolean :: Prism' PValue Bool
- data PuppetEdge = PuppetEdge RIdentifier RIdentifier LinkType
- data WireCatalog = WireCatalog {}
- class HasWireCatalog c where
Documentation
initialPPos :: FilePath -> PPosition #
Generates an initial position interval based on a filename.
stringEscape :: Text -> Text #
Extremely hacky escaping system for text values.
capitalizeR :: Text -> Doc #
Capitalize resource type and convert into a Doc.
capitalizeRT :: Text -> Text #
Properly capitalizes resource types.
containerComma'' :: Pretty a => [(Doc, a)] -> Doc #
containerComma' :: Pretty a => [(Doc, a)] -> Doc #
containerComma :: Pretty a => Container a -> Doc #
_sourceLine :: Lens' Position Pos #
baseNativeTypes :: Container NativeTypeMethods #
The map of native types.
data NativeTypeMethods #
Attributes (and providers) of a puppet resource type bundled with validation rules
Instances
type NativeTypeName = Text #
class HasNativeTypeMethods c where #
Minimal complete definition
Methods
nativeTypeMethods :: Lens' c NativeTypeMethods #
puppetFields :: Lens' c (HashSet Text) #
puppetValidate :: Lens' c NativeTypeValidate #
Instances
data PuppetDirPaths #
Constructors
| PuppetDirPaths | |
Fields
| |
Instances
class HasPuppetDirPaths c where #
Minimal complete definition
Methods
puppetDirPaths :: Lens' c PuppetDirPaths #
manifestPath :: Lens' c FilePath #
modulesPath :: Lens' c FilePath #
templatesPath :: Lens' c FilePath #
Instances
puppetPaths :: FilePath -> PuppetDirPaths #
A fully resolved puppet resource that will be used in the FinalCatalog.
Constructors
| Resource | |
Fields
| |
class HasResource c where #
Minimal complete definition
Methods
resource :: Lens' c Resource #
ralias :: Lens' c (HashSet Text) #
rattributes :: Lens' c (Container PValue) #
rid :: Lens' c RIdentifier #
rrelations :: Lens' c (HashMap RIdentifier (HashSet LinkType)) #
rscope :: Lens' c [CurContainerDesc] #
rtags :: Lens' c (HashSet Text) #
rvirtuality :: Lens' c Virtuality #
Instances
data LinkInformation #
Relationship/ordering information between two resources (used in the EdgeMap).
Constructors
| LinkInformation | |
Fields
| |
Instances
class HasLinkInformation c where #
Minimal complete definition
Methods
linkInformation :: Lens' c LinkInformation #
linkPos :: Lens' c PPosition #
linkType :: Lens' c LinkType #
linkdst :: Lens' c RIdentifier #
linksrc :: Lens' c RIdentifier #
Instances
Relationship/ordering between resources.
Constructors
| RRequire | Applies a resource after the target resource. |
| RBefore | Applies a resource before the target resource. |
| RNotify | Applies a resource before the target resource. The target resource refreshes if the notifying resource changes. |
| RSubscribe | Applies a resource after the target resource. The subscribing resource refreshes if the target resource changes. |
data Virtuality #
Constructors
| Normal | Normal resource, that will be included in the catalog. |
| Virtual | Type for virtual resources. |
| Exported | Type for exported resources. |
| ExportedRealized | These are resources that are exported AND realized in the catalog. |
Instances
data CurContainerDesc #
Constructors
| 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 |
Instances
type FinalCatalog = HashMap RIdentifier Resource #
type EdgeMap = HashMap RIdentifier [LinkInformation] #
Constructors
A puppet value.
data PuppetEdge #
Used to represent a relationship between two resources within the wired format (json).
See http://docs.puppetlabs.com/puppetdb/2.3/api/wire_format/catalog_format_v5.html#data-type-edge
Constructors
| PuppetEdge RIdentifier RIdentifier LinkType |
Instances
class HasWireCatalog c where #
Minimal complete definition
Methods
wireCatalog :: Lens' c WireCatalog #
wireCatalogEdges :: Lens' c (Vector PuppetEdge) #
wireCatalogNodename :: Lens' c NodeName #
wireCatalogResources :: Lens' c (Vector Resource) #
wireCatalogTransactionUUID :: Lens' c Text #
wireCatalogVersion :: Lens' c Text #
Instances