Module: Google::Cloud::GkeBackup::V1::BackupForGKE::Paths

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

Overview

Path helper methods for the BackupForGKE API.

Instance Method Summary collapse

Instance Method Details

#backup_path(project:, location:, backup_plan:, backup:) ⇒ ::String

Create a fully-qualified Backup resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/backupPlans/{backup_plan}/backups/{backup}

Parameters:

  • project (String)
  • location (String)
  • backup_plan (String)
  • backup (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


40
41
42
43
44
45
46
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/paths.rb', line 40

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

  "projects/#{project}/locations/#{location}/backupPlans/#{backup_plan}/backups/#{backup}"
end

#backup_plan_path(project:, location:, backup_plan:) ⇒ ::String

Create a fully-qualified BackupPlan resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/backupPlans/{backup_plan}

Parameters:

  • project (String)
  • location (String)
  • backup_plan (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


60
61
62
63
64
65
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/paths.rb', line 60

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

  "projects/#{project}/locations/#{location}/backupPlans/#{backup_plan}"
end

#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)


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

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

#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)


99
100
101
102
103
104
105
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/paths.rb', line 99

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

#location_path(project:, location:) ⇒ ::String

Create a fully-qualified Location resource string.

The resource will be in the following format:

projects/{project}/locations/{location}

Parameters:

  • project (String)
  • location (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


118
119
120
121
122
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/paths.rb', line 118

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

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

#restore_path(project:, location:, restore_plan:, restore:) ⇒ ::String

Create a fully-qualified Restore resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/restorePlans/{restore_plan}/restores/{restore}

Parameters:

  • project (String)
  • location (String)
  • restore_plan (String)
  • restore (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


137
138
139
140
141
142
143
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/paths.rb', line 137

def restore_path project:, location:, restore_plan:, restore:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
  raise ::ArgumentError, "restore_plan cannot contain /" if restore_plan.to_s.include? "/"

  "projects/#{project}/locations/#{location}/restorePlans/#{restore_plan}/restores/#{restore}"
end

#restore_plan_path(project:, location:, restore_plan:) ⇒ ::String

Create a fully-qualified RestorePlan resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/restorePlans/{restore_plan}

Parameters:

  • project (String)
  • location (String)
  • restore_plan (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


157
158
159
160
161
162
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/paths.rb', line 157

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

  "projects/#{project}/locations/#{location}/restorePlans/#{restore_plan}"
end

#volume_backup_path(project:, location:, backup_plan:, backup:, volume_backup:) ⇒ ::String

Create a fully-qualified VolumeBackup resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/backupPlans/{backup_plan}/backups/{backup}/volumeBackups/{volume_backup}

Parameters:

  • project (String)
  • location (String)
  • backup_plan (String)
  • backup (String)
  • volume_backup (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


178
179
180
181
182
183
184
185
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/paths.rb', line 178

def volume_backup_path project:, location:, backup_plan:, backup:, volume_backup:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
  raise ::ArgumentError, "backup_plan cannot contain /" if backup_plan.to_s.include? "/"
  raise ::ArgumentError, "backup cannot contain /" if backup.to_s.include? "/"

  "projects/#{project}/locations/#{location}/backupPlans/#{backup_plan}/backups/#{backup}/volumeBackups/#{volume_backup}"
end

#volume_restore_path(project:, location:, restore_plan:, restore:, volume_restore:) ⇒ ::String

Create a fully-qualified VolumeRestore resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/restorePlans/{restore_plan}/restores/{restore}/volumeRestores/{volume_restore}

Parameters:

  • project (String)
  • location (String)
  • restore_plan (String)
  • restore (String)
  • volume_restore (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


201
202
203
204
205
206
207
208
# File 'lib/google/cloud/gke_backup/v1/backup_for_gke/paths.rb', line 201

def volume_restore_path project:, location:, restore_plan:, restore:, volume_restore:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
  raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
  raise ::ArgumentError, "restore_plan cannot contain /" if restore_plan.to_s.include? "/"
  raise ::ArgumentError, "restore cannot contain /" if restore.to_s.include? "/"

  "projects/#{project}/locations/#{location}/restorePlans/#{restore_plan}/restores/#{restore}/volumeRestores/#{volume_restore}"
end