Cloud Key Management Service (KMS) V1 API - Class Google::Cloud::Kms::V1::EkmService::Client (v0.18.0)

Reference documentation and code samples for the Cloud Key Management Service (KMS) V1 API class Google::Cloud::Kms::V1::EkmService::Client.

Client for the EkmService service.

Google Cloud Key Management EKM Service

Manages external cryptographic keys and operations using those keys. Implements a REST model with the following objects:

Inherits

  • Object

Methods

.configure

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

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

#configure

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

Configure the EkmService 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_ekm_connection

def create_ekm_connection(request, options = nil) -> ::Google::Cloud::Kms::V1::EkmConnection
def create_ekm_connection(parent: nil, ekm_connection_id: nil, ekm_connection: nil) -> ::Google::Cloud::Kms::V1::EkmConnection

Creates a new EkmConnection in a given Project and Location.

Overloads
def create_ekm_connection(request, options = nil) -> ::Google::Cloud::Kms::V1::EkmConnection
Pass arguments to create_ekm_connection via a request object, either of type CreateEkmConnectionRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Kms::V1::CreateEkmConnectionRequest, ::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_ekm_connection(parent: nil, ekm_connection_id: nil, ekm_connection: nil) -> ::Google::Cloud::Kms::V1::EkmConnection
Pass arguments to create_ekm_connection 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 resource name of the location associated with the EkmConnection, in the format projects/*/locations/*.
  • ekm_connection_id (::String) — Required. It must be unique within a location and match the regular expression [a-zA-Z0-9_-]{1,63}.
  • ekm_connection (::Google::Cloud::Kms::V1::EkmConnection, ::Hash) — Required. An EkmConnection with initial field values.
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/kms/v1"

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

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

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

# The returned object is of type Google::Cloud::Kms::V1::EkmConnection.
p result

#get_ekm_config

def get_ekm_config(request, options = nil) -> ::Google::Cloud::Kms::V1::EkmConfig
def get_ekm_config(name: nil) -> ::Google::Cloud::Kms::V1::EkmConfig

Returns the EkmConfig singleton resource for a given project and location.

Overloads
def get_ekm_config(request, options = nil) -> ::Google::Cloud::Kms::V1::EkmConfig
Pass arguments to get_ekm_config via a request object, either of type GetEkmConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Kms::V1::GetEkmConfigRequest, ::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_ekm_config(name: nil) -> ::Google::Cloud::Kms::V1::EkmConfig
Pass arguments to get_ekm_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 name of the EkmConfig to get.
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/kms/v1"

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

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

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

# The returned object is of type Google::Cloud::Kms::V1::EkmConfig.
p result

#get_ekm_connection

def get_ekm_connection(request, options = nil) -> ::Google::Cloud::Kms::V1::EkmConnection
def get_ekm_connection(name: nil) -> ::Google::Cloud::Kms::V1::EkmConnection

Returns metadata for a given EkmConnection.

Overloads
def get_ekm_connection(request, options = nil) -> ::Google::Cloud::Kms::V1::EkmConnection
Pass arguments to get_ekm_connection via a request object, either of type GetEkmConnectionRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Kms::V1::GetEkmConnectionRequest, ::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_ekm_connection(name: nil) -> ::Google::Cloud::Kms::V1::EkmConnection
Pass arguments to get_ekm_connection 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
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/kms/v1"

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

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

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

# The returned object is of type Google::Cloud::Kms::V1::EkmConnection.
p result

#iam_policy_client

def iam_policy_client() -> Google::Iam::V1::IAMPolicy::Client

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

Returns
  • (Google::Iam::V1::IAMPolicy::Client)

#initialize

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

Create a new EkmService client object.

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

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

#list_ekm_connections

def list_ekm_connections(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::EkmConnection>
def list_ekm_connections(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::EkmConnection>
Overloads
def list_ekm_connections(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::EkmConnection>
Pass arguments to list_ekm_connections via a request object, either of type ListEkmConnectionsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Kms::V1::ListEkmConnectionsRequest, ::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_ekm_connections(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::EkmConnection>
Pass arguments to list_ekm_connections 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
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/kms/v1"

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

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

# Call the list_ekm_connections method.
result = client.list_ekm_connections 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::Kms::V1::EkmConnection.
  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)

#update_ekm_config

def update_ekm_config(request, options = nil) -> ::Google::Cloud::Kms::V1::EkmConfig
def update_ekm_config(ekm_config: nil, update_mask: nil) -> ::Google::Cloud::Kms::V1::EkmConfig

Updates the EkmConfig singleton resource for a given project and location.

Overloads
def update_ekm_config(request, options = nil) -> ::Google::Cloud::Kms::V1::EkmConfig
Pass arguments to update_ekm_config via a request object, either of type UpdateEkmConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Kms::V1::UpdateEkmConfigRequest, ::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_ekm_config(ekm_config: nil, update_mask: nil) -> ::Google::Cloud::Kms::V1::EkmConfig
Pass arguments to update_ekm_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
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/kms/v1"

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

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

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

# The returned object is of type Google::Cloud::Kms::V1::EkmConfig.
p result

#update_ekm_connection

def update_ekm_connection(request, options = nil) -> ::Google::Cloud::Kms::V1::EkmConnection
def update_ekm_connection(ekm_connection: nil, update_mask: nil) -> ::Google::Cloud::Kms::V1::EkmConnection

Updates an EkmConnection's metadata.

Overloads
def update_ekm_connection(request, options = nil) -> ::Google::Cloud::Kms::V1::EkmConnection
Pass arguments to update_ekm_connection via a request object, either of type UpdateEkmConnectionRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Kms::V1::UpdateEkmConnectionRequest, ::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_ekm_connection(ekm_connection: nil, update_mask: nil) -> ::Google::Cloud::Kms::V1::EkmConnection
Pass arguments to update_ekm_connection 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/kms/v1"

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

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

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

# The returned object is of type Google::Cloud::Kms::V1::EkmConnection.
p result