Remove Virtual Host in all the existing proxies

Team / @Anil Sagar @Dino

In our organization(on-Premise) we have deleted the http facing Virtual Host(test) and when we tried to redeploying any of the existing proxies, Its throws virtual host reference error(PFA)

Is there way to remove the deleted virtual host(test) from all the existing proxies instead of going through each and every proxy to delete <VirtualHost>test</VirtualHost>!!

6429-vh.png

1 4 400
4 REPLIES 4

yes, of course.

You can do that via the administrative API. What would be necessary is:

  • list all the API Proxies
  • for each proxy, list the revisions
  • for each revision, get the proxy endpoints (there may be more than 1)
  • for each proxy endpoint, look at the vhosts.
  • if the vhosts list includes the "test" vhost, AND if the vhost list length is greater than 1, then remove the "test" vhost from that proxy endpoint.

There is a command-line tool that does this, built in Nodejs.

https://github.com/DinoChiesa/apigee-edge-js-examples/blob/master/findAndRemoveVhost.js

I am not getting anything on the link - https://github.com/DinoChiesa/apigee-edge-js/blob/master/examples/findAndRemoveVhost.js

Any help on this ?

I split out the repo for the examples, some time ago.