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

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

Client for the HsmManagement service.

Google Cloud HSM Management Service

Provides interfaces for managing HSM instances.

Implements a REST model with the following objects:

Inherits

  • Object

Methods

.configure

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

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

#approve_single_tenant_hsm_instance_proposal

def approve_single_tenant_hsm_instance_proposal(request, options = nil) -> ::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalResponse
def approve_single_tenant_hsm_instance_proposal(name: nil, quorum_reply: nil, required_action_quorum_reply: nil) -> ::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalResponse

Approves a SingleTenantHsmInstanceProposal for a given SingleTenantHsmInstance. The proposal must be in the PENDING state.

Overloads
def approve_single_tenant_hsm_instance_proposal(request, options = nil) -> ::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalResponse
Pass arguments to approve_single_tenant_hsm_instance_proposal via a request object, either of type ApproveSingleTenantHsmInstanceProposalRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalRequest, ::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 approve_single_tenant_hsm_instance_proposal(name: nil, quorum_reply: nil, required_action_quorum_reply: nil) -> ::Google::Cloud::Kms::V1::ApproveSingleTenantHsmInstanceProposalResponse
Pass arguments to approve_single_tenant_hsm_instance_proposal 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::HsmManagement::Client.new

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

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

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

#configure

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

Configure the HsmManagement 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_single_tenant_hsm_instance

def create_single_tenant_hsm_instance(request, options = nil) -> ::Gapic::Operation
def create_single_tenant_hsm_instance(parent: nil, single_tenant_hsm_instance_id: nil, single_tenant_hsm_instance: nil) -> ::Gapic::Operation

Creates a new SingleTenantHsmInstance in a given Project and Location. User must create a RegisterTwoFactorAuthKeys proposal with this single-tenant HSM instance to finish setup of the instance.

Overloads
def create_single_tenant_hsm_instance(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_single_tenant_hsm_instance via a request object, either of type CreateSingleTenantHsmInstanceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceRequest, ::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_single_tenant_hsm_instance(parent: nil, single_tenant_hsm_instance_id: nil, single_tenant_hsm_instance: nil) -> ::Gapic::Operation
Pass arguments to create_single_tenant_hsm_instance 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/kms/v1"

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

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

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

#create_single_tenant_hsm_instance_proposal

def create_single_tenant_hsm_instance_proposal(request, options = nil) -> ::Gapic::Operation
def create_single_tenant_hsm_instance_proposal(parent: nil, single_tenant_hsm_instance_proposal_id: nil, single_tenant_hsm_instance_proposal: nil) -> ::Gapic::Operation
Overloads
def create_single_tenant_hsm_instance_proposal(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_single_tenant_hsm_instance_proposal via a request object, either of type CreateSingleTenantHsmInstanceProposalRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Kms::V1::CreateSingleTenantHsmInstanceProposalRequest, ::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_single_tenant_hsm_instance_proposal(parent: nil, single_tenant_hsm_instance_proposal_id: nil, single_tenant_hsm_instance_proposal: nil) -> ::Gapic::Operation
Pass arguments to create_single_tenant_hsm_instance_proposal 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/kms/v1"

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

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

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

#delete_single_tenant_hsm_instance_proposal

def delete_single_tenant_hsm_instance_proposal(request, options = nil) -> ::Google::Protobuf::Empty
def delete_single_tenant_hsm_instance_proposal(name: nil) -> ::Google::Protobuf::Empty
Overloads
def delete_single_tenant_hsm_instance_proposal(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_single_tenant_hsm_instance_proposal via a request object, either of type DeleteSingleTenantHsmInstanceProposalRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Kms::V1::DeleteSingleTenantHsmInstanceProposalRequest, ::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_single_tenant_hsm_instance_proposal(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_single_tenant_hsm_instance_proposal 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::HsmManagement::Client.new

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

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

# The returned object is of type Google::Protobuf::Empty.
p result

#execute_single_tenant_hsm_instance_proposal

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

Executes a SingleTenantHsmInstanceProposal for a given SingleTenantHsmInstance. The proposal must be in the APPROVED state.

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

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

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

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

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

Returns metadata for a given SingleTenantHsmInstance.

Overloads
def get_single_tenant_hsm_instance(request, options = nil) -> ::Google::Cloud::Kms::V1::SingleTenantHsmInstance
Pass arguments to get_single_tenant_hsm_instance via a request object, either of type GetSingleTenantHsmInstanceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceRequest, ::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_single_tenant_hsm_instance(name: nil) -> ::Google::Cloud::Kms::V1::SingleTenantHsmInstance
Pass arguments to get_single_tenant_hsm_instance 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::HsmManagement::Client.new

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

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

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

#get_single_tenant_hsm_instance_proposal

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

Returns metadata for a given SingleTenantHsmInstanceProposal.

Overloads
def get_single_tenant_hsm_instance_proposal(request, options = nil) -> ::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal
Pass arguments to get_single_tenant_hsm_instance_proposal via a request object, either of type GetSingleTenantHsmInstanceProposalRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Kms::V1::GetSingleTenantHsmInstanceProposalRequest, ::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_single_tenant_hsm_instance_proposal(name: nil) -> ::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal
Pass arguments to get_single_tenant_hsm_instance_proposal 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::HsmManagement::Client.new

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

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

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

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

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

#list_single_tenant_hsm_instance_proposals

def list_single_tenant_hsm_instance_proposals(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal>
def list_single_tenant_hsm_instance_proposals(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, show_deleted: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal>
Overloads
def list_single_tenant_hsm_instance_proposals(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal>
Pass arguments to list_single_tenant_hsm_instance_proposals via a request object, either of type ListSingleTenantHsmInstanceProposalsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Kms::V1::ListSingleTenantHsmInstanceProposalsRequest, ::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_single_tenant_hsm_instance_proposals(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, show_deleted: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::SingleTenantHsmInstanceProposal>
Pass arguments to list_single_tenant_hsm_instance_proposals 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::HsmManagement::Client.new

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

# Call the list_single_tenant_hsm_instance_proposals method.
result = client.list_single_tenant_hsm_instance_proposals 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::SingleTenantHsmInstanceProposal.
  p item
end

#list_single_tenant_hsm_instances

def list_single_tenant_hsm_instances(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::SingleTenantHsmInstance>
def list_single_tenant_hsm_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, show_deleted: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::SingleTenantHsmInstance>
Overloads
def list_single_tenant_hsm_instances(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::SingleTenantHsmInstance>
Pass arguments to list_single_tenant_hsm_instances via a request object, either of type ListSingleTenantHsmInstancesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Kms::V1::ListSingleTenantHsmInstancesRequest, ::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_single_tenant_hsm_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, show_deleted: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Kms::V1::SingleTenantHsmInstance>
Pass arguments to list_single_tenant_hsm_instances 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::HsmManagement::Client.new

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

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

#operations_client

def operations_client() -> ::Google::Cloud::Kms::V1::HsmManagement::Operations

Get the associated client for long-running operations.

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)