Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Visualizzare gli asset
Questo documento mostra come visualizzare le risorse utilizzando Cloud Asset Inventory e l'Google Cloud CLI in Cloud Shell.
Prima di iniziare
Prima di poter utilizzare Cloud Asset Inventory, devi abilitare l'API Cloud Asset Inventory e configurare
le autorizzazioni.
Sign in to your Google Cloud account. If you're new to
Google Cloud,
create an account to evaluate how our products perform in
real-world scenarios. New customers also get $300 in free credits to
run, test, and deploy workloads.
In the Google Cloud console, on the project selector page,
select or create a Google Cloud project.
Sostituisci PROJECT_ID con l'ID del progetto di cui
vuoi elencare gli asset.
Nell'esempio di codice precedente, viene utilizzato un tipo di asset
compute.googleapis.com/Instance per elencare solo
le istanze VM di Compute Engine. Per visualizzare tutti i tipi di asset, consulta
Tipi di asset.
È stato impostato anche un tipo di contenuto resource. Specifica che nella risposta devono essere restituiti anche i metadati
resource. Se non è impostato alcun tipo di contenuto, vengono restituite solo le informazioni di base su ogni asset, ad esempio il nome, l'ultimo aggiornamento e il progetto in cui si trova.
Esegui la pulizia
Per evitare che al tuo account Google Cloud vengano addebitati costi relativi alle risorse utilizzate in questa pagina, segui questi passaggi.
Nella console Google Cloud , vai alla pagina Istanze VM.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-08-18 UTC."],[[["\u003cp\u003eThis 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.\u003c/p\u003e\n"],["\u003cp\u003eBefore utilizing Cloud Asset Inventory, you must enable the Cloud Asset Inventory API and assign the Cloud Asset Owner role (\u003ccode\u003eroles/cloudasset.owner\u003c/code\u003e) to your user.\u003c/p\u003e\n"],["\u003cp\u003eYou can create a Compute Engine VM instance to practice viewing assets, then list all VM instances in your project using the \u003ccode\u003egcloud asset list\u003c/code\u003e command in Cloud Shell.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egcloud asset list\u003c/code\u003e command allows filtering by asset types, such as \u003ccode\u003ecompute.googleapis.com/Instance\u003c/code\u003e for VM instances, and you can specify the \u003ccode\u003eresource\u003c/code\u003e content type to include detailed metadata.\u003c/p\u003e\n"],["\u003cp\u003eThis document includes cleanup instructions to avoid incurring charges, through deleting your created VM instance.\u003c/p\u003e\n"]]],[],null,[]]