Deleting an API and API Instances

This page shows how to delete an API and the App Engine, Compute Engine, or Kubernetes Engine instance that the API runs on. Deleting an API removes it from the APIs list for your project in the Google Cloud Platform Console, and stops all services performed for that API, for example, API key checks.

Because deleting the API doesn't stop the instances running the API, you must also delete the instances used to run the API.

Deleting an API

To delete an API:

  1. Obtain the name of the API you want to delete. If you are unsure of the name, invoke the following command to list the APIs managed in your project:

    gcloud endpoints services list
  2. Delete the API using the following command:

    gcloud endpoints services delete ${SERVICE_NAME}

    Replace ${SERVICE_NAME} with the name of your API.

Deleting API instances

Deleting an API does not delete the instances it was running on: if you want to delete the instances that are running your API, you need to delete them as well.

Compute Engine

Use the 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 example-instance [example-instance-2 example-instance-3..]

For more information on deleting Compute Engine instances, see the Compute Engine documentation.

Kubernetes Engine

To delete a container cluster with the gcloud command-line tool:

gcloud container clusters delete NAME --zone ZONE

For more information on deleting a Kubernetes Engine cluster, see the Kubernetes Engine documentation.

Send feedback about...

Cloud Endpoints with gRPC