KMS Inventory API . organizations . protectedResources

Instance Methods

close()

Close httplib2 connections.

search(scope, cryptoKey=None, pageSize=None, pageToken=None, resourceTypes=None, x__xgafv=None)

Returns metadata about the resources protected by the given Cloud KMS CryptoKey in the given Cloud organization.

search_next()

Retrieves the next page of results.

Method Details

close()
Close httplib2 connections.
search(scope, cryptoKey=None, pageSize=None, pageToken=None, resourceTypes=None, x__xgafv=None)
Returns metadata about the resources protected by the given Cloud KMS CryptoKey in the given Cloud organization.

Args:
  scope: string, Required. Resource name of the organization. Example: organizations/123 (required)
  cryptoKey: string, Required. The resource name of the CryptoKey.
  pageSize: 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.
  pageToken: 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.
  resourceTypes: string, Optional. A list of resource types that this request searches for. If empty, it will search all the [trackable resource types](https://cloud.google.com/kms/docs/view-key-usage#tracked-resource-types). Regular expressions are also supported. For example: * `compute.googleapis.com.*` snapshots resources whose type starts with `compute.googleapis.com`. * `.*Image` snapshots resources whose type ends with `Image`. * `.*Image.*` snapshots resources whose type contains `Image`. See [RE2](https://github.com/google/re2/wiki/Syntax) for all supported regular expression syntax. If the regular expression does not match any supported resource type, an INVALID_ARGUMENT error will be returned. (repeated)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response message for KeyTrackingService.SearchProtectedResources.
  "nextPageToken": "A String", # A token that can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.
  "protectedResources": [ # Protected resources for this page.
    { # Metadata about a resource protected by a Cloud KMS key.
      "cloudProduct": "A String", # The Cloud product that owns the resource. Example: `compute`
      "createTime": "A String", # Output only. The time at which this resource was created. The granularity is in seconds. Timestamp.nanos will always be 0.
      "cryptoKeyVersion": "A String", # The name of the Cloud KMS [CryptoKeyVersion](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions?hl=en) used to protect this resource via CMEK. This field is empty if the Google Cloud product owning the resource does not provide key version data to Asset Inventory. If there are multiple key versions protecting the resource, then this is same value as the first element of crypto_key_versions.
      "cryptoKeyVersions": [ # The names of the Cloud KMS [CryptoKeyVersion](https://cloud.google.com/kms/docs/reference/rest/v1/projects.locations.keyRings.cryptoKeys.cryptoKeyVersions?hl=en) used to protect this resource via CMEK. This field is empty if the Google Cloud product owning the resource does not provide key versions data to Asset Inventory. The first element of this field is stored in crypto_key_version.
        "A String",
      ],
      "labels": { # A key-value pair of the resource's labels (v1) to their values.
        "a_key": "A String",
      },
      "location": "A String", # Location can be `global`, regional like `us-east1`, or zonal like `us-west1-b`.
      "name": "A String", # The full resource name of the resource. Example: `//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1`.
      "project": "A String", # Format: `projects/{PROJECT_NUMBER}`.
      "projectId": "A String", # The ID of the project that owns the resource.
      "resourceType": "A String", # Example: `compute.googleapis.com/Disk`
    },
  ],
}
search_next()
Retrieves the next page of results.

        Args:
          previous_request: The request for the previous page. (required)
          previous_response: The response from the request for the previous page. (required)

        Returns:
          A request object that you can call 'execute()' on to request the next
          page. Returns None if there are no more items in the collection.