Method: exportAssets

Exports assets with time and resource types to a given Cloud Storage location/BigQuery table. For Cloud Storage location destinations, the output format is newline-delimited JSON. Each line represents a 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


The URL uses gRPC Transcoding syntax.

Path parameters



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
  "readTime": string,
  "assetTypes": [
  "contentType": enum (ContentType),
  "outputConfig": {
    object (OutputConfig)

string (Timestamp format)

timestamp to take an asset snapshot. This can only be set to a timestamp between the current time and the current time minus 35 days (inclusive). If not specified, the current time will be used. Due to delays in resource data collection and indexing, there is a volatile window during which running the same query may get different results.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".



A list of asset types to take a snapshot for. For example: "".

Regular expressions are also supported. For example:

  • "*" snapshots resources whose asset type starts with "".
  • ".*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, otherwise, it will snapshot all asset types. See Introduction to Cloud Asset Inventory for all supported asset types.


enum (ContentType)

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


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:


For more information, see the Authentication Overview.


Output configuration for export assets destination.

JSON representation

  // Union field destination can be only one of the following:
  "gcsDestination": {
    object (GcsDestination)
  "bigqueryDestination": {
    object (BigQueryDestination)
  // End of list of possible types for union field destination.
Union field destination. Asset export destination. destination can be only one of the following:

object (GcsDestination)

Destination on Cloud Storage.


object (BigQueryDestination)

Destination on BigQuery. The output table stores the fields in asset proto as columns in BigQuery.


A Cloud Storage location.

JSON representation

  // Union field object_uri can be only one of the following:
  "uri": string,
  "uriPrefix": string
  // End of list of possible types for union field object_uri.
Union field object_uri. Required. object_uri can be only one of the following:


The uri of the Cloud Storage object. It's the same uri that is used by gsutil. Example: "gs://bucketName/objectName". See Viewing and Editing Object metadata for more information.



The uri prefix of all generated Cloud Storage objects. Example: "gs://bucketName/objectNamePrefix". Each object uri is in format: "gs://bucketName/objectNamePrefix// and only contains assets for that type. starts from 0. Example: "gs://bucketName/objectNamePrefix/" is the first shard of output objects containing all assets. An INVALID_ARGUMENT error will be returned if file with the same name "gs://bucketName/objectNamePrefix" already exists.


A BigQuery destination for exporting assets to.

JSON representation
  "dataset": string,
  "table": string,
  "force": boolean


Required. The BigQuery dataset in format "projects/projectId/datasets/datasetId", to which the snapshot result should be exported. If this dataset does not exist, the export call returns an INVALID_ARGUMENT error.



Required. The BigQuery table to which the snapshot result should be written. If this table does not exist, a new table with the given name will be created.



If the destination table already exists and this flag is TRUE, the table will be overwritten by the contents of assets snapshot. If the flag is FALSE or unset and the destination table already exists, the export call returns an INVALID_ARGUMEMT error.