Module: Google::Cloud::AIPlatform::V1::DeploymentResourcePoolService::Paths

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

Overview

Path helper methods for the DeploymentResourcePoolService API.

Instance Method Summary collapse

Instance Method Details

#deployment_resource_pool_path(project:, location:, deployment_resource_pool:) ⇒ ::String

Create a fully-qualified DeploymentResourcePool resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}

Parameters:

  • project (String)
  • location (String)
  • deployment_resource_pool (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


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

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

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


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

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

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


73
74
75
# File 'lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/paths.rb', line 73

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

#reservation_path(project_id_or_number:, zone:, reservation_name:) ⇒ ::String

Create a fully-qualified Reservation resource string.

The resource will be in the following format:

projects/{project_id_or_number}/zones/{zone}/reservations/{reservation_name}

Parameters:

  • project_id_or_number (String)
  • zone (String)
  • reservation_name (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


89
90
91
92
93
94
# File 'lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/paths.rb', line 89

def reservation_path project_id_or_number:, zone:, reservation_name:
  raise ::ArgumentError, "project_id_or_number cannot contain /" if project_id_or_number.to_s.include? "/"
  raise ::ArgumentError, "zone cannot contain /" if zone.to_s.include? "/"

  "projects/#{project_id_or_number}/zones/#{zone}/reservations/#{reservation_name}"
end