KMS Inventory API . projects . locations . keyRings . cryptoKeys

Instance Methods

close()

Close httplib2 connections.

getProtectedResourcesSummary(name, fallbackScope=None, x__xgafv=None)

Returns aggregate information about the resources protected by the given Cloud KMS 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 fallback_scope to `FALLBACK_SCOPE_PROJECT` to retrieve a summary of protected resources within the key's project.

Method Details

close()
Close httplib2 connections.
getProtectedResourcesSummary(name, fallbackScope=None, x__xgafv=None)
Returns aggregate information about the resources protected by the given Cloud KMS 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 fallback_scope to `FALLBACK_SCOPE_PROJECT` to retrieve a summary of protected resources within the key's project.

Args:
  name: string, Required. The resource name of the CryptoKey. (required)
  fallbackScope: string, Optional. The scope to use if the kms organization service account is not configured.
    Allowed values
      FALLBACK_SCOPE_UNSPECIFIED - Unspecified scope type.
      FALLBACK_SCOPE_PROJECT - If set to `FALLBACK_SCOPE_PROJECT`, the API will fall back to using key's project as request scope if the kms organization service account is not configured.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Aggregate information about the resources protected by a Cloud KMS key in the same Cloud organization/project as the key.
  "cloudProducts": { # The number of resources protected by the key grouped by Cloud product.
    "a_key": "A String",
  },
  "locations": { # The number of resources protected by the key grouped by region.
    "a_key": "A String",
  },
  "name": "A String", # The full name of the ProtectedResourcesSummary resource. Example: projects/test-project/locations/us/keyRings/test-keyring/cryptoKeys/test-key/protectedResourcesSummary
  "projectCount": 42, # The number of distinct Cloud projects in the same Cloud organization as the key that have resources protected by the key.
  "resourceCount": "A String", # The total number of protected resources in the same Cloud organization as the key.
  "resourceTypes": { # The number of resources protected by the key grouped by resource type.
    "a_key": "A String",
  },
  "warnings": [ # Warning messages for the state of response ProtectedResourcesSummary For example, if the organization service account is not configured, INSUFFICIENT_PERMISSIONS_PARTIAL_DATA warning will be returned.
    { # Warning message specifying various states of response data that might indicate incomplete or partial results.
      "displayMessage": "A String", # The literal message providing context and details about the warnings.
      "warningCode": "A String", # The specific warning code for the displayed message.
    },
  ],
}