Module: Google::Cloud::Monitoring::Dashboard::V1::DashboardsService::Paths

Extended by:
Paths
Included in:
Client, Paths, Rest::Client
Defined in:
lib/google/cloud/monitoring/dashboard/v1/dashboards_service/paths.rb

Overview

Path helper methods for the DashboardsService API.

Instance Method Summary collapse

Instance Method Details

#alert_policy_path(project:, alert_policy:) ⇒ ::String

Create a fully-qualified AlertPolicy resource string.

The resource will be in the following format:

projects/{project}/alertPolicies/{alert_policy}

Parameters:

  • project (String)
  • alert_policy (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


39
40
41
42
43
# File 'lib/google/cloud/monitoring/dashboard/v1/dashboards_service/paths.rb', line 39

def alert_policy_path project:, alert_policy:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"

  "projects/#{project}/alertPolicies/#{alert_policy}"
end

#dashboard_path(project:, dashboard:) ⇒ ::String

Create a fully-qualified Dashboard resource string.

The resource will be in the following format:

projects/{project}/dashboards/{dashboard}

Parameters:

  • project (String)
  • dashboard (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


56
57
58
59
60
# File 'lib/google/cloud/monitoring/dashboard/v1/dashboards_service/paths.rb', line 56

def dashboard_path project:, dashboard:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"

  "projects/#{project}/dashboards/#{dashboard}"
end

#project_path(project:) ⇒ ::String

Create a fully-qualified Project resource string.

The resource will be in the following format:

projects/{project}

Parameters:

  • project (String)

Returns:

  • (::String)


72
73
74
# File 'lib/google/cloud/monitoring/dashboard/v1/dashboards_service/paths.rb', line 72

def project_path project:
  "projects/#{project}"
end