Module: Google::Cloud::AlloyDB::V1alpha::AlloyDBAdmin::Paths

Extended by:
Paths
Included in:
Client, Paths
Defined in:
lib/google/cloud/alloy_db/v1alpha/alloy_db_admin/paths.rb

Overview

Path helper methods for the AlloyDBAdmin API.

Instance Method Summary collapse

Instance Method Details

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

Create a fully-qualified Backup resource string.

The resource will be in the following format:

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

Parameters:

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

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


39
40
41
42
43
44
# File 'lib/google/cloud/alloy_db/v1alpha/alloy_db_admin/paths.rb', line 39

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

  "projects/#{project}/locations/#{location}/backups/#{backup}"
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)


58
59
60
61
62
63
# File 'lib/google/cloud/alloy_db/v1alpha/alloy_db_admin/paths.rb', line 58

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


79
80
81
82
83
84
85
86
# File 'lib/google/cloud/alloy_db/v1alpha/alloy_db_admin/paths.rb', line 79

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

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

Create a fully-qualified Instance resource string.

The resource will be in the following format:

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

Parameters:

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

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


101
102
103
104
105
106
107
# File 'lib/google/cloud/alloy_db/v1alpha/alloy_db_admin/paths.rb', line 101

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

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


120
121
122
123
124
# File 'lib/google/cloud/alloy_db/v1alpha/alloy_db_admin/paths.rb', line 120

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

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

#network_path(project:, network:) ⇒ ::String

Create a fully-qualified Network resource string.

The resource will be in the following format:

projects/{project}/global/networks/{network}

Parameters:

  • project (String)
  • network (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


137
138
139
140
141
# File 'lib/google/cloud/alloy_db/v1alpha/alloy_db_admin/paths.rb', line 137

def network_path project:, network:
  raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"

  "projects/#{project}/global/networks/#{network}"
end

#user_path(project:, location:, cluster:, user:) ⇒ ::String

Create a fully-qualified User resource string.

The resource will be in the following format:

projects/{project}/locations/{location}/clusters/{cluster}/users/{user}

Parameters:

  • project (String)
  • location (String)
  • cluster (String)
  • user (String)

Returns:

  • (::String)

Raises:

  • (::ArgumentError)


156
157
158
159
160
161
162
# File 'lib/google/cloud/alloy_db/v1alpha/alloy_db_admin/paths.rb', line 156

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

  "projects/#{project}/locations/#{location}/clusters/#{cluster}/users/#{user}"
end