Method: exportAssetUpdates

Exports asset updates within a time window to a given Cloud Storage location/BigQuery table. For Cloud Storage location destinations, the output format is newline-delimited JSON. Each line represents a google.cloud.asset.v1p7beta1.Asset in the JSON format; for BigQuery table destinations, the output table stores the fields in asset proto as columns. This API implements the google.longrunning.Operation API , which allows you to keep track of the export. We recommend intervals of at least 2 seconds with exponential retry to poll the export operation result. For regular-size resource parent, the export operation usually finishes within 5 minutes.

HTTP request

POST https://cloudasset.googleapis.com/v1p7beta1/{parent=*/*}:exportAssetUpdates

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
parent

string

Required. The relative name of the root asset. This can only be an organization number (such as "organizations/123"), a project ID (such as "projects/my-project-id"), or a project number (such as "projects/12345"), or a folder number (such as "folders/123").

Authorization requires one or more of the following IAM permissions on the specified resource parent:

  • cloudasset.assets.exportResource
  • cloudasset.assets.exportIamPolicy

Request body

The request body contains data with the following structure:

JSON representation
{
  "updateTimeWindow": {
    object (UpdateTimeWindow)
  },
  "assetTypes": [
    string
  ],
  "assetNames": [
    string
  ],
  "contentType": enum (ContentType),
  "outputConfig": {
    object (OutputConfig)
  }
}
Fields
updateTimeWindow

object (UpdateTimeWindow)

The time window configuration for the asset updates. Both startTime and endTime must be within 35 days from now. endTime is optional and not set, it is default to current timestamp. The returned results contain all assets created, updated or deleted within updateTimeWindow.time_window.

assetTypes[]

string

A list of asset types to export the updates for. For example: "compute.googleapis.com/Disk".

Regular expressions are also supported. For example:

  • "compute.googleapis.com.*" snapshots resources whose asset type starts with "compute.googleapis.com".
  • ".*Instance" snapshots resources whose asset type ends with "Instance".
  • ".*Instance.*" snapshots resources whose asset type contains "Instance".

See RE2 for all supported regular expression syntax. If the regular expression does not match any supported asset type, an INVALID_ARGUMENT error will be returned.

If specified, only matching assets will be returned. See Introduction to Cloud Asset Inventory for all supported asset types.

At most one of assetTypes and assetNames should be specified. If neither is specified, all assets under the parent will be returned.

assetNames[]

string

A list of the full names of the assets to export the updates for. See: https://cloud.google.com/asset-inventory/docs/resource-name-format Example:

//compute.googleapis.com/projects/my_project_123/zones/zone1/instances/instance1.

If specified, only assets in the list will be returned.

At most one of assetTypes and assetNames should be specified. If neither is specified, all assets under the parent will be returned.

contentType

enum (ContentType)

Asset content type. If not specified, no content but the asset name will be returned.

outputConfig

object (OutputConfig)

Required. Output configuration indicating where the results will be output to.

Response body

If successful, the response body contains an instance of Operation.

Authorization Scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/cloud-platform

For more information, see the Authentication Overview.