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

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

Client for the SqlWorkloadCapturesService service.

Cloud SQL Workload Captures service.

Inherits

  • Object

Methods

.configure

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

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

#configure

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

Configure the SqlWorkloadCapturesService 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

#initialize

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

Create a new SqlWorkloadCapturesService client object.

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

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

#list

def list(request, options = nil) -> ::Google::Cloud::Sql::V1beta4::WorkloadCapturesListResponse
def list(project: nil, instance: nil) -> ::Google::Cloud::Sql::V1beta4::WorkloadCapturesListResponse

Lists all captured workloads associated with the instance.

Overloads
def list(request, options = nil) -> ::Google::Cloud::Sql::V1beta4::WorkloadCapturesListResponse
Pass arguments to list via a request object, either of type Google::Cloud::Sql::V1beta4::SqlWorkloadCapturesListRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1beta4::SqlWorkloadCapturesListRequest, ::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(project: nil, instance: nil) -> ::Google::Cloud::Sql::V1beta4::WorkloadCapturesListResponse
Pass arguments to list 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
  • project (::String) — Required. Project ID of the project that contains the instance.
  • instance (::String) — Required. Cloud SQL instance ID. This does not include the project ID.
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::SqlWorkloadCapturesService::Client.new

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

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

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

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

#start

def start(request, options = nil) -> ::Google::Cloud::Sql::V1beta4::Operation
def start(project: nil, instance: nil, start_workload_capture_context: nil) -> ::Google::Cloud::Sql::V1beta4::Operation

Starts capturing the SQL queries, transactions, and other operations executed on the primary instance. This traffic is securely stored and forms a "captured workload". This workload can be replayed later on a different instance to safely test performance impacts, database upgrades, configuration changes etc. before applying them to production.

Overloads
def start(request, options = nil) -> ::Google::Cloud::Sql::V1beta4::Operation
Pass arguments to start via a request object, either of type Google::Cloud::Sql::V1beta4::SqlWorkloadCapturesStartRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1beta4::SqlWorkloadCapturesStartRequest, ::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 start(project: nil, instance: nil, start_workload_capture_context: nil) -> ::Google::Cloud::Sql::V1beta4::Operation
Pass arguments to start 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
  • project (::String) — Required. Project ID of the project that contains the instance.
  • instance (::String) — Required. Cloud SQL instance ID. This does not include the project ID.
  • start_workload_capture_context (::Google::Cloud::Sql::V1beta4::StartWorkloadCaptureContext, ::Hash) — Optional. Contains details about the start workload capture operation.
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::SqlWorkloadCapturesService::Client.new

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

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

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

#start_replay

def start_replay(request, options = nil) -> ::Google::Cloud::Sql::V1beta4::Operation
def start_replay(project: nil, instance: nil, start_workload_replay_context: nil, workload_id: nil) -> ::Google::Cloud::Sql::V1beta4::Operation

Starts executing a captured workload on a separate Cloud SQL instance provisioned for workload replay. This target instance simulates the production environment without affecting the primary instance.

Overloads
def start_replay(request, options = nil) -> ::Google::Cloud::Sql::V1beta4::Operation
Pass arguments to start_replay via a request object, either of type Google::Cloud::Sql::V1beta4::SqlWorkloadCapturesStartReplayRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1beta4::SqlWorkloadCapturesStartReplayRequest, ::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 start_replay(project: nil, instance: nil, start_workload_replay_context: nil, workload_id: nil) -> ::Google::Cloud::Sql::V1beta4::Operation
Pass arguments to start_replay 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
  • project (::String) — Required. Project ID of the project that contains the instance.
  • instance (::String) — Required. Cloud SQL instance ID. This does not include the project ID.
  • start_workload_replay_context (::Google::Cloud::Sql::V1beta4::StartWorkloadReplayContext, ::Hash) — Required. Contains details about the start workload replay operation.
  • workload_id (::String) — Required. The ID of the workload to replay.
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::SqlWorkloadCapturesService::Client.new

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

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

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

#stop

def stop(request, options = nil) -> ::Google::Cloud::Sql::V1beta4::Operation
def stop(project: nil, instance: nil, stop_workload_capture_context: nil) -> ::Google::Cloud::Sql::V1beta4::Operation

Stops capturing the query traffic and related operations executed on the primary instance.

Overloads
def stop(request, options = nil) -> ::Google::Cloud::Sql::V1beta4::Operation
Pass arguments to stop via a request object, either of type Google::Cloud::Sql::V1beta4::SqlWorkloadCapturesStopRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1beta4::SqlWorkloadCapturesStopRequest, ::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 stop(project: nil, instance: nil, stop_workload_capture_context: nil) -> ::Google::Cloud::Sql::V1beta4::Operation
Pass arguments to stop 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
  • project (::String) — Required. Project ID of the project that contains the instance.
  • instance (::String) — Required. Cloud SQL instance ID. This does not include the project ID.
  • stop_workload_capture_context (::Google::Cloud::Sql::V1beta4::StopWorkloadCaptureContext, ::Hash) — Optional. Contains details about the stop workload capture operation.
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::SqlWorkloadCapturesService::Client.new

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

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

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

#stop_replay

def stop_replay(request, options = nil) -> ::Google::Cloud::Sql::V1beta4::Operation
def stop_replay(project: nil, instance: nil, stop_workload_replay_context: nil) -> ::Google::Cloud::Sql::V1beta4::Operation

Stops an active workload replay on the target Cloud SQL replay instance.

Overloads
def stop_replay(request, options = nil) -> ::Google::Cloud::Sql::V1beta4::Operation
Pass arguments to stop_replay via a request object, either of type Google::Cloud::Sql::V1beta4::SqlWorkloadCapturesStopReplayRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Sql::V1beta4::SqlWorkloadCapturesStopReplayRequest, ::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 stop_replay(project: nil, instance: nil, stop_workload_replay_context: nil) -> ::Google::Cloud::Sql::V1beta4::Operation
Pass arguments to stop_replay 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
  • project (::String) — Required. Project ID of the project that contains the target replay instance.
  • instance (::String) — Required. Cloud SQL instance ID of the target replay instance. This does not include the project ID.
  • stop_workload_replay_context (::Google::Cloud::Sql::V1beta4::StopWorkloadReplayContext, ::Hash) — Optional. Contains details about the stop workload replay operation.
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::SqlWorkloadCapturesService::Client.new

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

# Call the stop_replay method.
result = client.stop_replay 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)