Module: Google::Cloud::NetworkConnectivity::V1::PolicyBasedRoutingService::Paths

Extended by:
Paths
Included in:
Client, Paths
Defined in:
lib/google/cloud/network_connectivity/v1/policy_based_routing_service/paths.rb

Overview

Path helper methods for the PolicyBasedRoutingService API.

Instance Method Summary collapse

Instance Method Details

#location_path(project:, location:) ⇒ ::String

Create a fully-qualified Location resource string.

The resource will be in the following format:

projects/{project}/locations/{location}

Parameters:

  • project (String)
  • location (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


38
39
40
41
42
# File 'lib/google/cloud/network_connectivity/v1/policy_based_routing_service/paths.rb', line 38

def location_path project:, location:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"

  "projects/#{project}/locations/#{location}"
end

#network_path(project:, resource_id:) ⇒ ::String

Create a fully-qualified Network resource string.

The resource will be in the following format:

projects/{project}/global/networks/{resource_id}

Parameters:

  • project (String)
  • resource_id (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


55
56
57
58
59
# File 'lib/google/cloud/network_connectivity/v1/policy_based_routing_service/paths.rb', line 55

def network_path project:, resource_id:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"

  "projects/#{project}/global/networks/#{resource_id}"
end

#policy_based_route_path(project:, policy_based_route:) ⇒ ::String

Create a fully-qualified PolicyBasedRoute resource string.

The resource will be in the following format:

projects/{project}/locations/global/PolicyBasedRoutes/{policy_based_route}

Parameters:

  • project (String)
  • policy_based_route (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


72
73
74
75
76
# File 'lib/google/cloud/network_connectivity/v1/policy_based_routing_service/paths.rb', line 72

def policy_based_route_path project:, policy_based_route:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"

  "projects/#{project}/locations/global/PolicyBasedRoutes/#{policy_based_route}"
end