gcloud alpha asset get-history

NAME
gcloud alpha asset get-history - get the update history of assets that overlaps a time window
SYNOPSIS
gcloud alpha asset get-history--asset-names=[ASSET_NAMES,…]--content-type=CONTENT_TYPE--start-time=START_TIME(--organization=ORGANIZATION_ID    |--project=PROJECT_ID)[--end-time=END_TIME][--relationship-types=[RELATIONSHIP_TYPES,…]][GCLOUD_WIDE_FLAG]
DESCRIPTION
(ALPHA) Get the update history of assets that overlaps a timewindow.
EXAMPLES
To get the history of asset metadata for'//compute.googleapis.com/projects/test-project/zones/us-central1-f/instances/instance1'between '2018-10-02T15:01:23.045Z' and '2018-12-05T13:01:21.045Z', run:
gcloudalphaassetget-history--project='test-project'--asset-names='//compute.googleapis.com/projects/test-project/zones/us-central1-f/instances/instance1'--start-time='2018-10-02T15:01:23.045Z'--end-time='2018-12-05T13:01:21.045Z'--content-type='resource'

To get the history of asset iam policy for'//cloudresourcemanager.googleapis.com/projects/10179387634' between'2018-10-02T15:01:23.045Z' and '2018-12-05T13:01:21.045Z', and project'10179387634' is in organization '1060499660910', run:

gcloudalphaassetget-history--organization='1060499660910'--asset-names='//cloudresourcemanager.googleapis.com/projects/10179387634'--start-time='2018-10-02T15:01:23.045Z'--end-time='2018-12-05T13:01:21.045Z'--content-type='iam-policy'
REQUIRED FLAGS
--asset-names=[ASSET_NAMES,…]
A list of full names of the assets to get the history for. For more information,see:https://cloud.google.com/apis/design/resource_names#full_resource_name
--content-type=CONTENT_TYPE
Asset content type. Specifyingresource will export resourcemetadata, specifyingiam-policy will export the IAM policy for eachchild asset, specifyingorg-policy will export the Org Policy seton child assets, specifyingaccess-policy will export the AccessPolicy set on child assets, specifyingos-inventory will export theOS inventory of VM instances, and specifyingrelationship willexport relationships of the assets.CONTENT_TYPE must beone of:resource,iam-policy,org-policy,access-policy,os-inventory,relationship.
--start-time=START_TIME
Start time of the time window (inclusive) for the asset history. Must be afterthe current time minus 35 days. See $gcloud topic datetimes forinformation on time formats.
Exactly one of these must be specified:
--organization=ORGANIZATION_ID
The ID of the organization which is the root asset.
--project=PROJECT_ID
The project which is the root asset.

The Google Cloud project ID to use for this invocation. If omitted, then thecurrent project is assumed; the current project can be listed usinggcloudconfig list --format='text(core.project)' and can be set usinggcloud config set project PROJECTID.

--project and its fallbackcore/project property playtwo roles in the invocation. It specifies the project of the resource to operateon. It also specifies the project for API enablement check, quota, and billing.To specify a different project for quota and billing, use--billing-project orbilling/quota_project property.

OPTIONAL FLAGS
--end-time=END_TIME
End time of the time window (exclusive) for the asset history. Defaults tocurrent time if not specified. See $gcloud topic datetimes forinformation on time formats.
--relationship-types=[RELATIONSHIP_TYPES,…]
A list of relationship types (i.e., "INSTANCE_TO_INSTANCEGROUP") to take asnapshot. This argument will only be honoured if content_type=RELATIONSHIP. Ifspecified and non-empty, only relationships matching the specified types will bereturned. Seehttp://cloud.google.com/asset-inventory/docs/supported-asset-typesfor supported relationship types.
GCLOUD WIDE FLAGS
These flags are available to all commands:--access-token-file,--account,--billing-project,--configuration,--flags-file,--flatten,--format,--help,--impersonate-service-account,--log-http,--project,--quiet,--trace-token,--user-output-enabled,--verbosity.

Run$gcloud help for details.

NOTES
This command is currently in alpha and might change without notice. If thiscommand fails with API permission errors despite specifying the correct project,you might be trying to access an API with an invitation-only early accessallowlist. These variants are also available:
gcloudassetget-history
gcloudbetaassetget-history

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-05-07 UTC.