Module: Google::Cloud::Spanner::Admin::Instance::V1::InstanceAdmin::Paths

Extended by:
Paths
Included in:
Client, Paths
Defined in:
lib/google/cloud/spanner/admin/instance/v1/instance_admin/paths.rb

Overview

Path helper methods for the InstanceAdmin API.

Instance Method Summary collapse

Instance Method Details

#instance_config_path(project:, instance_config:) ⇒ ::String

Create a fully-qualified InstanceConfig resource string.

The resource will be in the following format:

projects/{project}/instanceConfigs/{instance_config}

Parameters:

  • project (String)
  • instance_config (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


57
58
59
60
61
# File 'lib/google/cloud/spanner/admin/instance/v1/instance_admin/paths.rb', line 57

def instance_config_path project:, instance_config:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"

  "projects/#{project}/instanceConfigs/#{instance_config}"
end

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

Create a fully-qualified Instance resource string.

The resource will be in the following format:

projects/{project}/instances/{instance}

Parameters:

  • project (String)
  • instance (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


40
41
42
43
44
# File 'lib/google/cloud/spanner/admin/instance/v1/instance_admin/paths.rb', line 40

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

  "projects/#{project}/instances/#{instance}"
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/spanner/admin/instance/v1/instance_admin/paths.rb', line 73

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