Safe Haskell | None |
---|---|
Language | Haskell98 |
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.
Synopsis
- 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
showPPos' :: PPosition -> String Source #
showing the first position of a position interval as string.
initialPPos :: FilePath -> PPosition Source #
Generates an initial position interval based on a filename.
type PPosition = Pair Position Position Source #
A pair containing the start and end of a given token.
stringEscape :: Text -> Text Source #
Extremely hacky escaping system for text values.
capitalizeRT :: Text -> Text Source #
Properly capitalizes resource types.
toPPos :: Text -> Int -> PPosition Source #
Generates a PPosition
based on a filename and line number.
baseNativeTypes :: Container NativeTypeMethods Source #
The map of native types.
data NativeTypeMethods Source #
Attributes (and providers) of a puppet resource type bundled with validation rules
Instances
HasNativeTypeMethods NativeTypeMethods Source # | |
Defined in Puppet.Language.NativeTypes.Helpers nativeTypeMethods :: Lens' NativeTypeMethods NativeTypeMethods Source # puppetFields :: Lens' NativeTypeMethods (HashSet Text) Source # puppetValidate :: Lens' NativeTypeMethods NativeTypeValidate Source # |
type NativeTypeName = Text Source #
class HasNativeTypeMethods c where Source #
nativeTypeMethods :: Lens' c NativeTypeMethods Source #
puppetFields :: Lens' c (HashSet Text) Source #
puppetValidate :: Lens' c NativeTypeValidate Source #
Instances
HasNativeTypeMethods NativeTypeMethods Source # | |
Defined in Puppet.Language.NativeTypes.Helpers nativeTypeMethods :: Lens' NativeTypeMethods NativeTypeMethods Source # puppetFields :: Lens' NativeTypeMethods (HashSet Text) Source # puppetValidate :: Lens' NativeTypeMethods NativeTypeValidate Source # |
data PuppetDirPaths Source #
PuppetDirPaths | |
|
Instances
HasPuppetDirPaths PuppetDirPaths Source # | |
Defined in Puppet.Language.Paths |
class HasPuppetDirPaths c where Source #
puppetDirPaths :: Lens' c PuppetDirPaths Source #
baseDir :: Lens' c FilePath Source #
manifestPath :: Lens' c FilePath Source #
modulesPath :: Lens' c FilePath Source #
templatesPath :: Lens' c FilePath Source #
Instances
HasPuppetDirPaths PuppetDirPaths Source # | |
Defined in Puppet.Language.Paths |
puppetPaths :: FilePath -> PuppetDirPaths Source #
A fully resolved puppet resource that will be used in the FinalCatalog
.
Resource | |
|
Instances
Eq Resource Source # | |
Show Resource Source # | |
ToJSON Resource Source # | |
Defined in Puppet.Language.Resource | |
FromJSON Resource Source # | |
Pretty Resource Source # | |
Defined in Puppet.Language.Resource | |
HasResource Resource Source # | |
Defined in Puppet.Language.Resource resource :: Lens' Resource Resource Source # ralias :: Lens' Resource (HashSet Text) Source # rattributes :: Lens' Resource (Container PValue) Source # rid :: Lens' Resource RIdentifier Source # rnode :: Lens' Resource NodeName Source # rpos :: Lens' Resource PPosition Source # rrelations :: Lens' Resource (HashMap RIdentifier (HashSet LinkType)) Source # rscope :: Lens' Resource [CurContainerDesc] Source # |
class HasResource c where Source #
resource :: Lens' c Resource Source #
ralias :: Lens' c (HashSet Text) Source #
rattributes :: Lens' c (Container PValue) Source #
rid :: Lens' c RIdentifier Source #
rnode :: Lens' c NodeName Source #
rpos :: Lens' c PPosition Source #
rrelations :: Lens' c (HashMap RIdentifier (HashSet LinkType)) Source #
rscope :: Lens' c [CurContainerDesc] Source #
rtags :: Lens' c (HashSet Text) Source #
rvirtuality :: Lens' c Virtuality Source #
Instances
HasResource Resource Source # | |
Defined in Puppet.Language.Resource resource :: Lens' Resource Resource Source # ralias :: Lens' Resource (HashSet Text) Source # rattributes :: Lens' Resource (Container PValue) Source # rid :: Lens' Resource RIdentifier Source # rnode :: Lens' Resource NodeName Source # rpos :: Lens' Resource PPosition Source # rrelations :: Lens' Resource (HashMap RIdentifier (HashSet LinkType)) Source # rscope :: Lens' Resource [CurContainerDesc] Source # |
data RIdentifier Source #
In Puppet, a resource is identified by a name and a type.
Instances
class HasRIdentifier c where Source #
rIdentifier :: Lens' c RIdentifier Source #
Instances
HasRIdentifier RIdentifier Source # | |
Defined in Puppet.Language.Resource |
data LinkInformation Source #
Relationship/ordering information between two resources (used in the EdgeMap
).
LinkInformation | |
|
Instances
Show LinkInformation Source # | |
Defined in Puppet.Language.Resource showsPrec :: Int -> LinkInformation -> ShowS # show :: LinkInformation -> String # showList :: [LinkInformation] -> ShowS # | |
Pretty LinkInformation # | |
Defined in Puppet.Interpreter.PrettyPrinter pretty :: LinkInformation -> Doc # prettyList :: [LinkInformation] -> Doc # | |
HasLinkInformation LinkInformation Source # | |
Defined in Puppet.Language.Resource |
class HasLinkInformation c where Source #
linkInformation :: Lens' c LinkInformation Source #
linkPos :: Lens' c PPosition Source #
linkType :: Lens' c LinkType Source #
linkdst :: Lens' c RIdentifier Source #
linksrc :: Lens' c RIdentifier Source #
Instances
HasLinkInformation LinkInformation Source # | |
Defined in Puppet.Language.Resource |
Relationship/ordering between resources.
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. |
Instances
Eq LinkType Source # | |
Show LinkType Source # | |
Generic LinkType Source # | |
Hashable LinkType Source # | |
Defined in Puppet.Language.Resource | |
ToJSON LinkType Source # | |
Defined in Puppet.Language.Resource | |
FromJSON LinkType Source # | |
Pretty LinkType Source # | |
Defined in Puppet.Language.Resource | |
type Rep LinkType Source # | |
Defined in Puppet.Language.Resource type Rep LinkType = D1 (MetaData "LinkType" "Puppet.Language.Resource" "language-puppet-1.4.3-HDQJwfJDSsZ3qfCihzdt4N" False) ((C1 (MetaCons "RRequire" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "RBefore" PrefixI False) (U1 :: * -> *)) :+: (C1 (MetaCons "RNotify" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "RSubscribe" PrefixI False) (U1 :: * -> *))) |
data Virtuality Source #
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
Eq Virtuality Source # | |
Defined in Puppet.Language.Resource (==) :: Virtuality -> Virtuality -> Bool # (/=) :: Virtuality -> Virtuality -> Bool # | |
Show Virtuality Source # | |
Defined in Puppet.Language.Resource showsPrec :: Int -> Virtuality -> ShowS # show :: Virtuality -> String # showList :: [Virtuality] -> ShowS # |
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 |
Instances
type FinalCatalog = HashMap RIdentifier Resource Source #
type EdgeMap = HashMap RIdentifier [LinkInformation] Source #
A puppet value.
PBoolean !Bool | |
PUndef | |
PString !Text | |
PResourceReference !Text !Text | |
PArray !(Vector PValue) | |
PHash !(Container PValue) | |
PNumber !Scientific | |
PType !DataType | |
PRegexp !CompRegex |
Instances
Eq PValue Source # | |
Show PValue Source # | |
IsString PValue Source # | |
Defined in Puppet.Language.Value fromString :: String -> PValue # | |
ToJSON PValue Source # | |
Defined in Puppet.Language.Value | |
FromJSON PValue Source # | |
Pretty PValue Source # | |
Defined in Puppet.Language.Value | |
FromRuby PValue Source # | |
ToRuby PValue Source # | |
AsNumber PValue Source # | |
Pretty (HashMap Text PValue) Source # | |
data PuppetEdge Source #
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
Instances
Show PuppetEdge Source # | |
Defined in Puppet.Language.WireCatalog showsPrec :: Int -> PuppetEdge -> ShowS # show :: PuppetEdge -> String # showList :: [PuppetEdge] -> ShowS # | |
ToJSON PuppetEdge Source # | |
Defined in Puppet.Language.WireCatalog toJSON :: PuppetEdge -> Value # toEncoding :: PuppetEdge -> Encoding # toJSONList :: [PuppetEdge] -> Value # toEncodingList :: [PuppetEdge] -> Encoding # | |
FromJSON PuppetEdge Source # | |
Defined in Puppet.Language.WireCatalog parseJSON :: Value -> Parser PuppetEdge # parseJSONList :: Value -> Parser [PuppetEdge] # |
data WireCatalog Source #
See puppet reference.
Instances
Show WireCatalog Source # | |
Defined in Puppet.Language.WireCatalog showsPrec :: Int -> WireCatalog -> ShowS # show :: WireCatalog -> String # showList :: [WireCatalog] -> ShowS # | |
ToJSON WireCatalog Source # | |
Defined in Puppet.Language.WireCatalog toJSON :: WireCatalog -> Value # toEncoding :: WireCatalog -> Encoding # toJSONList :: [WireCatalog] -> Value # toEncodingList :: [WireCatalog] -> Encoding # | |
FromJSON WireCatalog Source # | |
Defined in Puppet.Language.WireCatalog parseJSON :: Value -> Parser WireCatalog # parseJSONList :: Value -> Parser [WireCatalog] # | |
HasWireCatalog WireCatalog Source # | |
Defined in Puppet.Language.WireCatalog wireCatalog :: Lens' WireCatalog WireCatalog Source # wireCatalogEdges :: Lens' WireCatalog (Vector PuppetEdge) Source # wireCatalogNodename :: Lens' WireCatalog NodeName Source # wireCatalogResources :: Lens' WireCatalog (Vector Resource) Source # wireCatalogTransactionUUID :: Lens' WireCatalog Text Source # |
class HasWireCatalog c where Source #
wireCatalog :: Lens' c WireCatalog Source #
wireCatalogEdges :: Lens' c (Vector PuppetEdge) Source #
wireCatalogNodename :: Lens' c NodeName Source #
wireCatalogResources :: Lens' c (Vector Resource) Source #
wireCatalogTransactionUUID :: Lens' c Text Source #
wireCatalogVersion :: Lens' c Text Source #