Cloud SQL Admin V1BETA4 API - Class Google::Cloud::Sql::V1beta4::BlueGreenDeploymentsService::Client (v0.3.0)

Reference documentation and code samples for the Cloud SQL Admin V1BETA4 API class Google::Cloud::Sql::V1beta4::BlueGreenDeploymentsService::Client.

Client for the BlueGreenDeploymentsService service.

Service for managing blue-green deployments.

Inherits

  • Object

Methods

.configure

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

Configure the BlueGreenDeploymentsService 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 BlueGreenDeploymentsService clients
::Google::Cloud::Sql::V1beta4::BlueGreenDeploymentsService::Client.configure do |config|
  config.timeout = 10.0
end

#configure

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

Configure the BlueGreenDeploymentsService 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_blue_green_deployment

def create_blue_green_deployment(request, options = nil) -> ::Google::Cloud::Sql::V1beta4::Operation
def create_blue_green_deployment(parent: nil, blue_green_deployment_id: nil, blue_green_deployment: nil) -> ::Google::Cloud::Sql::V1beta4::Operation

Creates a blue-green deployment under a given project and location. This deployment provisions a synchronized green environment (target instance) from a blue production environment (source instance), facilitating updates like major version upgrades on the green instance without impacting the blue instance.

Overloads
def create_blue_green_deployment(request, options = nil) -> ::Google::Cloud::Sql::V1beta4::Operation
Pass arguments to create_blue_green_deployment via a request object, either of type CreateBlueGreenDeploymentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1beta4::CreateBlueGreenDeploymentRequest, ::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_blue_green_deployment(parent: nil, blue_green_deployment_id: nil, blue_green_deployment: nil) -> ::Google::Cloud::Sql::V1beta4::Operation
Pass arguments to create_blue_green_deployment 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 parent resource where this blue-green deployment will be created. Format: projects/{project}/locations/{location}
  • blue_green_deployment_id (::String) — Required. The ID to use for the blue-green deployment, which will become the final component of the deployment's resource name.
  • blue_green_deployment (::Google::Cloud::Sql::V1beta4::BlueGreenDeployment, ::Hash) — Required. The BlueGreenDeployment resource to create.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1beta4"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Sql::V1beta4::BlueGreenDeploymentsService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Sql::V1beta4::CreateBlueGreenDeploymentRequest.new

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

# The returned object is of type Google::Cloud::Sql::V1beta4::Operation.
p result

#delete_blue_green_deployment

def delete_blue_green_deployment(request, options = nil) -> ::Google::Cloud::Sql::V1beta4::Operation
def delete_blue_green_deployment(name: nil, delete_old_source: nil) -> ::Google::Cloud::Sql::V1beta4::Operation

Deletes a blue-green deployment, including metadata and underlying resources based on the deployment state. If issued before switchover, this deletes the green instance. If issued after switchover, this deletes the old blue instance (source instance) if the delete_old_source field in the request is set to true. All blue-green deployment metadata is permanently deleted. Resources deleted as a result of this operation are no longer accessible and can't be restored.

Overloads
def delete_blue_green_deployment(request, options = nil) -> ::Google::Cloud::Sql::V1beta4::Operation
Pass arguments to delete_blue_green_deployment via a request object, either of type DeleteBlueGreenDeploymentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1beta4::DeleteBlueGreenDeploymentRequest, ::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 delete_blue_green_deployment(name: nil, delete_old_source: nil) -> ::Google::Cloud::Sql::V1beta4::Operation
Pass arguments to delete_blue_green_deployment 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
  • name (::String) — Required. The name of the blue-green deployment to delete. Format: projects/{project}/locations/{location}/blueGreenDeployments/{blue_green_deployment}
  • delete_old_source (::Boolean) — Optional. If set to true, and the switchover is complete, this deletes the old source instance along with the deployment.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1beta4"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Sql::V1beta4::BlueGreenDeploymentsService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Sql::V1beta4::DeleteBlueGreenDeploymentRequest.new

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

# The returned object is of type Google::Cloud::Sql::V1beta4::Operation.
p result

#get_blue_green_deployment

