Discovery Engine V1 API - Class Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client (v2.3.0)

Reference documentation and code samples for the Discovery Engine V1 API class Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.

Client for the CmekConfigService service.

Service for managing CMEK related tasks

Inherits

  • Object

Methods

.configure

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

Configure the CmekConfigService 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 CmekConfigService clients
::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.configure do |config|
  config.timeout = 10.0
end

#configure

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

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

#delete_cmek_config

def delete_cmek_config(request, options = nil) -> ::Gapic::Operation
def delete_cmek_config(name: nil) -> ::Gapic::Operation

De-provisions a CmekConfig.

Overloads
def delete_cmek_config(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_cmek_config via a request object, either of type DeleteCmekConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest, ::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_cmek_config(name: nil) -> ::Gapic::Operation
Pass arguments to delete_cmek_config 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 resource name of the CmekConfig to delete, such as projects/{project}/locations/{location}/cmekConfigs/{cmek_config}.
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/discovery_engine/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1::DeleteCmekConfigRequest.new

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

#get_cmek_config

def get_cmek_config(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1::CmekConfig
def get_cmek_config(name: nil) -> ::Google::Cloud::DiscoveryEngine::V1::CmekConfig

Gets the CmekConfig.

Overloads
def get_cmek_config(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1::CmekConfig
Pass arguments to get_cmek_config via a request object, either of type GetCmekConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest, ::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_cmek_config(name: nil) -> ::Google::Cloud::DiscoveryEngine::V1::CmekConfig
Pass arguments to get_cmek_config 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. Resource name of CmekConfig, such as projects/*/locations/*/cmekConfig or projects/*/locations/*/cmekConfigs/*.

    If the caller does not have permission to access the CmekConfig, regardless of whether or not it exists, a PERMISSION_DENIED error is returned.

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/discovery_engine/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1::GetCmekConfigRequest.new

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

# The returned object is of type Google::Cloud::DiscoveryEngine::V1::CmekConfig.
p result

#initialize

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

Create a new CmekConfigService client object.

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

# Create a client using a custom configuration
client = ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new do |config|
  config.timeout = 10.0
end

#list_cmek_configs

def list_cmek_configs(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsResponse
def list_cmek_configs(parent: nil) -> ::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsResponse

Lists all the {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig}s with the project.

Overloads
def list_cmek_configs(request, options = nil) -> ::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsResponse
Pass arguments to list_cmek_configs via a request object, either of type ListCmekConfigsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest, ::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_cmek_configs(parent: nil) -> ::Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsResponse
Pass arguments to list_cmek_configs 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
  • parent (::String) — Required. The parent location resource name, such as projects/{project}/locations/{location}.

    If the caller does not have permission to list {::Google::Cloud::DiscoveryEngine::V1::CmekConfig CmekConfig}s under this location, regardless of whether or not a CmekConfig exists, a PERMISSION_DENIED error is returned.

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/discovery_engine/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsRequest.new

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

# The returned object is of type Google::Cloud::DiscoveryEngine::V1::ListCmekConfigsResponse.
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)

#operations_client

def operations_client() -> ::Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Operations

Get the associated client for long-running operations.

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)

#update_cmek_config

def update_cmek_config(request, options = nil) -> ::Gapic::Operation
def update_cmek_config(config: nil, set_default: nil) -> ::Gapic::Operation

Provisions a CMEK key for use in a location of a customer's project. This method will also conduct location validation on the provided cmekConfig to make sure the key is valid and can be used in the selected location.

Overloads
def update_cmek_config(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_cmek_config via a request object, either of type UpdateCmekConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest, ::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 update_cmek_config(config: nil, set_default: nil) -> ::Gapic::Operation
Pass arguments to update_cmek_config 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
  • 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/discovery_engine/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::DiscoveryEngine::V1::CmekConfigService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::DiscoveryEngine::V1::UpdateCmekConfigRequest.new

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