Module: Google::Cloud::CloudControlsPartner::V1::CloudControlsPartnerMonitoring::Paths

Extended by:
Paths
Included in:
Client, Paths, Rest::Client
Defined in:
lib/google/cloud/cloud_controls_partner/v1/cloud_controls_partner_monitoring/paths.rb

Overview

Path helper methods for the CloudControlsPartnerMonitoring API.

Instance Method Summary collapse

Instance Method Details

#violation_path(organization:, location:, customer:, workload:, violation:) ⇒ ::String

Create a fully-qualified Violation resource string.

The resource will be in the following format:

organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}/violations/{violation}

Parameters:

  • organization (String)
  • location (String)
  • customer (String)
  • workload (String)
  • violation (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


41
42
43
44
45
46
47
48
# File 'lib/google/cloud/cloud_controls_partner/v1/cloud_controls_partner_monitoring/paths.rb', line 41

def violation_path organization:, location:, customer:, workload:, violation:
  raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
  raise ::ArgumentError, "customer cannot contain /" if customer.to_s.include? "/"
  raise ::ArgumentError, "workload cannot contain /" if workload.to_s.include? "/"

  "organizations/#{organization}/locations/#{location}/customers/#{customer}/workloads/#{workload}/violations/#{violation}"
end

#workload_path(organization:, location:, customer:, workload:) ⇒ ::String

Create a fully-qualified Workload resource string.

The resource will be in the following format:

organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}

Parameters:

  • organization (String)
  • location (String)
  • customer (String)
  • workload (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


63
64
65
66
67
68
69
# File 'lib/google/cloud/cloud_controls_partner/v1/cloud_controls_partner_monitoring/paths.rb', line 63

def workload_path organization:, location:, customer:, workload:
  raise ::ArgumentError, "organization cannot contain /" if organization.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
  raise ::ArgumentError, "customer cannot contain /" if customer.to_s.include? "/"

  "organizations/#{organization}/locations/#{location}/customers/#{customer}/workloads/#{workload}"
end