Module: Google::Cloud::NetworkConnectivity::V1::HubService::Paths

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

Overview

Path helper methods for the HubService API.

Instance Method Summary collapse

Instance Method Details

#group_path(project:, hub:, group:) ⇒ ::String

Create a fully-qualified Group resource string.

The resource will be in the following format:

projects/{project}/locations/global/hubs/{hub}/groups/{group}

Parameters:

  • project (String)
  • hub (String)
  • group (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


39
40
41
42
43
44
# File 'lib/google/cloud/network_connectivity/v1/hub_service/paths.rb', line 39

def group_path project:, hub:, group:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "hub cannot contain /" if hub.to_s.include? "/"

  "projects/#{project}/locations/global/hubs/#{hub}/groups/#{group}"
end

#hub_path(project:, hub:) ⇒ ::String

Create a fully-qualified Hub resource string.

The resource will be in the following format:

projects/{project}/locations/global/hubs/{hub}

Parameters:

  • project (String)
  • hub (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


57
58
59
60
61
# File 'lib/google/cloud/network_connectivity/v1/hub_service/paths.rb', line 57

def hub_path project:, hub:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"

  "projects/#{project}/locations/global/hubs/#{hub}"
end

#hub_route_path(project:, hub:, route_table:, route:) ⇒ ::String

Create a fully-qualified HubRoute resource string.

The resource will be in the following format:

projects/{project}/locations/global/hubs/{hub}/routeTables/{route_table}/routes/{route}

Parameters:

  • project (String)
  • hub (String)
  • route_table (String)
  • route (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


76
77
78
79
80
81
82
# File 'lib/google/cloud/network_connectivity/v1/hub_service/paths.rb', line 76

def hub_route_path project:, hub:, route_table:, route:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "hub cannot contain /" if hub.to_s.include? "/"
  raise ::ArgumentError, "route_table cannot contain /" if route_table.to_s.include? "/"

  "projects/#{project}/locations/global/hubs/#{hub}/routeTables/#{route_table}/routes/#{route}"
end

#instance_path(project:, zone:, instance:) ⇒ ::String

Create a fully-qualified Instance resource string.

The resource will be in the following format:

projects/{project}/zones/{zone}/instances/{instance}

Parameters:

  • project (String)
  • zone (String)
  • instance (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


96
97
98
99
100
101
# File 'lib/google/cloud/network_connectivity/v1/hub_service/paths.rb', line 96

def instance_path project:, zone:, instance:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "zone cannot contain /" if zone.to_s.include? "/"

  "projects/#{project}/zones/#{zone}/instances/#{instance}"
end

#interconnect_attachment_path(project:, region:, resource_id:) ⇒ ::String

Create a fully-qualified InterconnectAttachment resource string.

The resource will be in the following format:

projects/{project}/regions/{region}/interconnectAttachments/{resource_id}

Parameters:

  • project (String)
  • region (String)
  • resource_id (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


115
116
117
118
119
120
# File 'lib/google/cloud/network_connectivity/v1/hub_service/paths.rb', line 115

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

  "projects/#{project}/regions/#{region}/interconnectAttachments/#{resource_id}"
end

#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)


133
134
135
136
137
# File 'lib/google/cloud/network_connectivity/v1/hub_service/paths.rb', line 133

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)


150
151
152
153
154
# File 'lib/google/cloud/network_connectivity/v1/hub_service/paths.rb', line 150

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

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

#route_table_path(project:, hub:, route_table:) ⇒ ::String

Create a fully-qualified RouteTable resource string.

The resource will be in the following format:

projects/{project}/locations/global/hubs/{hub}/routeTables/{route_table}

Parameters:

  • project (String)
  • hub (String)
  • route_table (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


168
169
170
171
172
173
# File 'lib/google/cloud/network_connectivity/v1/hub_service/paths.rb', line 168

def route_table_path project:, hub:, route_table:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "hub cannot contain /" if hub.to_s.include? "/"

  "projects/#{project}/locations/global/hubs/#{hub}/routeTables/#{route_table}"
end

#spoke_path(project:, location:, spoke:) ⇒ ::String

Create a fully-qualified Spoke resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/spokes/{spoke}

Parameters:

  • project (String)
  • location (String)
  • spoke (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


187
188
189
190
191
192
# File 'lib/google/cloud/network_connectivity/v1/hub_service/paths.rb', line 187

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

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

#vpn_tunnel_path(project:, region:, resource_id:) ⇒ ::String

Create a fully-qualified VpnTunnel resource string.

The resource will be in the following format:

projects/{project}/regions/{region}/vpnTunnels/{resource_id}

Parameters:

  • project (String)
  • region (String)
  • resource_id (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


206
207
208
209
210
211
# File 'lib/google/cloud/network_connectivity/v1/hub_service/paths.rb', line 206

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

  "projects/#{project}/regions/#{region}/vpnTunnels/#{resource_id}"
end