Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,16 @@ def logger

##
# Returns aggregate information about the resources protected by the given
# Cloud KMS {::Google::Cloud::Kms::V1::CryptoKey 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.
# Cloud KMS {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. By default,
# summary of resources within the same Cloud organization as the key will be
# returned, which requires the KMS organization service account to be
# configured(refer
# https://docs.cloud.google.com/kms/docs/view-key-usage#required-roles).
# If the KMS organization service account is not configured or key's project
# is not part of an organization, set
# {::Google::Cloud::Kms::Inventory::V1::GetProtectedResourcesSummaryRequest#fallback_scope fallback_scope}
# to `FALLBACK_SCOPE_PROJECT` to retrieve a summary of protected resources
# within the key's project.
#
# @overload get_protected_resources_summary(request, options = nil)
# Pass arguments to `get_protected_resources_summary` via a request object, either of type
Expand All @@ -206,14 +212,17 @@ def logger
# @param options [::Gapic::CallOptions, ::Hash]
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
#
# @overload get_protected_resources_summary(name: nil)
# @overload get_protected_resources_summary(name: nil, fallback_scope: nil)
# Pass arguments to `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).
#
# @param name [::String]
# Required. The resource name of the
# {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}.
# @param fallback_scope [::Google::Cloud::Kms::Inventory::V1::FallbackScope]
# Optional. The scope to use if the kms organization service account is not
# configured.
#
# @yield [response, operation] Access the result along with the RPC operation
# @yieldparam response [::Google::Cloud::Kms::Inventory::V1::ProtectedResourcesSummary]
Expand Down Expand Up @@ -281,7 +290,8 @@ def get_protected_resources_summary request, options = nil

##
# Returns metadata about the resources protected by the given Cloud KMS
# {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} in the given Cloud organization.
# {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} in the given Cloud
# organization/project.
#
# @overload search_protected_resources(request, options = nil)
# Pass arguments to `search_protected_resources` via a request object, either of type
Expand All @@ -299,8 +309,14 @@ def get_protected_resources_summary request, options = nil
# the default parameter values, pass an empty Hash as a request object (see above).
#
# @param scope [::String]
# Required. Resource name of the organization.
# Example: organizations/123
# Required. A scope can be an organization or a project. Resources protected
# by the crypto key in provided scope will be returned.
#
# The following values are allowed:
#
# * organizations/\\{ORGANIZATION_NUMBER} (e.g., "organizations/12345678")
# * projects/\\{PROJECT_ID} (e.g., "projects/foo-bar")
# * projects/\\{PROJECT_NUMBER} (e.g., "projects/12345678")
# @param crypto_key [::String]
# Required. The resource name of the
# {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,20 @@ def organization_path organization:
"organizations/#{organization}"
end

##
# Create a fully-qualified Project resource string.
#
# The resource will be in the following format:
#
# `projects/{project}`
#
# @param project [String]
#
# @return [::String]
def project_path project:
"projects/#{project}"
end

##
# Create a fully-qualified ProtectedResourcesSummary resource string.
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,16 @@ def logger

##
# Returns aggregate information about the resources protected by the given
# Cloud KMS {::Google::Cloud::Kms::V1::CryptoKey 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.
# Cloud KMS {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}. By default,
# summary of resources within the same Cloud organization as the key will be
# returned, which requires the KMS organization service account to be
# configured(refer
# https://docs.cloud.google.com/kms/docs/view-key-usage#required-roles).
# If the KMS organization service account is not configured or key's project
# is not part of an organization, set
# {::Google::Cloud::Kms::Inventory::V1::GetProtectedResourcesSummaryRequest#fallback_scope fallback_scope}
# to `FALLBACK_SCOPE_PROJECT` to retrieve a summary of protected resources
# within the key's project.
#
# @overload get_protected_resources_summary(request, options = nil)
# Pass arguments to `get_protected_resources_summary` via a request object, either of type
Expand All @@ -199,14 +205,17 @@ def logger
# @param options [::Gapic::CallOptions, ::Hash]
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
#
# @overload get_protected_resources_summary(name: nil)
# @overload get_protected_resources_summary(name: nil, fallback_scope: nil)
# Pass arguments to `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).
#
# @param name [::String]
# Required. The resource name of the
# {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}.
# @param fallback_scope [::Google::Cloud::Kms::Inventory::V1::FallbackScope]
# Optional. The scope to use if the kms organization service account is not
# configured.
# @yield [result, operation] Access the result along with the TransportOperation object
# @yieldparam result [::Google::Cloud::Kms::Inventory::V1::ProtectedResourcesSummary]
# @yieldparam operation [::Gapic::Rest::TransportOperation]
Expand Down Expand Up @@ -267,7 +276,8 @@ def get_protected_resources_summary request, options = nil

##
# Returns metadata about the resources protected by the given Cloud KMS
# {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} in the given Cloud organization.
# {::Google::Cloud::Kms::V1::CryptoKey CryptoKey} in the given Cloud
# organization/project.
#
# @overload search_protected_resources(request, options = nil)
# Pass arguments to `search_protected_resources` via a request object, either of type
Expand All @@ -285,8 +295,14 @@ def get_protected_resources_summary request, options = nil
# the default parameter values, pass an empty Hash as a request object (see above).
#
# @param scope [::String]
# Required. Resource name of the organization.
# Example: organizations/123
# Required. A scope can be an organization or a project. Resources protected
# by the crypto key in provided scope will be returned.
#
# The following values are allowed:
#
# * organizations/\\{ORGANIZATION_NUMBER} (e.g., "organizations/12345678")
# * projects/\\{PROJECT_ID} (e.g., "projects/foo-bar")
# * projects/\\{PROJECT_NUMBER} (e.g., "projects/12345678")
# @param crypto_key [::String]
# Required. The resource name of the
# {::Google::Cloud::Kms::V1::CryptoKey CryptoKey}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,13 @@ def self.transcode_search_protected_resources_request request_pb
["scope", %r{^organizations/[^/]+/?$}, false]
]
)
.with_bindings(
uri_method: :get,
uri_template: "/v1/{scope}/protectedResources:search",
matches: [
["scope", %r{^projects/[^/]+/?$}, false]
]
)
transcoder.transcode request_pb
end
end
Expand Down
Loading
Loading