Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Network Analyzer usa comandos de recomendador. El recomendador es un Google Cloud servicio que
proporciona recomendaciones de uso para Google Cloud productos y servicios.
Para obtener una lista completa de los tipos de estadísticas de Recommender, consulta los tipos de estadísticas de Recommender.
Solicita estadísticas
gcloud
Para enumerar las estadísticas de un Google Cloud proyecto, ejecuta el siguiente comando:
PROJECT_ID: El ID del proyecto para el que deseas generar una lista de estadísticas. También puedes enumerar todas las estadísticas de una carpeta, una organización o una cuenta de facturación.
LOCATION: Es la ubicación para la que se enumeran las estadísticas, como global, europe, asia-east1 o us-central1-a.
INSIGHT_TYPE: El tipo de estadística de Network Analyzer que se solicitará, como google.networkanalyzer.vpcnetwork.connectivityInsight.
EXPRESSION: Aplica este filtro booleano a cada recurso que quieras enumerar.
Si la expresión se evalúa como True, ese elemento aparecerá en la lista. Para obtener más detalles y ejemplos de expresiones de filtro, ejecuta $ gcloud topic filters o consulta la documentación de gcloud topic filters.
LIMIT: Es la cantidad máxima de recursos que se van a enumerar, la cantidad predeterminada de recursos enumerados es ilimitada.
PAGE_SIZE: Es la cantidad máxima de recursos que se deben incluir en la lista por página.
El servicio determina el tamaño de página predeterminado; de lo contrario, no habrá paginación. La paginación puede aplicarse antes o después de FILTER y LIMIT.
SORT_BY: Es una lista de nombres de claves de campo separados por comas en los que se ordenará un recurso.
El orden predeterminado es ascendente.
Para especificar un orden descendente, prefija un campo con ~ (una tilde).
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 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)."]]