473 lines
12 KiB
JSON
473 lines
12 KiB
JSON
{
|
|
"puppet_classes": [
|
|
{
|
|
"name": "klass",
|
|
"file": "(stdin)",
|
|
"line": 5,
|
|
"inherits": "foo::bar",
|
|
"docstring": {
|
|
"text": "A simple class.",
|
|
"tags": [
|
|
{
|
|
"tag_name": "param",
|
|
"text": "First param.",
|
|
"types": [
|
|
"Integer"
|
|
],
|
|
"name": "param1"
|
|
},
|
|
{
|
|
"tag_name": "param",
|
|
"text": "Second param.",
|
|
"types": [
|
|
"Any"
|
|
],
|
|
"name": "param2"
|
|
},
|
|
{
|
|
"tag_name": "param",
|
|
"text": "Third param.",
|
|
"types": [
|
|
"String"
|
|
],
|
|
"name": "param3"
|
|
}
|
|
]
|
|
},
|
|
"defaults": {
|
|
"param3": "hi"
|
|
},
|
|
"source": "class klass(Integer $param1, $param2, String $param3 = hi) inherits foo::bar {\n}"
|
|
}
|
|
],
|
|
"defined_types": [
|
|
{
|
|
"name": "dt",
|
|
"file": "(stdin)",
|
|
"line": 12,
|
|
"docstring": {
|
|
"text": "A simple defined type.",
|
|
"tags": [
|
|
{
|
|
"tag_name": "param",
|
|
"text": "First param.",
|
|
"types": [
|
|
"Integer"
|
|
],
|
|
"name": "param1"
|
|
},
|
|
{
|
|
"tag_name": "param",
|
|
"text": "Second param.",
|
|
"types": [
|
|
"Any"
|
|
],
|
|
"name": "param2"
|
|
},
|
|
{
|
|
"tag_name": "param",
|
|
"text": "Third param.",
|
|
"types": [
|
|
"String"
|
|
],
|
|
"name": "param3"
|
|
}
|
|
]
|
|
},
|
|
"defaults": {
|
|
"param3": "hi"
|
|
},
|
|
"source": "define dt(Integer $param1, $param2, String $param3 = hi) {\n}"
|
|
}
|
|
],
|
|
"resource_types": [
|
|
{
|
|
"name": "database",
|
|
"file": "(stdin)",
|
|
"line": 54,
|
|
"docstring": {
|
|
"text": "An example database server resource type."
|
|
},
|
|
"properties": [
|
|
{
|
|
"name": "ensure",
|
|
"description": "What state the database should be in.",
|
|
"values": [
|
|
"present",
|
|
"absent",
|
|
"up",
|
|
"down"
|
|
],
|
|
"aliases": {
|
|
"up": "present",
|
|
"down": "absent"
|
|
},
|
|
"default": "up"
|
|
},
|
|
{
|
|
"name": "file",
|
|
"description": "The database file to use."
|
|
},
|
|
{
|
|
"name": "log_level",
|
|
"description": "The log level to use.",
|
|
"values": [
|
|
"debug",
|
|
"warn",
|
|
"error"
|
|
],
|
|
"default": "warn"
|
|
}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "address",
|
|
"description": "The database server name.",
|
|
"isnamevar": true
|
|
},
|
|
{
|
|
"name": "encryption_key",
|
|
"description": "The encryption key to use."
|
|
},
|
|
{
|
|
"name": "encrypt",
|
|
"description": "Whether or not to encrypt the database.",
|
|
"values": [
|
|
"true",
|
|
"false",
|
|
"yes",
|
|
"no"
|
|
],
|
|
"default": "false"
|
|
}
|
|
],
|
|
"features": [
|
|
{
|
|
"name": "encryption",
|
|
"description": "The provider supports encryption."
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"providers": [
|
|
{
|
|
"name": "linux",
|
|
"type_name": "database",
|
|
"file": "(stdin)",
|
|
"line": 43,
|
|
"docstring": {
|
|
"text": "An example provider on Linux."
|
|
},
|
|
"confines": {
|
|
"kernel": "Linux",
|
|
"osfamily": "RedHat"
|
|
},
|
|
"features": [
|
|
"implements_some_feature",
|
|
"some_other_feature"
|
|
],
|
|
"defaults": [
|
|
[
|
|
[
|
|
"kernel",
|
|
"Linux"
|
|
]
|
|
],
|
|
[
|
|
[
|
|
"osfamily",
|
|
"RedHat"
|
|
],
|
|
[
|
|
"operatingsystemmajrelease",
|
|
"7"
|
|
]
|
|
]
|
|
],
|
|
"commands": {
|
|
"foo": "/usr/bin/foo"
|
|
}
|
|
}
|
|
],
|
|
"puppet_functions": [
|
|
{
|
|
"name": "func3x",
|
|
"file": "(stdin)",
|
|
"line": 1,
|
|
"type": "ruby3x",
|
|
"signatures": [
|
|
{
|
|
"signature": "func3x(String $first, Any $second)",
|
|
"docstring": {
|
|
"text": "An example 3.x function.",
|
|
"tags": [
|
|
{
|
|
"tag_name": "param",
|
|
"text": "The first parameter.",
|
|
"types": [
|
|
"String"
|
|
],
|
|
"name": "first"
|
|
},
|
|
{
|
|
"tag_name": "param",
|
|
"text": "The second parameter.",
|
|
"types": [
|
|
"Any"
|
|
],
|
|
"name": "second"
|
|
},
|
|
{
|
|
"tag_name": "return",
|
|
"text": "Returns nothing.",
|
|
"types": [
|
|
"Undef"
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"docstring": {
|
|
"text": "An example 3.x function.",
|
|
"tags": [
|
|
{
|
|
"tag_name": "param",
|
|
"text": "The first parameter.",
|
|
"types": [
|
|
"String"
|
|
],
|
|
"name": "first"
|
|
},
|
|
{
|
|
"tag_name": "param",
|
|
"text": "The second parameter.",
|
|
"types": [
|
|
"Any"
|
|
],
|
|
"name": "second"
|
|
},
|
|
{
|
|
"tag_name": "return",
|
|
"text": "Returns nothing.",
|
|
"types": [
|
|
"Undef"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"source": "Puppet::Parser::Functions.newfunction(:func3x, doc: <<-DOC\nAn example 3.x function.\n@param [String] first The first parameter.\n@param second The second parameter.\n@return [Undef] Returns nothing.\nDOC\n) do |*args|\nend"
|
|
},
|
|
{
|
|
"name": "func4x",
|
|
"file": "(stdin)",
|
|
"line": 11,
|
|
"type": "ruby4x",
|
|
"signatures": [
|
|
{
|
|
"signature": "func4x(Integer $param1, Any $param2, Optional[Array[String]] $param3)",
|
|
"docstring": {
|
|
"text": "The first overload.",
|
|
"tags": [
|
|
{
|
|
"tag_name": "param",
|
|
"text": "The first parameter.",
|
|
"types": [
|
|
"Integer"
|
|
],
|
|
"name": "param1"
|
|
},
|
|
{
|
|
"tag_name": "param",
|
|
"text": "The second parameter.",
|
|
"types": [
|
|
"Any"
|
|
],
|
|
"name": "param2"
|
|
},
|
|
{
|
|
"tag_name": "param",
|
|
"text": "The third parameter.",
|
|
"types": [
|
|
"Optional[Array[String]]"
|
|
],
|
|
"name": "param3"
|
|
},
|
|
{
|
|
"tag_name": "return",
|
|
"text": "Returns nothing.",
|
|
"types": [
|
|
"Undef"
|
|
]
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"signature": "func4x(Boolean $param, Callable &$block)",
|
|
"docstring": {
|
|
"text": "",
|
|
"tags": [
|
|
{
|
|
"tag_name": "param",
|
|
"text": "The first parameter.",
|
|
"types": [
|
|
"Boolean"
|
|
],
|
|
"name": "param"
|
|
},
|
|
{
|
|
"tag_name": "param",
|
|
"text": "The block parameter.",
|
|
"types": [
|
|
"Callable"
|
|
],
|
|
"name": "&block"
|
|
},
|
|
{
|
|
"tag_name": "return",
|
|
"text": "Returns a string.",
|
|
"types": [
|
|
"String"
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"docstring": {
|
|
"text": "An example 4.x function.",
|
|
"tags": [
|
|
{
|
|
"tag_name": "overload",
|
|
"signature": "func4x(Integer $param1, Any $param2, Optional[Array[String]] $param3)",
|
|
"docstring": {
|
|
"text": "The first overload.",
|
|
"tags": [
|
|
{
|
|
"tag_name": "param",
|
|
"text": "The first parameter.",
|
|
"types": [
|
|
"Integer"
|
|
],
|
|
"name": "param1"
|
|
},
|
|
{
|
|
"tag_name": "param",
|
|
"text": "The second parameter.",
|
|
"types": [
|
|
"Any"
|
|
],
|
|
"name": "param2"
|
|
},
|
|
{
|
|
"tag_name": "param",
|
|
"text": "The third parameter.",
|
|
"types": [
|
|
"Optional[Array[String]]"
|
|
],
|
|
"name": "param3"
|
|
},
|
|
{
|
|
"tag_name": "return",
|
|
"text": "Returns nothing.",
|
|
"types": [
|
|
"Undef"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"name": "func4x"
|
|
},
|
|
{
|
|
"tag_name": "overload",
|
|
"signature": "func4x(Boolean $param, Callable &$block)",
|
|
"docstring": {
|
|
"text": "",
|
|
"tags": [
|
|
{
|
|
"tag_name": "param",
|
|
"text": "The first parameter.",
|
|
"types": [
|
|
"Boolean"
|
|
],
|
|
"name": "param"
|
|
},
|
|
{
|
|
"tag_name": "param",
|
|
"text": "The block parameter.",
|
|
"types": [
|
|
"Callable"
|
|
],
|
|
"name": "&block"
|
|
},
|
|
{
|
|
"tag_name": "return",
|
|
"text": "Returns a string.",
|
|
"types": [
|
|
"String"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"name": "func4x"
|
|
}
|
|
]
|
|
},
|
|
"source": "Puppet::Functions.create_function(:func4x) do\n # The first overload.\n # @param param1 The first parameter.\n # @param param2 The second parameter.\n # @param param3 The third parameter.\n # @return Returns nothing.\n dispatch :foo do\n param 'Integer', :param1\n param 'Any', :param2\n optional_param 'Array[String]', :param3\n return_type 'Undef'\n end\n\n # @param param The first parameter.\n # @param block The block parameter.\n # @return Returns a string.\n dispatch :other do\n param 'Boolean', :param\n block_param\n return_type 'String'\n end\nend"
|
|
},
|
|
{
|
|
"name": "func4x_1",
|
|
"file": "(stdin)",
|
|
"line": 35,
|
|
"type": "ruby4x",
|
|
"signatures": [
|
|
{
|
|
"signature": "func4x_1(Integer $param1)",
|
|
"docstring": {
|
|
"text": "An example 4.x function with only one signature.",
|
|
"tags": [
|
|
{
|
|
"tag_name": "param",
|
|
"text": "The first parameter.",
|
|
"types": [
|
|
"Integer"
|
|
],
|
|
"name": "param1"
|
|
},
|
|
{
|
|
"tag_name": "return",
|
|
"text": "Returns nothing.",
|
|
"types": [
|
|
"Undef"
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|
|
],
|
|
"docstring": {
|
|
"text": "An example 4.x function with only one signature.",
|
|
"tags": [
|
|
{
|
|
"tag_name": "param",
|
|
"text": "The first parameter.",
|
|
"types": [
|
|
"Integer"
|
|
],
|
|
"name": "param1"
|
|
},
|
|
{
|
|
"tag_name": "return",
|
|
"text": "Returns nothing.",
|
|
"types": [
|
|
"Undef"
|
|
]
|
|
}
|
|
]
|
|
},
|
|
"source": "Puppet::Functions.create_function(:func4x_1) do\n # @param param1 The first parameter.\n # @return [Undef] Returns nothing.\n dispatch :foobarbaz do\n param 'Integer', :param1\n end\nend"
|
|
}
|
|
]
|
|
}
|