Organízate con las colecciones
Guarda y clasifica el contenido según tus preferencias.
Analizador de red usa comandos de Recommender. Recommender es un Google Cloud servicio que
proporciona recomendaciones de uso para Google Cloud productos y servicios.
Para ver una lista completa de los tipos de estadísticas de Recommender, consulta los tipos de estadísticas de Recommender.
Solicitar estadísticas
gcloud
Para ver las estadísticas de un Google Cloud proyecto, ejecuta el siguiente comando:
PROJECT_ID: el ID del proyecto del que quieres obtener estadísticas. También puedes consultar todas las estadísticas de una carpeta, una organización o una cuenta de facturación.
LOCATION: la ubicación de la que se deben mostrar las estadísticas, como
global, europe, asia-east1 o us-central1-a.
INSIGHT_TYPE: el tipo de métrica de Network Analyzer que se va a solicitar, como google.networkanalyzer.vpcnetwork.connectivityInsight.
EXPRESSION: aplica este filtro booleano a cada recurso que quieras incluir en la lista.
Si la expresión se evalúa como True,
se muestra ese elemento. Para obtener más información y ejemplos de expresiones de filtro, ejecuta $ gcloud topic filters o consulta la documentación de gcloud topic filters.
LIMIT: número máximo de recursos que se van a enumerar. El número predeterminado de recursos que se enumeran es ilimitado.
PAGE_SIZE: número máximo de recursos que se van a mostrar por página.
El tamaño de página predeterminado lo determina el servicio.
De lo contrario, no hay paginación. La paginación se puede aplicar antes o después de FILTER y LIMIT.
SORT_BY: lista de nombres de claves de campos separados por comas por los que se debe ordenar un recurso.
El orden predeterminado es ascendente.
Para especificar un orden descendente, añade el prefijo ~ (una tilde) a un campo.
[[["Es fácil de entender","easyToUnderstand","thumb-up"],["Me ofreció una solución al problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Es difícil de entender","hardToUnderstand","thumb-down"],["La información o el código de muestra no son correctos","incorrectInformationOrSampleCode","thumb-down"],["Me faltan las muestras o la información que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-08-21 (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)."]]