def get_blue_green_deployment(request, options = nil) -> ::Google::Cloud::Sql::V1beta4::BlueGreenDeployment
def get_blue_green_deployment(name: nil, view: nil) -> ::Google::Cloud::Sql::V1beta4::BlueGreenDeployment

Retrieves a blue-green deployment resource under a given project and location.

Overloads
def get_blue_green_deployment(request, options = nil) -> ::Google::Cloud::Sql::V1beta4::BlueGreenDeployment
Pass arguments to get_blue_green_deployment via a request object, either of type GetBlueGreenDeploymentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1beta4::GetBlueGreenDeploymentRequest, ::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 get_blue_green_deployment(name: nil, view: nil) -> ::Google::Cloud::Sql::V1beta4::BlueGreenDeployment
Pass arguments to get_blue_green_deployment 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
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1beta4"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Sql::V1beta4::BlueGreenDeploymentsService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Sql::V1beta4::GetBlueGreenDeploymentRequest.new

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

# The returned object is of type Google::Cloud::Sql::V1beta4::BlueGreenDeployment.
p result

#initialize

def initialize() { |config| ... } -> Client

Create a new BlueGreenDeploymentsService client object.

Yields
  • (config) — Configure the BlueGreenDeploymentsService client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::Sql::V1beta4::BlueGreenDeploymentsService::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Sql::V1beta4::BlueGreenDeploymentsService::Client.new do |config|
  config.timeout = 10.0
end

#list_blue_green_deployments

def list_blue_green_deployments(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Sql::V1beta4::BlueGreenDeployment>
def list_blue_green_deployments(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Sql::V1beta4::BlueGreenDeployment>

Lists blue-green deployments under a given project.

Overloads
def list_blue_green_deployments(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Sql::V1beta4::BlueGreenDeployment>
Pass arguments to list_blue_green_deployments via a request object, either of type ListBlueGreenDeploymentsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1beta4::ListBlueGreenDeploymentsRequest, ::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 list_blue_green_deployments(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Sql::V1beta4::BlueGreenDeployment>
Pass arguments to list_blue_green_deployments 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 parent resource whose blue-green deployments are to be listed. Format: projects/{project}/locations/{location}
  • page_size (::Integer) — Optional. The maximum number of deployments to return.
  • page_token (::String) — Optional. A page token, received from a previous ListBlueGreenDeployments call. Provide this to retrieve the subsequent page.
  • filter (::String) — Optional. A filter expression that filters the results.
  • order_by (::String) — Optional. A comma-separated list of fields to order the results by.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1beta4"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Sql::V1beta4::BlueGreenDeploymentsService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Sql::V1beta4::ListBlueGreenDeploymentsRequest.new

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

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::Sql::V1beta4::BlueGreenDeployment.
  p item
end

#location_client

def location_client() -> Google::Cloud::Location::Locations::Client

Get the associated client for mix-in of the Locations.

Returns
  • (Google::Cloud::Location::Locations::Client)

#logger

def logger() -> Logger

The logger used for request/response debug logging.

Returns
  • (Logger)

#switchover_blue_green_deployment

def switchover_blue_green_deployment(request, options = nil) -> ::Google::Cloud::Sql::V1beta4::Operation
def switchover_blue_green_deployment(name: nil) -> ::Google::Cloud::Sql::V1beta4::Operation

Switches over to green instance for a blue-green deployment.

Overloads
def switchover_blue_green_deployment(request, options = nil) -> ::Google::Cloud::Sql::V1beta4::Operation
Pass arguments to switchover_blue_green_deployment via a request object, either of type SwitchoverBlueGreenDeploymentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1beta4::SwitchoverBlueGreenDeploymentRequest, ::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 switchover_blue_green_deployment(name: nil) -> ::Google::Cloud::Sql::V1beta4::Operation
Pass arguments to switchover_blue_green_deployment 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).
Parameter
  • name (::String) — Required. The name of the blue-green deployment to switch over. Format: projects/{project}/locations/{location}/blueGreenDeployments/{blue_green_deployment}
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/sql/v1beta4"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Sql::V1beta4::BlueGreenDeploymentsService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Sql::V1beta4::SwitchoverBlueGreenDeploymentRequest.new

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

# The returned object is of type Google::Cloud::Sql::V1beta4::Operation.
p result

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)