Cloud Key Management Service (KMS) V1 API - Class Google::Cloud::Kms::V1::AutokeyAdmin::Client (v1.3.0)

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

Client for the AutokeyAdmin service.

Provides interfaces for managing Cloud KMS Autokey folder-level configurations. A configuration is inherited by all descendent projects. A configuration at one folder overrides any other configurations in its ancestry. Setting a configuration on a folder is a prerequisite for Cloud KMS Autokey, so that users working in a descendant project can request provisioned CryptoKeys, ready for Customer Managed Encryption Key (CMEK) use, on-demand.

Inherits

  • Object

Methods

.configure

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

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

#configure

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

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

#get_autokey_config

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

Returns the AutokeyConfig for a folder.

Overloads
def get_autokey_config(request, options = nil) -> ::Google::Cloud::Kms::V1::AutokeyConfig
Pass arguments to get_autokey_config via a request object, either of type GetAutokeyConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Kms::V1::GetAutokeyConfigRequest, ::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_autokey_config(name: nil) -> ::Google::Cloud::Kms::V1::AutokeyConfig
Pass arguments to get_autokey_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. Name of the AutokeyConfig resource, e.g. folders/{FOLDER_NUMBER}/autokeyConfig.
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::AutokeyAdmin::Client.new

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

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

# The returned object is of type Google::Cloud::Kms::V1::AutokeyConfig.
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 AutokeyAdmin client object.

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

# Create a client using a custom configuration
client = ::Google::Cloud::Kms::V1::AutokeyAdmin::Client.new do |config|
  config.timeout = 10.0
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)

#show_effective_autokey_config

def show_effective_autokey_config(request, options = nil) -> ::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigResponse
def show_effective_autokey_config(parent: nil) -> ::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigResponse

Returns the effective Cloud KMS Autokey configuration for a given project.

Overloads
def show_effective_autokey_config(request, options = nil) -> ::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigResponse
Pass arguments to show_effective_autokey_config via a request object, either of type ShowEffectiveAutokeyConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigRequest, ::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 show_effective_autokey_config(parent: nil) -> ::Google::Cloud::Kms::V1::ShowEffectiveAutokeyConfigResponse
Pass arguments to show_effective_autokey_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
  • parent (::String) — Required. Name of the resource project to the show effective Cloud KMS Autokey configuration for. This may be helpful for interrogating the effect of nested folder configurations on a given resource project.
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::AutokeyAdmin::Client.new

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

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

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

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)

#update_autokey_config

def update_autokey_config(request, options = nil) -> ::Google::Cloud::Kms::V1::AutokeyConfig
def update_autokey_config(autokey_config: nil, update_mask: nil) -> ::Google::Cloud::Kms::V1::AutokeyConfig

Updates the AutokeyConfig for a folder. The caller must have both cloudkms.autokeyConfigs.update permission on the parent folder and cloudkms.cryptoKeys.setIamPolicy permission on the provided key project. A KeyHandle creation in the folder's descendant projects will use this configuration to determine where to create the resulting CryptoKey.

Overloads
def update_autokey_config(request, options = nil) -> ::Google::Cloud::Kms::V1::AutokeyConfig
Pass arguments to update_autokey_config via a request object, either of type UpdateAutokeyConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Kms::V1::UpdateAutokeyConfigRequest, ::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_autokey_config(autokey_config: nil, update_mask: nil) -> ::Google::Cloud::Kms::V1::AutokeyConfig
Pass arguments to update_autokey_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::AutokeyAdmin::Client.new

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

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

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