AlloyDB V1BETA API - Class Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client (v0.5.0)

Reference documentation and code samples for the AlloyDB V1BETA API class Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.

Client for the AlloyDBAdmin service.

Service describing handlers for resources

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the AlloyDBAdmin Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all AlloyDBAdmin clients
::Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.configure do |config|
  config.timeout = 10.0
end

#batch_create_instances

def batch_create_instances(request, options = nil) -> ::Gapic::Operation
def batch_create_instances(parent: nil, requests: nil, request_id: nil) -> ::Gapic::Operation

Creates new instances under the given project, location and cluster. There can be only one primary instance in a cluster. If the primary instance exists in the cluster as well as this request, then API will throw an error. The primary instance should exist before any read pool instance is created. If the primary instance is a part of the request payload, then the API will take care of creating instances in the correct order. This method is here to support Google-internal use cases, and is not meant for external customers to consume. Please do not start relying on it; its behavior is subject to change without notice.

Overloads
def batch_create_instances(request, options = nil) -> ::Gapic::Operation
Pass arguments to batch_create_instances via a request object, either of type BatchCreateInstancesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def batch_create_instances(parent: nil, requests: nil, request_id: nil) -> ::Gapic::Operation
Pass arguments to batch_create_instances via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The name of the parent resource.
  • requests (::Google::Cloud::AlloyDB::V1beta::CreateInstanceRequests, ::Hash) — Required. Resources being created.
  • request_id (::String) — Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

    For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

    The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/alloy_db/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AlloyDB::V1beta::BatchCreateInstancesRequest.new

# Call the batch_create_instances method.
result = client.batch_create_instances request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#configure

def configure() { |config| ... } -> Client::Configuration

Configure the AlloyDBAdmin Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#create_backup

def create_backup(request, options = nil) -> ::Gapic::Operation
def create_backup(parent: nil, backup_id: nil, backup: nil, request_id: nil, validate_only: nil) -> ::Gapic::Operation

Creates a new Backup in a given project and location.

Overloads
def create_backup(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_backup via a request object, either of type CreateBackupRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AlloyDB::V1beta::CreateBackupRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_backup(parent: nil, backup_id: nil, backup: nil, request_id: nil, validate_only: nil) -> ::Gapic::Operation
Pass arguments to create_backup via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. Value for parent.
  • backup_id (::String) — Required. ID of the requesting object.
  • backup (::Google::Cloud::AlloyDB::V1beta::Backup, ::Hash) — Required. The resource being created
  • request_id (::String) — Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

    For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

    The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

  • validate_only (::Boolean) — Optional. If set, the backend validates the request, but doesn't actually execute it.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/alloy_db/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AlloyDB::V1beta::CreateBackupRequest.new

# Call the create_backup method.
result = client.create_backup request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#create_cluster

def create_cluster(request, options = nil) -> ::Gapic::Operation
def create_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil, validate_only: nil) -> ::Gapic::Operation

Creates a new Cluster in a given project and location.

Overloads
def create_cluster(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_cluster via a request object, either of type CreateClusterRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AlloyDB::V1beta::CreateClusterRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil, validate_only: nil) -> ::Gapic::Operation
Pass arguments to create_cluster via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The location of the new cluster. For the required format, see the comment on the Cluster.name field.
  • cluster_id (::String) — Required. ID of the requesting object.
  • cluster (::Google::Cloud::AlloyDB::V1beta::Cluster, ::Hash) — Required. The resource being created
  • request_id (::String) — Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

    For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

    The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

  • validate_only (::Boolean) — Optional. If set, performs request validation (e.g. permission checks and any other type of validation), but do not actually execute the create request.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/alloy_db/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AlloyDB::V1beta::CreateClusterRequest.new

# Call the create_cluster method.
result = client.create_cluster request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#create_instance

def create_instance(request, options = nil) -> ::Gapic::Operation
def create_instance(parent: nil, instance_id: nil, instance: nil, request_id: nil, validate_only: nil) -> ::Gapic::Operation

