Revert snapshot memory increase, dropped git http smart stuff instead.
[mirror/dsa-puppet.git] / 3rdparty / modules / elasticsearch / lib / puppet / type / es_instance_conn_validator.rb
1 Puppet::Type.newtype(:es_instance_conn_validator) do
2
3   @doc = "Verify that a connection can be successfully established between a node
4   and the Elasticsearch instance. It could potentially be used for other
5   purposes such as monitoring."
6   
7   ensurable do
8     defaultvalues
9     defaultto :present
10   end
11
12   newparam(:name, :namevar => true) do
13     desc 'An arbitrary name used as the identity of the resource.'
14   end
15
16   newparam(:server) do
17     desc 'DNS name or IP address of the server where Elasticsearch instance should be running.'
18     defaultto 'localhost'
19   end
20
21   newparam(:port) do
22     desc 'The port that the Elasticsearch instance should be listening on.'
23     defaultto 9200
24   end
25
26   newparam(:timeout) do
27     desc 'The max number of seconds that the validator should wait before giving up and deciding that the Elasticsearch instance is not running; defaults to 60 seconds.'
28     defaultto 60
29     validate do |value|
30       # This will raise an error if the string is not convertible to an integer
31       Integer(value)
32     end
33     munge do |value|
34       Integer(value)
35     end
36   end
37
38 end