Module: Google::Cloud::Dataproc::V1::NodeGroupController::Paths

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

Overview

Path helper methods for the NodeGroupController API.

Instance Method Summary collapse

Instance Method Details

#cluster_region_path(project:, region:, cluster:) ⇒ ::String

Create a fully-qualified ClusterRegion resource string.

The resource will be in the following format:

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

Parameters:

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

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


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

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

  "projects/#{project}/regions/#{region}/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/node_group_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