Creates a new Instance in a given project and location.

Overloads
def create_instance(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_instance via a request object, either of type CreateInstanceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AlloyDB::V1beta::CreateInstanceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_instance(parent: nil, instance_id: nil, instance: nil, request_id: nil, validate_only: nil) -> ::Gapic::Operation
Pass arguments to create_instance via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The name of the parent resource. For the required format, see the comment on the Instance.name field.
  • instance_id (::String) — Required. ID of the requesting object.
  • instance (::Google::Cloud::AlloyDB::V1beta::Instance, ::Hash) — Required. The resource being created
  • request_id (::String) — Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

    For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

    The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

  • validate_only (::Boolean) — Optional. If set, performs request validation (e.g. permission checks and any other type of validation), but do not actually execute the create request.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/alloy_db/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AlloyDB::V1beta::CreateInstanceRequest.new

# Call the create_instance method.
result = client.create_instance request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#create_secondary_cluster

def create_secondary_cluster(request, options = nil) -> ::Gapic::Operation
def create_secondary_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil, validate_only: nil) -> ::Gapic::Operation

Creates a cluster of type SECONDARY in the given location using the primary cluster as the source.

Overloads
def create_secondary_cluster(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_secondary_cluster via a request object, either of type CreateSecondaryClusterRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AlloyDB::V1beta::CreateSecondaryClusterRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_secondary_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil, validate_only: nil) -> ::Gapic::Operation
Pass arguments to create_secondary_cluster via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The location of the new cluster. For the required format, see the comment on the Cluster.name field.
  • cluster_id (::String) — Required. ID of the requesting object (the secondary cluster).
  • cluster (::Google::Cloud::AlloyDB::V1beta::Cluster, ::Hash) — Required. Configuration of the requesting object (the secondary cluster).
  • request_id (::String) — Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

    For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

    The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

  • validate_only (::Boolean) — Optional. If set, performs request validation (e.g. permission checks and any other type of validation), but do not actually execute the create request.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/alloy_db/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AlloyDB::V1beta::CreateSecondaryClusterRequest.new

# Call the create_secondary_cluster method.
result = client.create_secondary_cluster request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#create_secondary_instance

def create_secondary_instance(request, options = nil) -> ::Gapic::Operation
def create_secondary_instance(parent: nil, instance_id: nil, instance: nil, request_id: nil, validate_only: nil) -> ::Gapic::Operation

Creates a new SECONDARY Instance in a given project and location.

Overloads
def create_secondary_instance(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_secondary_instance via a request object, either of type CreateSecondaryInstanceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AlloyDB::V1beta::CreateSecondaryInstanceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_secondary_instance(parent: nil, instance_id: nil, instance: nil, request_id: nil, validate_only: nil) -> ::Gapic::Operation
Pass arguments to create_secondary_instance via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The name of the parent resource. For the required format, see the comment on the Instance.name field.
  • instance_id (::String) — Required. ID of the requesting object.
  • instance (::Google::Cloud::AlloyDB::V1beta::Instance, ::Hash) — Required. The resource being created
  • request_id (::String) — Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

    For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

    The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

  • validate_only (::Boolean) — Optional. If set, performs request validation (e.g. permission checks and any other type of validation), but do not actually execute the create request.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/alloy_db/v1beta"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::AlloyDB::V1beta::AlloyDBAdmin::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AlloyDB::V1beta::CreateSecondaryInstanceRequest.new

# Call the create_secondary_instance method.
result = client.create_secondary_instance request

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#create_user

def create_user(request, options = nil) -> ::Google::Cloud::AlloyDB::V1beta::User
def create_user(parent: nil, user_id: nil, user: nil, request_id: nil, validate_only: nil) -> ::Google::Cloud::AlloyDB::V1beta::User

Creates a new User in a given project, location, and cluster.

Overloads
def create_user(request, options = nil) -> ::Google::Cloud::AlloyDB::V1beta::User
Pass arguments to create_user via a request object, either of type CreateUserRequest or an equivalent Hash.
Parameters