Puppet Function: gcompute_health_check_ref

Defined in:
lib/puppet/functions/gcompute_health_check_ref.rb
Function type:
Ruby 4.x API

Overview

gcompute_health_check_ref(String $name, String $project_name)Any

Builds a reference to a health check to be used in the backend service.

Arguments:

- name: string
  the name of the health check
- project_name: string
  the name of the project that hosts the check

Examples:

- gcompute_health_check_ref('my-hc', 'my-project')

Parameters:

  • name (String)
  • project_name (String)

Returns:

  • (Any)


38
39
40
41
42
43
44
45
46
47
48
# File 'lib/puppet/functions/gcompute_health_check_ref.rb', line 38

Puppet::Functions.create_function(:gcompute_health_check_ref) do
  dispatch :gcompute_health_check_ref do
    param 'String', :name
    param 'String', :project_name
  end

  def gcompute_health_check_ref(name, project_name)
    URI.join('https://www.googleapis.com/compute/v1/',
             "projects/#{project_name}/global/healthChecks/#{name}").to_s
  end
end