Module: Google::Cloud::Spanner::Admin::Database::V1::DatabaseAdmin::Paths

Extended by:
Paths
Included in:
Client, Paths, Rest::Client
Defined in:
lib/google/cloud/spanner/admin/database/v1/database_admin/paths.rb

Overview

Path helper methods for the DatabaseAdmin API.

Instance Method Summary collapse

Instance Method Details

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

Create a fully-qualified Backup resource string.

The resource will be in the following format:

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

Parameters:

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

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


41
42
43
44
45
46
# File 'lib/google/cloud/spanner/admin/database/v1/database_admin/paths.rb', line 41

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

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

#backup_schedule_path(project:, instance:, database:, schedule:) ⇒ ::String

Create a fully-qualified BackupSchedule resource string.

The resource will be in the following format:

projects/{project}/instances/{instance}/databases/{database}/backupSchedules/{schedule}

Parameters:

  • project (String)
  • instance (String)
  • database (String)
  • schedule (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


61
62
63
64
65
66
67
# File 'lib/google/cloud/spanner/admin/database/v1/database_admin/paths.rb', line 61

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

  "projects/#{project}/instances/#{instance}/databases/#{database}/backupSchedules/#{schedule}"
end

#crypto_key_path(project:, location:, key_ring:, crypto_key:) ⇒ ::String

Create a fully-qualified CryptoKey resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}

Parameters:

  • project (String)
  • location (String)
  • key_ring (String)
  • crypto_key (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


82
83
84
85
86
87
88
# File 'lib/google/cloud/spanner/admin/database/v1/database_admin/paths.rb', line 82

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

  "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}"
end

#crypto_key_version_path(project:, location:, key_ring:, crypto_key:, crypto_key_version:) ⇒ ::String

Create a fully-qualified CryptoKeyVersion resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}

Parameters:

  • project (String)
  • location (String)
  • key_ring (String)
  • crypto_key (String)
  • crypto_key_version (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


104
105
106
107
108
109
110
111
# File 'lib/google/cloud/spanner/admin/database/v1/database_admin/paths.rb', line 104

def crypto_key_version_path project:, location:, key_ring:, crypto_key:, crypto_key_version:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
  raise ::ArgumentError, "key_ring cannot contain /" if key_ring.to_s.include? "/"
  raise ::ArgumentError, "crypto_key cannot contain /" if crypto_key.to_s.include? "/"

  "projects/#{project}/locations/#{location}/keyRings/#{key_ring}/cryptoKeys/#{crypto_key}/cryptoKeyVersions/#{crypto_key_version}"
end

#database_path(project:, instance:, database:) ⇒ ::String

Create a fully-qualified Database resource string.

The resource will be in the following format:

projects/{project}/instances/{instance}/databases/{database}

Parameters:

  • project (String)
  • instance (String)
  • database (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


125
126
127
128
129
130
# File 'lib/google/cloud/spanner/admin/database/v1/database_admin/paths.rb', line 125

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

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


143
144
145
146
147
# File 'lib/google/cloud/spanner/admin/database/v1/database_admin/paths.rb', line 143

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

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