Module: Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Paths

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

Overview

Path helper methods for the HubService API.

Instance Method Summary collapse

Instance Method Details

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


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

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

  "projects/#{project}/locations/global/hubs/#{hub}"
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)


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

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)


75
76
77
78
79
80
# File 'lib/google/cloud/network_connectivity/v1alpha1/hub_service/paths.rb', line 75

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)


93
94
95
96
97
# File 'lib/google/cloud/network_connectivity/v1alpha1/hub_service/paths.rb', line 93

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

  "projects/#{project}/locations/#{location}"
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)


111
112
113
114
115
116
# File 'lib/google/cloud/network_connectivity/v1alpha1/hub_service/paths.rb', line 111

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)


130
131
132
133
134
135
# File 'lib/google/cloud/network_connectivity/v1alpha1/hub_service/paths.rb', line 130

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