Utilizzare l'interfaccia a riga di comando e l'API del motore per suggerimenti
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Network Analyzer utilizza i comandi Recommender. Il motore per suggerimenti è un Google Cloud servizio che fornisce consigli per l'utilizzo di Google Cloud prodotti e servizi.
Per un elenco completo dei tipi di approfondimenti del Recommender, consulta la sezione Tipi di approfondimenti del Recommender.
Approfondimenti sulle richieste
gcloud
Per elencare gli approfondimenti per un Google Cloud progetto, esegui il seguente comando:
PROJECT_ID: l'ID progetto per cui vuoi elencare gli approfondimenti. Puoi anche elencare tutti gli approfondimenti per una cartella, un'organizzazione o un account di fatturazione.
LOCATION: la località per cui elencare gli approfondimenti, ad esempio
global, europe, asia-east1 o us-central1-a.
INSIGHT_TYPE: il tipo di informazione di Network Analyzer da richiedere, ad esempio google.networkanalyzer.vpcnetwork.connectivityInsight.
EXPRESSION: applica questo filtro booleano a ogni
risorsa che vuoi elencare.
Se l'espressione restituisce True,
l'elemento è elencato. Per maggiori dettagli ed esempi di espressioni di filtro,
esegui $ gcloud topic filters o consulta la
documentazione di gcloud topic filters.
LIMIT: il numero massimo di risorse da elencare.
Il numero predefinito di risorse elencate è illimitato.
PAGE_SIZE: il numero massimo di risorse da elencare per pagina.
Le dimensioni della pagina predefinite sono determinate dal servizio.
In caso contrario, non è prevista la paginazione. La paginazione potrebbe essere applicata prima o dopo
FILTER e LIMIT.
SORT_BY: un elenco di nomi di chiavi di campo separati da virgola in base ai quali ordinare una risorsa.
L'ordine predefinito è crescente.
Per specificare un ordine decrescente, anteponi un campo con ~ (una tilde).
[[["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-09-04 UTC."],[],[],null,["# Use the Recommender CLI and API\n\nNetwork Analyzer uses [Recommender](/recommender/docs)\ncommands. Recommender is a Google Cloud service that\nprovides usage recommendations for Google Cloud products and services.\nFor a complete list of Recommender insight types, see the\nRecommender [insight types](/recommender/docs/insights/insight-types).\n\nRequest insights\n----------------\n\n### gcloud\n\nTo list insights for a Google Cloud project, run the following command: \n\n```\ngcloud recommender insights list \\\n --project=PROJECT_ID \\\n --location=LOCATION \\\n --insight-type=INSIGHT_TYPE \\\n --filter=EXPRESSION \\\n --limit=LIMIT \\\n --page-size=PAGE_SIZE \\\n --sort-by=SORT_BY \\\n --format=json\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the project ID that you want to list insights for. You can also list all insights for a folder, organization, or a billing account.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: the location to list insights for, such as `global`, `europe`, `asia-east1`, or `us-central1-a`.\n- \u003cvar translate=\"no\"\u003eINSIGHT_TYPE\u003c/var\u003e: the Network Analyzer insight\n type to request, such as `google.networkanalyzer.vpcnetwork.connectivityInsight`.\n\n For a complete list of insight types, see [Insight groups and types](#insight-types).\n\nThe following fields are optional:\n\n- \u003cvar translate=\"no\"\u003eEXPRESSION\u003c/var\u003e: apply this Boolean filter to each\n resource that you want to list.\n\n If the expression evaluates as `True`,\n that item is listed. For more details and examples of filter expressions,\n run `$ gcloud topic filters` or see the\n [`gcloud topic filters` documentation](/sdk/gcloud/reference/topic/filters).\n- \u003cvar translate=\"no\"\u003eLIMIT\u003c/var\u003e: the maximum number of resources to list;\n the default number of resources listed is unlimited.\n\n- \u003cvar translate=\"no\"\u003ePAGE_SIZE\u003c/var\u003e: the maximum number of resources to\n list per page.\n\n The default page size is determined by the service;\n otherwise, there is no paging. Paging might be applied before or after\n \u003cvar translate=\"no\"\u003eFILTER\u003c/var\u003e and \u003cvar translate=\"no\"\u003eLIMIT\u003c/var\u003e.\n- \u003cvar translate=\"no\"\u003eSORT_BY\u003c/var\u003e: a list of comma-separated\n field key names to sort by for a resource.\n\n The default order is ascending.\n To specify a descending order, prefix a field with `~` (a tilde).\n\n### API\n\nTo get insights for a Google Cloud project, make a `GET` request to the\n[`projects.locations.insightTypes.insights` method](/recommender/docs/reference/rest/v1/projects.locations.insightTypes.insights/get): \n\n```\nhttps://recommender.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/insightTypes/INSIGHT_TYPE/insights\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the project ID.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: the location to list insights for, such as `global`, `europe`, `asia-east1`, or `us-central1-a`.\n- \u003cvar translate=\"no\"\u003eINSIGHT_TYPE\u003c/var\u003e: the Network Analyzer insight\n type to list, such as google.networkanalyzer.vpcnetwork.connectivityInsight.\n\n For a complete list of insight types, see [Insight groups and types](#insight-types).\n\nThe following example shows a sample response for this command: \n\n```\n{\n \"name\": \"projects/{project_number}/locations/{location}/insightTypes/google.networkanalyzer.hybridconnectivity.dynamicRouteInsight/insights/{insight_id}\",\n \"description\": \"Dynamic route is fully shadowed by a peering subnet route\",\n \"content\": {\n \"networkUri\": \"//compute.googleapis.com/projects/{project_id}/global/networks/{network_name}\",\n \"region\": \"{location}\",\n \"ipRange\": \"{ip_range}\",\n \"priority\": 100,\n \"nextHopUri\": \"//compute.googleapis.com/projects/{project_id}/regions/{location}/vpnTunnels/{tunnel_name}\",\n \"cloudRouterUri\": \"//compute.googleapis.com/projects/{project_id}/regions/{location}/routers/{router_name}\",\n \"shadowingRouteUris\": [\n \"//compute.googleapis.com/projects/{project_id}/global/routes/{route_name}\"\n ],\n \"shadowingRouteType\": \"PEERING_SUBNET\"\n },\n \"lastRefreshTime\": \"2022-09-15T21:10:57.187942979Z\",\n \"observationPeriod\": \"611870.625920374s\",\n \"stateInfo\": {\n \"state\": \"ACTIVE\"\n },\n \"category\": \"PERFORMANCE\",\n \"targetResources\": [\n \"//compute.googleapis.com/projects/{project_id}/regions/{location}/vpnTunnels/{tunnel_name}\"\n ],\n \"insightSubtype\": \"DYNAMIC_ROUTE_FULLY_SHADOWED\",\n \"severity\": \"MEDIUM\"\n}\n```\n\nDescribe insight details\n------------------------\n\n### gcloud\n\nTo list details of a particular insight, run the following command: \n\n```\ngcloud recommender insights describe INSIGHT_ID \\\n --project=PROJECT_ID \\\n --location=LOCATION \\\n --insight-type=INSIGHT_TYPE\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eINSIGHT_ID\u003c/var\u003e: the ID of the insight to describe.\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of the project containing the insight.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: the location to list insights for.\n- \u003cvar translate=\"no\"\u003eINSIGHT_TYPE\u003c/var\u003e: the Network Analyzer insight\n type of the insight, such as\n `google.networkanalyzer.vpcnetwork.connectivityInsight`.\n\n For a complete list of insight types, see [Insight groups and types](#insight-types).\n\n### API\n\nTo get details for an insight, make a `GET` request to the\n[`projects.locations.insightTypes.insights` method](/recommender/docs/reference/rest/v1/projects.locations.insightTypes.insights/get): \n\n```\nhttps://recommender.googleapis.com/v1/projects/PROJECT/locations/LOCATION/insightTypes/INSIGHT_TYPE/insights/INSIGHT_ID\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the project ID.\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: the location of the insight.\n- \u003cvar translate=\"no\"\u003eINSIGHT_TYPE\u003c/var\u003e: the Network Analyzer insight\n type of the insight, such as\n `google.networkanalyzer.vpcnetwork.connectivityInsight`.\n\n For a complete list of insight types, see [Insight groups and types](#insight-types).\n- \u003cvar translate=\"no\"\u003eINSIGHT_ID\u003c/var\u003e: the insight ID for the insight.\n\nInsight groups and types\n------------------------\n\nFor more information about Network Analyzer insights, see\n[Insight groups and types](/network-intelligence-center/docs/network-analyzer/insight-groups-types)."]]