Module: Google::Cloud::Dataproc::V1::ClusterController::Paths

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

Overview

Path helper methods for the ClusterController API.

Instance Method Summary collapse

Instance Method Details

#cluster_path(project:, location:, cluster:) ⇒ ::String

Create a fully-qualified Cluster resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/clusters/{cluster}

Parameters:

  • project (String)
  • location (String)
  • cluster (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


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

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

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

#node_group_path(project:, region:, cluster:, node_group:) ⇒ ::String

Create a fully-qualified NodeGroup resource string.

The resource will be in the following format:

projects/{project}/regions/{region}/clusters/{cluster}/nodeGroups/{node_group}

Parameters:

  • project (String)
  • region (String)
  • cluster (String)
  • node_group (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


59
60
61
62
63
64
65
# File 'lib/google/cloud/dataproc/v1/cluster_controller/paths.rb', line 59

def node_group_path project:, region:, cluster:, node_group:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "region cannot contain /" if region.to_s.include? "/"
  raise ::ArgumentError, "cluster cannot contain /" if cluster.to_s.include? "/"

  "projects/#{project}/regions/#{region}/clusters/#{cluster}/nodeGroups/#{node_group}"
end

#service_path(project:, location:, service:) ⇒ ::String

Create a fully-qualified Service resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/services/{service}

Parameters:

  • project (String)
  • location (String)
  • service (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


79
80
81
82
83
84
# File 'lib/google/cloud/dataproc/v1/cluster_controller/paths.rb', line 79

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

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