Delete an API Proxy from APIGEE

Former Community Member
Not applicable

We have a few APIs that are not being used anymore and we would like to delete it from APIGEE. Instead of doing it manually, we would like to automate this.

The steps would include deleting the proxy bundle, removing the API from all the Products it is added to.

Is there an already written maven tool to accomplish this?

Thanks in advance!

Solved Solved
0 2 428
1 ACCEPTED SOLUTION

No, I don't know of a maven tool that does this.

I think what you'd need to do is something like this in pseudo-code:

foreach (proxy in list_to_remove) {
  foreach (product that includes that proxy) {
    remove the proxy from the product
  }
  foreach (deployment of the proxy) {
    undeploy
  }
  delete the proxy (and all its revisions)
}

This is not too complicated to do with the Admin API. I suppose you could script it with some bash magic or similar.

There is a Javascript wrapper of the Admin API that would help, if you want to write a nodejs tool to do this. There is also a Powershell module for the admin API that would help, if you want to write powershell. There's a PHP wrapper too, which is part of the devportal. It would work if you wanted to script this in PHP.

The Javascript option has an advantage in that there are a variety of examples already available, and you can use them as a starting point to solve your problem.

For example

If you know JavaScript it wouldn't be too hard to write a nodejs tool using this library to completely remove a proxy.

View solution in original post

2 REPLIES 2

No, I don't know of a maven tool that does this.

I think what you'd need to do is something like this in pseudo-code:

foreach (proxy in list_to_remove) {
  foreach (product that includes that proxy) {
    remove the proxy from the product
  }
  foreach (deployment of the proxy) {
    undeploy
  }
  delete the proxy (and all its revisions)
}

This is not too complicated to do with the Admin API. I suppose you could script it with some bash magic or similar.

There is a Javascript wrapper of the Admin API that would help, if you want to write a nodejs tool to do this. There is also a Powershell module for the admin API that would help, if you want to write powershell. There's a PHP wrapper too, which is part of the devportal. It would work if you wanted to script this in PHP.

The Javascript option has an advantage in that there are a variety of examples already available, and you can use them as a starting point to solve your problem.

For example

If you know JavaScript it wouldn't be too hard to write a nodejs tool using this library to completely remove a proxy.

I wrote an example in Javascript to remove a proxy.

removeProxy.js