remove not used apiproxy

Hi Guys,

I would remove never deployed to MP or undeployed API Proxies which they were not touched longer than 1 month.

What I already know, how to:

- list deployments - can see what is deployed, and compare with,

- list apiproxes - can use lastModifiedAt for filtering

Any other ideas how to do it ?

Maybe something already exist ?

Let's discuss!

1 2 131
2 REPLIES 2

I like your question.

Yes, the Edge administrative API will be able to help you.

You probably need to build your own groomer tool to do what you want.

In the tool you can:

  • query each API proxy and examine the "lastModifiedAt" on the API proxy to check the modification time.
  • query the deployments to see which proxies are deployed

A tool that combines these will be able to determine which API proxies are in active (current) use, and which have been recently modified.

But there is something else you must consider. Suppose someone has a proxy that is in continuous use, though it has not been modified for the past 9 months.

Then, for some maintenance purpose reason, they undeploy the proxy at one moment. The admin intends to re-deploy the proxy in 3 minutes. Just after undeployment, your cron job runs. It sees the proxy has not been modified for a long while, and it sees the proxy is not currently deployed. A naive approach would be to simply remove that proxy, RIGHT NOW. That would be wrong.

So you may wish to augment the tool with some additional smarts

  • also examine the audit trail for your organization, and look for deploy/undeploy events on API Proxies. This will tell you if anyone is using the proxy.
  • include a state-storage mechanism, and have your tool remove an API proxy only after 3 successive cycles indicating it is not in use
  • maybe also include a capability to send a warning or notifcation email to the email address last associated to an account that modified the proxy or deployed/undeployed it. This information is available in the audit logs.

I found that, don't need to care about deployments.

Can just list APIs, check last time modify and send request to delete it, if API is deployed to any env or with Product related, Apigee will not allow deletion.