HEX

Warning: set_time_limit() [function.set-time-limit]: Cannot set time limit - prohibited by configuration in /home/u547966/brikov.ru/www/wp-content/plugins/admin-menu-editor/menu-editor.php on line 745
Server: Apache
System: Linux 4.19.0-0.bpo.9-amd64 x86_64 at red40
User: u547966 (5490)
PHP: 5.3.29-mh2
Disabled: syslog, dl, popen, proc_open, proc_nice, proc_get_status, proc_close, proc_terminate, posix_mkfifo, chown, chgrp, accelerator_reset, opcache_reset, accelerator_get_status, opcache_get_status, pcntl_alarm, pcntl_fork, pcntl_waitpid, pcntl_wait, pcntl_wifexited, pcntl_wifstopped, pcntl_wifsignaled, pcntl_wifcontinued, pcntl_wexitstatus, pcntl_wtermsig, pcntl_wstopsig, pcntl_signal, pcntl_signal_dispatch, pcntl_get_last_error, pcntl_strerror, pcntl_sigprocmask, pcntl_sigwaitinfo, pcntl_sigtimedwait, pcntl_exec, pcntl_getpriority, pcntl_setpriority
Upload Files
File: //var/cache/puppet/lib/puppet/type/consul_prepared_query.rb
require 'puppet/parameter/boolean'

Puppet::Type.newtype(:consul_prepared_query) do
  desc <<-'EOD'
  Manage a consul prepared query.
  EOD
  ensurable

  newparam(:name, namevar: true) do
    desc 'Name of the prepared query'
    validate do |value|
      raise ArgumentError, 'Prepared query name must be a string' unless value.is_a?(String)
    end
  end

  newparam(:token) do
    desc 'The prepared query token'
    validate do |value|
      raise ArgumentError, 'The prepared query token must be a string' unless value.is_a?(String)
    end
    defaultto ''
  end

  newparam(:acl_api_token) do
    desc 'Token for accessing the ACL API'
    validate do |value|
      raise ArgumentError, 'ACL API token must be a string' unless value.is_a?(String)
    end
    defaultto ''
  end

  newparam(:service_name) do
    desc 'Service name for the prepared query'
    validate do |value|
      raise ArgumentError, 'Prepared query service definition must be a string' unless value.is_a?(String)
    end
  end

  newparam(:service_failover_n) do
    desc 'Failover to the nearest <n> datacenters'
    defaultto 0
    validate do |value|
      raise ArgumentError, 'Nearest <n> failover datacenters must be an integer' unless value.is_a?(Integer)
    end
  end

  newparam(:service_failover_dcs) do
    desc 'List of datacenters to forward queries to if no health services found locally'
    defaultto []
    validate do |value|
      raise ArgumentError, 'Nearest failover datacenters must be an array' unless value.is_a?(Array)
    end
  end

  newparam(:service_near) do
    desc 'Resurn results in ascending order of estimated RTT from given node name, or _agent special value'
    defaultto ''
    validate do |value|
      raise ArgumentError, 'Near parameter must be a string' unless value.is_a?(String)
    end
  end

  newparam(:service_only_passing) do
    desc 'Only return services in the passing state'
    defaultto false
    validate do |value|
      raise ArgumentError, 'Use only passing state must be a boolean' unless !!value == value
    end
  end

  newparam(:service_tags) do
    desc 'List of tags to filter the query with'
    defaultto []
    validate do |value|
      raise ArgumentError, 'Query tag filters must be an array' unless value.is_a?(Array)
    end
  end

  newparam(:ttl) do
    desc 'TTL for the DNS lookup'
    defaultto 0
    validate do |value|
      raise ArgumentError, 'Prepared query TTL must be an integer' unless value.is_a?(Integer)
    end
  end

  newproperty(:id) do
    desc 'ID of prepared query'
  end

  newparam(:protocol) do
    desc 'consul protocol'
    newvalues('http', 'https')
    defaultto 'http'
  end

  newparam(:port) do
    desc 'consul port'
    defaultto 8500
    validate do |value|
      raise ArgumentError, 'The port number must be a number' unless value.is_a?(Integer)
    end
  end

  newparam(:hostname) do
    desc 'consul hostname'
    validate do |value|
      raise ArgumentError, 'The hostname must be a string' unless value.is_a?(String)
    end
    defaultto 'localhost'
  end

  newparam(:api_tries) do
    desc 'number of tries when contacting the Consul REST API'
    defaultto 3
    validate do |value|
      raise ArgumentError, 'Number of API tries must be a number' unless value.is_a?(Integer)
    end
  end

  newparam(:template, boolean: true, parent: Puppet::Parameter::Boolean) do
    desc 'is template?'
    defaultto false
  end

  newparam(:template_regexp) do
    desc 'regexp for template'
    defaultto ''
    validate do |value|
      raise ArgumentError, 'The template regexp must be a string' unless value.is_a?(String)
    end
  end

  newparam(:template_type) do
    desc 'type for template'
    defaultto 'name_prefix_match'
    validate do |value|
      raise ArgumentError, 'The template type must be a string' unless value.is_a?(String)
    end
  end
end