Skip to main content

asset_history

Creates, updates, deletes, gets or lists an asset_history resource.

Overview

Nameasset_history
TypeResource
Idgoogle.cloudasset.asset_history

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
assetsarrayA list of assets with valid time windows.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
batch_get_assets_historyselectparentType, parentassetNames, contentType, readTimeWindow.startTime, readTimeWindow.endTime, relationshipTypesBatch gets the update history of assets that overlap a time window. For IAM_POLICY content, this API outputs history when the asset and its attached IAM POLICY both exist. This can create gaps in the output history. Otherwise, this API outputs history with asset in both non-delete or deleted status. If a specified asset does not exist, this API returns an INVALID_ARGUMENT error.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
parentstring
parentTypestring
assetNamesstring
contentTypestring
readTimeWindow.endTimestring (google-datetime)
readTimeWindow.startTimestring (google-datetime)
relationshipTypesstring

SELECT examples

Batch gets the update history of assets that overlap a time window. For IAM_POLICY content, this API outputs history when the asset and its attached IAM POLICY both exist. This can create gaps in the output history. Otherwise, this API outputs history with asset in both non-delete or deleted status. If a specified asset does not exist, this API returns an INVALID_ARGUMENT error.

SELECT
assets
FROM google.cloudasset.asset_history
WHERE parentType = '{{ parentType }}' -- required
AND parent = '{{ parent }}' -- required
AND assetNames = '{{ assetNames }}'
AND contentType = '{{ contentType }}'
AND readTimeWindow.startTime = '{{ readTimeWindow.startTime }}'
AND readTimeWindow.endTime = '{{ readTimeWindow.endTime }}'
AND relationshipTypes = '{{ relationshipTypes }}';