Cloud Endpoints uses the
Extensible Service Proxy (ESP)
and Service Management to manage your API. When you deployed your
service configuration by using the
gcloud endpoints services deploy command, the
command used Service Management to create a managed service for your API.
To delete your API you need to:
- Delete the instance that ESP and your API backend is running on.
- Delete the managed service that was created for your API.
The easiest way to do both of these tasks is to delete the Google Cloud Platform (GCP) project that your API is in. If you want to preserve your GCP project, then you need to delete the instance and the managed service.
gcloud compute instances delete
command. When you delete an instance in this way, the instance shuts down and
is removed from the list of instances, and all resources attached to the
instance are released, such as persistent disks and any static IP addresses.
To delete an instance, use the following command:
gcloud compute instances delete [INSTANCE_NAME] --zone = [ZONE]
For more information on deleting Compute Engine instances, see the Compute Engine documentation.
To delete a GKE cluster with the
gcloud command-line tool:
gcloud container clusters delete [NAME] --zone [ZONE]
[NAME] with the name of your cluster and
[ZONE] with the compute zone that the cluster is in.
For more information on deleting a GKE cluster, see the GKE documentation.
Deleting the managed service
If you don't need the data on the Endpoints Services page and in the Produced API log on the Logs Viewer page, you can delete the managed service for your API, which removes the data from the GCP Console.
To delete the managed service:
Make sure that the Cloud SDK (gcloud) is authorized to access your data and services on GCP:
gcloud auth login
Enter the following to display the project IDs for your GCP projects:
gcloud projects list
Using the applicable project ID from the previous step, set the default GCP project to the one that your application is in:
gcloud config set project [YOUR_PROJECT_ID]
Obtain the name of all managed services in your GCP project:
gcloud endpoints services list
Delete the service from Service Management:
gcloud endpoints services delete [SERVICE_NAME]
gcloud endpoints services deletedoesn't immediately delete the managed service. Service Management disables the managed service for 30 days, which allows you time to restore it if you need to. After 30 days, Service Management permanently deletes the managed service.