Stay organized with collections Save and categorize content based on your preferences.
View your assetsThis document shows you how to view your assets using Cloud Asset Inventory and the Google Cloud CLI in Cloud Shell.
Before you beginBefore you can use Cloud Asset Inventory, you need to enable the Cloud Asset Inventory API and set up permissions.
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Note: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.Enable the Cloud Asset Inventory API.
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
Note: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.Enable the Cloud Asset Inventory API.
roles/cloudasset.owner
).In a project of your choice, create a Compute Engine VM instance so that you can view it in Cloud Asset Inventory:
In the Google Cloud console, go to the VM instances page.
Click Create instance.
Enter a name for the instance.
Click Create.
List all the VM instances in your project:
In the Google Cloud console, click terminal Activate Cloud Shell.
In Cloud Shell, run the following command:
gcloud asset list \
--project=PROJECT_ID \
--asset-types=compute.googleapis.com/Instance \
--content-type=resource
Replace PROJECT_ID
with the ID of the project whose assets you want to list.
In the previous code sample, an asset type of compute.googleapis.com/Instance
is used to only list Compute Engine VM instances. To view all asset types, see Asset types.
A content type of resource
has also been set. This specifies that resource
metadata should also be returned in the response. If no content type is set, then only basic information about each asset is returned, such as the asset name, the last time it was updated, and what project it's in.
To avoid incurring charges to your Google Cloud account for the resources used on this page, follow these steps.
In the Google Cloud console, go to the VM instances page.
In the same row as the name of the VM instance you created, click more_vert More actions.
Click Delete, and then confirm the deletion.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-02 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-02 UTC."],[[["This guide demonstrates how to use Cloud Asset Inventory and the Google Cloud CLI in Cloud Shell to view your assets within a Google Cloud project."],["Before utilizing Cloud Asset Inventory, you must enable the Cloud Asset Inventory API and assign the Cloud Asset Owner role (`roles/cloudasset.owner`) to your user."],["You can create a Compute Engine VM instance to practice viewing assets, then list all VM instances in your project using the `gcloud asset list` command in Cloud Shell."],["The `gcloud asset list` command allows filtering by asset types, such as `compute.googleapis.com/Instance` for VM instances, and you can specify the `resource` content type to include detailed metadata."],["This document includes cleanup instructions to avoid incurring charges, through deleting your created VM instance."]]],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4