Cloud Endpoints verwendet den Extensible Service Proxy (ESP) und Service Management zur Verwaltung Ihrer API. Als Sie das OpenAPI-Dokument mit dem Befehl gcloud endpoints services deploy bereitgestellt haben, hat der Befehl mithilfe von Service Management einen verwalteten Dienst für Ihre API erstellt.
Zum Löschen der API müssen Sie:
die Instanz löschen, auf der der ESP und Ihr API-Back-End ausgeführt werden, und
den verwalteten Dienst löschen, der für Ihre API erstellt wurde.
Am einfachsten erledigen Sie diese beiden Aufgaben durch Löschen des Projekts, in dem sich Ihre API befindet. Google CloudWenn Sie IhrGoogle Cloud -Projekt beibehalten möchten, müssen Sie die Instanz und den verwalteten Dienst löschen.
Instanzen löschen
App Engine
So löschen Sie eine in der flexiblen App Engine-Umgebung ausgeführte Instanz:
Sie können die Anwendung entweder in der Google Cloud Console auf der Seite App Engine-Einstellungen deaktivieren oder das Google Cloud Projekt löschen. Weitere Informationen finden Sie unter Anwendung deaktivieren und Projekt beenden.
Compute Engine
Führen Sie den Befehl gcloud compute instances delete aus. Wenn Sie eine Instanz so löschen, fährt sie herunter und wird aus der Liste der Instanzen entfernt. Alle ihr angehängten Ressourcen, z. B. nichtflüchtige Speicher und alle statischen IP-Adressen, werden freigegeben.
Verwenden Sie folgenden Befehl, um eine Instanz zu löschen:
So löschen Sie einen GKE-Cluster mit der Google Cloud CLI:
gcloudcontainerclustersdelete[NAME]--zone [ZONE]
Ersetzen Sie [NAME] durch den Namen Ihres Clusters und [ZONE] durch die Compute-Zone, in der sich der Cluster befindet.
Weitere Informationen zum Löschen eines GKE-Clusters finden Sie in der GKE-Dokumentation.
Verwalteten Dienst löschen
Wenn Sie die Daten auf der Seite Endpoints-Dienste und im Log Produzierte API auf der Seite Log-Explorer nicht benötigen, können Sie den verwalteten Dienst für Ihre API löschen, wodurch die Daten aus der Google Cloud Console entfernt werden.
So löschen Sie den verwalteten Dienst:
Achten Sie darauf, dass die gcloud CLI (gcloud) zum Zugriff auf Ihre Daten und Dienste auf Google Cloudberechtigt ist:
gcloud auth login
Geben Sie Folgendes ein, um sich die Projekt-IDs für Ihre Google Cloud-Projekte anzeigen zu lassen:
gcloud projects list
Legen Sie mit der entsprechenden Projekt-ID aus dem vorherigen Schritt das StandardprojektGoogle Cloud auf das Projekt fest, in dem sich Ihre Anwendung befindet:
gcloudconfigsetproject[YOUR_PROJECT_ID]
Ermitteln Sie den Namen aller verwalteten Dienste in Ihrem Google Cloud -Projekt:
gcloud endpoints services list
Löschen Sie den Dienst aus Service Management. Ersetzen Sie dabei SERVICE_NAME durch den Namen des Dienstes, den Sie entfernen möchten:
gcloud endpoints services delete SERVICE_NAME
Der verwaltete Dienst wird bei Ausführung von gcloud endpoints services delete nicht sofort gelöscht. Service Management deaktiviert den verwalteten Dienst 30 Tage lang, sodass Sie ihn bei Bedarf wiederherstellen können. Nach 30 Tagen löscht Service Management den verwalteten Dienst endgültig.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-04 (UTC)."],[[["\u003cp\u003eCloud Endpoints utilizes the Extensible Service Proxy (ESP) and Service Management to manage APIs, where deploying an OpenAPI document creates a managed service.\u003c/p\u003e\n"],["\u003cp\u003eDeleting an API involves removing both the instance running ESP and the API backend, as well as the managed service created for that API.\u003c/p\u003e\n"],["\u003cp\u003eInstances can be deleted using different methods based on the environment, such as disabling applications in App Engine or using \u003ccode\u003egcloud compute instances delete\u003c/code\u003e for Compute Engine and \u003ccode\u003egcloud container clusters delete\u003c/code\u003e for GKE.\u003c/p\u003e\n"],["\u003cp\u003eManaged services can be deleted via the gcloud CLI, but they are only disabled for 30 days initially, providing a window for potential restoration before permanent deletion.\u003c/p\u003e\n"],["\u003cp\u003eIf you do not require any data stored in the Endpoints Services or Produced API logs, you are able to delete the service.\u003c/p\u003e\n"]]],[],null,["# Deleting an API and API instances\n\nOpenAPI \\| [gRPC](/endpoints/docs/grpc/deleting-an-api-and-instances \"View this page for the Cloud Endpoints gRPC docs\")\n\n\u003cbr /\u003e\n\nCloud Endpoints uses the\n[Extensible Service Proxy (ESP)](/endpoints/docs/openapi/glossary#extensible_service_proxy)\nand Service Management to manage your API. When you deployed your\nOpenAPI document by using the `gcloud endpoints services deploy` command, the\ncommand used Service Management to create a managed service for your API.\n\nTo delete your API you need to:\n\n- Delete the instance that ESP and your API backend is running on.\n- Delete the managed service that was created for your API.\n\nThe easiest way to do both of these tasks is to delete the Google Cloud\nproject that your API is in. If you want to preserve your\nGoogle Cloud project, then you need to delete the instance and the managed\nservice.\n| **Note:** If you encounter issues with Google Cloud project deletion, refer to the [troubleshooting](/resource-manager/docs/troubleshooting-project-deletion) section for resolution.\n\nDeleting instances\n------------------\n\n### App Engine\n\nTo delete an instance running in the App Engine flexible environment:\n\nYou can either disable the application on the **App\nEngine Settings** page in the Google Cloud console, or\nyou can delete the Google Cloud project. See [Disabling\nan application and shutting down a project](https://cloud.google.com/appengine/docs/flexible/python/managing-projects-apps-billing#disabling_an_application) for more information.\n\n### Compute Engine\n\nUse the [`gcloud compute instances delete`](/sdk/gcloud/reference/compute/instances/delete)\ncommand. When you delete an instance in this way, the instance shuts down and\nis removed from the list of instances, and all resources attached to the\ninstance are released, such as persistent disks and any static IP addresses.\n\nTo delete an instance, use the following command: \n\n```transact-sql\ngcloud compute instances delete [INSTANCE_NAME] --zone = [ZONE]\n```\n\nFor more information on deleting Compute Engine instances, see the\n[Compute Engine documentation](/compute/docs/instances/stopping-or-deleting-an-instance).\n\n### GKE\n\nTo delete a GKE cluster with the Google Cloud CLI: \n\n```transact-sql\ngcloud container clusters delete [NAME] --zone [ZONE]\n```\n\nReplace `[NAME]` with the name of your cluster and\n`[ZONE]` with the compute zone that the cluster is in.\n\nFor more information on deleting a GKE cluster, see the\n[GKE documentation](/kubernetes-engine/docs/how-to/deleting-a-cluster).\n\nDeleting the managed service\n----------------------------\n\nIf you don't need the data on the **Endpoints Services** page and in the\n**Produced API** log on the **Logs Explorer** page, you can delete the managed\nservice for your API, which removes the data from the Google Cloud console.\n\nTo delete the managed service:\n\n1. Make sure that the gcloud CLI (`gcloud`) is authorized to access your\n data and services on Google Cloud:\n\n gcloud auth login\n\n2. Enter the following to display the project IDs for your Google Cloud\n projects:\n\n gcloud projects list\n\n3. Using the applicable project ID from the previous step, set the default\n Google Cloud project to the one that your application is in:\n\n gcloud config set project [YOUR_PROJECT_ID]\n\n4. Obtain the name of all managed services in your Google Cloud project:\n\n gcloud endpoints services list\n\n5. Delete the service from Service Management. Replace\n \u003cvar translate=\"no\"\u003eSERVICE_NAME\u003c/var\u003e with the name of the service you want\n to remove.\n\n ```\n gcloud endpoints services delete SERVICE_NAME\n ```\n\n Running `gcloud endpoints services delete` doesn't immediately delete the\n managed service. Service Management disables the managed service for\n 30 days, which allows you time to restore it if you need to. After 30 days,\n Service Management permanently deletes the managed service.\n\nWhat's next\n-----------\n\n- To restore a managed service, see\n [Restoring a managed service](/endpoints/docs/openapi/restore-managed-service).\n\n- For information on the `gcloud` commands used on this page, see the\n [gcloud reference](/sdk/gcloud/reference).\n\n- For information on Service Management, see\n [Creating and deleting managed services](/service-infrastructure/docs/create-services)."]]