GET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/routers/ROUTER_NAME/getRouterStatus
Remplacez les éléments suivants :
PROJECT_ID: ID du projet auquel appartient Cloud Router
REGION: région où se trouve le routeur Cloud Router.
ROUTER_NAME: nom du routeur Cloud Router dont vous souhaitez obtenir l'état
Supprimer des routeurs Cloud Router
Avant de supprimer un routeur Cloud Router, vérifiez qu'il n'est pas utilisé par une autre ressource, telle qu'un tunnel Cloud VPN ou un rattachement de VLAN. Vous devez supprimer la ressource associée pour pouvoir supprimer le routeur Cloud Router.
Toutefois, vous n'êtes pas obligé de supprimer les sessions BGP avant de supprimer le routeur Cloud Router.
Pour supprimer le routeur cloud, procédez comme suit :
Console
Dans la console Google Cloud , accédez à la page Routeurs cloud.
PROJECT_ID: ID du projet contenant Cloud Router que vous souhaitez supprimer
REGION : région où se trouve le routeur cloud.
ROUTER_NAME : nom du routeur cloud
Étapes suivantes
Consultez la page Afficher les détails du routeur pour savoir comment afficher la configuration d'un routeur Cloud Router, de ses sessions BGP et des routes annoncées par Cloud Router.
Pour résoudre les problèmes liés à l'utilisation de Cloud Router, consultez la page Dépannage.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/11 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Difficile à comprendre","hardToUnderstand","thumb-down"],["Informations ou exemple de code incorrects","incorrectInformationOrSampleCode","thumb-down"],["Il n'y a pas l'information/les exemples dont j'ai besoin","missingTheInformationSamplesINeed","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/11 (UTC)."],[],[],null,["# Manage Cloud Routers\n====================\n\nThis document describes how to list, update, get status of, and delete\nCloud Router.\n\nBefore you begin\n----------------\n\n### gcloud\n\nIf you want to use the command-line examples in this guide, do the following:\n\n1. Install or update to the latest version of the [Google Cloud CLI](/compute/docs/gcloud-compute).\n2. Set a [default region and\n zone](/compute/docs/gcloud-compute#set_default_zone_and_region_in_your_local_client).\n\n### API\n\nIf you want to use the API examples in this guide, set up\n[API access](/compute/docs/api/prereqs).\n\nList Cloud Routers\n------------------\n\nTo list all the Cloud Routers in a project, follow these steps. \n\n### Console\n\n1. In the Google Cloud console, go to the **Cloud Routers** page.\n\n [Go to Cloud Routers](https://console.cloud.google.com/hybrid/routers/list)\n2. On the **Cloud Routers** page, view a list of your\n Cloud Routers.\n\n### gcloud\n\nRun the `list` command. To restrict the list to only one region, specify\n`--filter=\"region:(\u003cvar\u003eREGION\u003c/var\u003e)`. \n\n```\n gcloud compute routers list \\\n --project=PROJECT_ID \\\n [--filter=\"region:(REGION)]\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of the project for which you want to list Cloud Routers\n- \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: the region for which you want to list routers---for example, `asia-east1`\n\nThe output is similar to the following: \n\n```\n NAME REGION NETWORK\n my-router asia-east1 my-network\n```\n\n### API\n\nUse the\n[`routers.aggregatedList`](/compute/docs/reference/rest/v1/routers/aggregatedList)\nmethod: \n\n```\nGET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/aggregated/routers\n```\n\nReplace \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e with the ID of the project for which you\nwant to list Cloud Routers.\n\nTo list only the Cloud Routers in a specific region, use the\n[`routers.list`](/compute/docs/reference/rest/v1/routers/list)\nmethod: \n\n```\nGET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/routers\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of the project for which you want to list Cloud Routers\n- \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: the region for which you want to list Cloud Routers\n\nUpdate Cloud Routers\n--------------------\n\nIf a Cloud Router is associated with an\n[NCC Gateway](/network-connectivity/docs/network-connectivity-center/concepts/ncc-gateway-overview),\nkeep the following in mind:\n\n- You can't update the `ncc_gateway` field.\n- The `patch` or `update` methods don't accept the `network` field as part of\n the request body.\n\n### gcloud\n\nUse the [`gcloud compute routers update` command](/sdk/gcloud/reference/compute/routers/update): \n\n```\ngcloud compute routers update ROUTER_NAME\n --region=REGION\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eROUTER_NAME\u003c/var\u003e: the name of the Cloud Router that you want to update\n- \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: the region where the Cloud Router resides\n\n### API\n\nUse the\n[`routers.update`](/compute/docs/reference/rest/v1/routers/update)\nmethod: \n\n```\nPATCH https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/routers/ROUTER_NAME\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of the project for which you want to list Cloud Routers\n- \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: the region where the Cloud Router resides\n- \u003cvar translate=\"no\"\u003eROUTER_NAME\u003c/var\u003e: the name of the Cloud Router that you want to update\n\nGet Cloud Router status\n-----------------------\n\n### gcloud\n\nUse the\n[`gcloud compute routers get-status` command](/sdk/gcloud/reference/compute/routers/get-status). \n\n```\ngcloud compute routers get-status ROUTER_NAME \\\n --project=PROJECT_ID \\\n --region=REGION\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eROUTER_NAME\u003c/var\u003e: the name of the Cloud Router that you want to get the status of\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the project ID that the Cloud Router belongs to\n- \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: the region where the Cloud Router resides\n\n### API\n\nUse the [`routers.getRouterStatus`](/compute/docs/reference/rest/v1/routers/getRouterStatus)\nmethod with an empty request body: \n\n```\nGET https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/routers/ROUTER_NAME/getRouterStatus\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the project ID that the Cloud Router belongs to\n- \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: the region where the Cloud Router resides\n- \u003cvar translate=\"no\"\u003eROUTER_NAME\u003c/var\u003e: the name of the Cloud Router that you want to get the status of\n\nDelete Cloud Routers\n--------------------\n\nBefore you delete a Cloud Router, check that it isn't being used by\nanother resource, such as a Cloud VPN tunnel or a VLAN attachment. You must\ndelete the associated resource before you can delete the Cloud Router.\nHowever, you aren't required to remove BGP sessions before you delete the\nCloud Router.\n| **Warning:** Deleting a Cloud Router deletes any Cloud NAT gateways that are associated with the Cloud Router.\n\nTo delete the Cloud Router, follow these steps. \n\n### Console\n\n1. In the Google Cloud console, go to the **Cloud Routers** page.\n\n [Go to Cloud Routers](https://console.cloud.google.com/hybrid/routers/list)\n2. Select the checkbox next to the Cloud Router that you want to\n delete.\n\n3. Click delete**Delete**.\n\n### gcloud\n\nRun the `delete` command. Specify the name and location of the\nCloud Router that you want to delete. \n\n```\ngcloud compute routers delete ROUTER_NAME \\\n --project=PROJECT_ID \\\n --region=REGION\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eROUTER_NAME\u003c/var\u003e: the name of the Cloud Router that\n you want to delete\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of the project that contains the\n Cloud Router that you want to delete\n\n- \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: the region in which the Cloud Router is\n located\n\nThe output is similar to the following: \n\n```\nDeleted [https://www.googleapis.com/compute/v1/projects/PROJECT_ID/regions/asia-east1/routers/ROUTER_NAME].\n```\n\n### API\n\nUse the\n[`routers.delete`](/compute/docs/reference/rest/v1/routers/delete)\nmethod: \n\n```\nDELETE https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/regions/REGION/routers/ROUTER_NAME\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: the ID of the project that contains the Cloud Router that you want to delete\n- \u003cvar translate=\"no\"\u003eREGION\u003c/var\u003e: the region where the Cloud Router is located\n- \u003cvar translate=\"no\"\u003eROUTER_NAME\u003c/var\u003e: the name of the Cloud Router\n\nWhat's next\n-----------\n\n- To view the configuration of a Cloud Router, its BGP sessions, and the routes that Cloud Router is advertising, see [View router\n details](/network-connectivity/docs/router/how-to/viewing-router-details).\n- To troubleshoot issues when using Cloud Router, see [Troubleshooting](/network-connectivity/docs/router/resources/troubleshooting)."]]