Module: Google::Cloud::Bigtable::Admin::V2::BigtableTableAdmin::Paths

Extended by:
Paths
Included in:
Client, Paths
Defined in:
lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/paths.rb

Overview

Path helper methods for the BigtableTableAdmin API.

Instance Method Summary collapse

Instance Method Details

#backup_path(project:, instance:, cluster:, backup:) ⇒ ::String

Create a fully-qualified Backup resource string.

The resource will be in the following format:

projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}

Parameters:

  • project (String)
  • instance (String)
  • cluster (String)
  • backup (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


41
42
43
44
45
46
47
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/paths.rb', line 41

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

  "projects/#{project}/instances/#{instance}/clusters/#{cluster}/backups/#{backup}"
end

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

Create a fully-qualified Cluster resource string.

The resource will be in the following format:

projects/{project}/instances/{instance}/clusters/{cluster}

Parameters:

  • project (String)
  • instance (String)
  • cluster (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


61
62
63
64
65
66
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/paths.rb', line 61

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

  "projects/#{project}/instances/#{instance}/clusters/#{cluster}"
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)


79
80
81
82
83
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/paths.rb', line 79

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

  "projects/#{project}/instances/#{instance}"
end

#snapshot_path(project:, instance:, cluster:, snapshot:) ⇒ ::String

Create a fully-qualified Snapshot resource string.

The resource will be in the following format:

projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}

Parameters:

  • project (String)
  • instance (String)
  • cluster (String)
  • snapshot (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


98
99
100
101
102
103
104
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/paths.rb', line 98

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

  "projects/#{project}/instances/#{instance}/clusters/#{cluster}/snapshots/#{snapshot}"
end

#table_path(project:, instance:, table:) ⇒ ::String

Create a fully-qualified Table resource string.

The resource will be in the following format:

projects/{project}/instances/{instance}/tables/{table}

Parameters:

  • project (String)
  • instance (String)
  • table (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


118
119
120
121
122
123
# File 'lib/google/cloud/bigtable/admin/v2/bigtable_table_admin/paths.rb', line 118

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

  "projects/#{project}/instances/#{instance}/tables/#{table}"
end