If you added API management to your application on Google Cloud, and subsequently decide that you don't want the API management features, you can configure Cloud Endpoints Frameworks to stop managing your API.
Removing API management doesn't stop your API from being served. If you want to stop serving your API, you can either disable the application on the App Engine Settings page in the Google Cloud console, or you can delete the Google Cloud project. See Disabling an application and shutting down a project for more information.
To remove API management:
Backup your API project's
web.xmlandappengine-web.xmlfiles.In your API project's
web.xmlfile, remove the following:- The
endpoints-api-configurationfilter. - The
endpoints-api-controllerfilter. - The
endpoints-api-configurationfilter-mapping. - The
endpoints-api-controllerfilter-mapping.
After deleting the filters and filter mappings, your
web.xmlshould be similar to the following:- The
In your
appengine-web.xmlfile, remove the line that defines theENDPOINTS_SERVICE_NAMEenvironment variable. IfENDPOINTS_SERVICE_NAMEis the only environment variable that you have defined, remove the entireenv-variablessection.Clean your project and then build your API:
Maven
mvn clean mvn package
Gradle
gradle clean gradle build
Redeploy your application:
Maven
mvn appengine:deploy
Gradle
gradle appengineDeploy
After you redeploy your application, Cloud Endpoints Frameworks stops managing your API.
Verifying API management removal
To verify that Endpoints Frameworks is no longer managing your API:
In the Google Cloud console, go to the Endpoints > Services page.
Write down the number of requests to one of the methods in your API.
Click the
View logslink for the method.In the
Produced APIlog, write down the date and time of the most recent log entry.Send some requests to the method in your API.
In the Google Cloud console, go to the Endpoints > Services page.
Go to the Endpoints Services page
The request counter for the method isn't updated.
Click the
View logslink for the method.The
Produced APIlog doesn't contain log entries for the requests that you sent.
Removing dependencies in your build configuration
Although not required, you might want to remove dependencies in your build configuration.
To remove dependencies in your build configuration:
Backup your
pom.xmlfile or yourbuild.gradlefile.Remove the following dependencies:
endpoints-management-control-appengineendpoints-management-control-appengine-allendpoints-framework-auth
Clean your project and then build your API:
Maven
mvn clean mvn package
Gradle
gradle clean gradle build
Redeploy your application:
Maven
mvn appengine:deploy
Gradle
gradle appengineDeploy
Test your API to make sure it is working as expected.
Deleting the managed service
Endpoints Frameworks uses Google's Service Management to manage your API.
When you deployed the OpenAPI document by using the gcloud endpoints services
deploy command, the command used Service Management to create a
managed service for your API. 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 Google Cloud console.
To delete the managed service:
Make sure that the gcloud CLI (
gcloud) is authorized to access your data and services on Google Cloud:gcloud auth loginEnter the following to display the project IDs for your Google Cloud projects:
gcloud projects listUsing the applicable project ID from the previous step, set the default Google Cloud 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 Google Cloud project:
gcloud endpoints services listDelete the service from Service Management. Replace
SERVICE_NAMEwith the name of the service you want to remove.gcloud endpoints services delete SERVICE_NAME
Running
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.
What's next
To restore a managed service, see Restoring a managed service.
For information on the
gcloudcommands used on this page, see thegcloudreference.For information on Service Management, see Creating and deleting managed services.