Reference documentation and code samples for the KMS Inventory V1 API class Google::Cloud::Kms::Inventory::V1::KeyTrackingService::Client.
Client for the KeyTrackingService service.
Returns information about the resources in an org that are protected by a given Cloud KMS key via CMEK.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::Configuration
Configure the KeyTrackingService Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all KeyTrackingService clients ::Google::Cloud::Kms::Inventory::V1::KeyTrackingService::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::Configuration
Configure the KeyTrackingService 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.
- (config) — Configure the Client client.
- config (Client::Configuration)
#get_protected_resources_summary
def get_protected_resources_summary(request, options = nil) -> ::Google::Cloud::Kms::Inventory::V1::ProtectedResourcesSummary
def get_protected_resources_summary(name: nil) -> ::Google::Cloud::Kms::Inventory::V1::ProtectedResourcesSummary
Returns aggregate information about the resources protected by the given Cloud KMS CryptoKey. Only resources within the same Cloud organization as the key will be returned. The project that holds the key must be part of an organization in order for this call to succeed.
def get_protected_resources_summary(request, options = nil) -> ::Google::Cloud::Kms::Inventory::V1::ProtectedResourcesSummary
get_protected_resources_summary
via a request object, either of type
GetProtectedResourcesSummaryRequest or an equivalent Hash.
- request (::Google::Cloud::Kms::Inventory::V1::GetProtectedResourcesSummaryRequest, ::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_protected_resources_summary(name: nil) -> ::Google::Cloud::Kms::Inventory::V1::ProtectedResourcesSummary
get_protected_resources_summary
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).
- name (::String) — Required. The resource name of the CryptoKey.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Kms::Inventory::V1::ProtectedResourcesSummary)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/kms/inventory/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Kms::Inventory::V1::KeyTrackingService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Kms::Inventory::V1::GetProtectedResourcesSummaryRequest.new # Call the get_protected_resources_summary method. result = client.get_protected_resources_summary request # The returned object is of type Google::Cloud::Kms::Inventory::V1::ProtectedResourcesSummary. p result
#initialize
def initialize() { |config| ... } -> Client
Create a new KeyTrackingService client object.
- (config) — Configure the KeyTrackingService client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::Kms::Inventory::V1::KeyTrackingService::Client.new # Create a client using a custom configuration client = ::Google::Cloud::Kms::Inventory::V1::KeyTrackingService::Client.new do |config| config.timeout = 10.0 end
#logger
def logger() -> Logger
The logger used for request/response debug logging.
- (Logger)
#search_protected_resources
def search_protected_resources(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Kms::Inventory::V1::ProtectedResource>
def search_protected_resources(scope: nil, crypto_key: nil, page_size: nil, page_token: nil, resource_types: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Kms::Inventory::V1::ProtectedResource>
Returns metadata about the resources protected by the given Cloud KMS CryptoKey in the given Cloud organization.
def search_protected_resources(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Kms::Inventory::V1::ProtectedResource>
search_protected_resources
via a request object, either of type
SearchProtectedResourcesRequest or an equivalent Hash.
- request (::Google::Cloud::Kms::Inventory::V1::SearchProtectedResourcesRequest, ::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 search_protected_resources(scope: nil, crypto_key: nil, page_size: nil, page_token: nil, resource_types: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Kms::Inventory::V1::ProtectedResource>
search_protected_resources
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).
- scope (::String) — Required. Resource name of the organization. Example: organizations/123
- crypto_key (::String) — Required. The resource name of the CryptoKey.
- page_size (::Integer) — The maximum number of resources to return. The service may return fewer than this value. If unspecified, at most 500 resources will be returned. The maximum value is 500; values above 500 will be coerced to 500.
-
page_token (::String) — A page token, received from a previous
KeyTrackingService.SearchProtectedResources
call. Provide this to retrieve the subsequent page.
When paginating, all other parameters provided to KeyTrackingService.SearchProtectedResources must match the call that provided the page token.
-
resource_types (::Array<::String>) — Optional. A list of resource types that this request searches for. If
empty, it will search all the trackable resource
types.
Regular expressions are also supported. For example:
compute.googleapis.com.*
snapshots resources whose type starts withcompute.googleapis.com
..*Image
snapshots resources whose type ends withImage
..*Image.*
snapshots resources whose type containsImage
.
See RE2 for all supported regular expression syntax. If the regular expression does not match any supported resource type, an INVALID_ARGUMENT error will be returned.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::Kms::Inventory::V1::ProtectedResource>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::Kms::Inventory::V1::ProtectedResource>)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/kms/inventory/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::Kms::Inventory::V1::KeyTrackingService::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::Kms::Inventory::V1::SearchProtectedResourcesRequest.new # Call the search_protected_resources method. result = client.search_protected_resources 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::Inventory::V1::ProtectedResource. p item end
#universe_domain
def universe_domain() -> String
The effective universe domain
- (String)