Deleting an API and API Instances

This page shows how to delete an API and the App Engine, Compute Engine, or Container 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 service-management list --produced
  2. Delete the API using the following command:

    gcloud service-management 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.

App Engine

To delete an instance running in the App Engine flexible environment:

  1. Get a list of all modules and versions for your project by invoking:
    gcloud app versions list
  2. Delete the desired API instance and API version by invoking the following:
    gcloud app versions delete --service=${SERVICE} ${VERSION}

    replacing ${SERVICE}with your API name and ${VERSION} with the version you are deleting. Note that you cannot delete all versions of your API! You must have at least one. Attempting to delete all versions will result in an error.

Compute Engine

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

Container Engine

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

Send feedback about...

Cloud Endpoints with gRPC