How can we determine the unused API Proxies ?

We have 100s of API Proxies in our org. Can someone please let us know how to determine the unused API Proxies ?

Once we determine this, we can delete the unused API Proxies.

Solved Solved
0 17 1,049
1 ACCEPTED SOLUTION

HI @AMAR DEVEGOWDA

I have a Node utility for this - https://github.com/apigeecs/ApigeeBundleReaper/

Try and let me know if it works

View solution in original post

17 REPLIES 17

HI @AMAR DEVEGOWDA

I have a Node utility for this - https://github.com/apigeecs/ApigeeBundleReaper/

Try and let me know if it works

@Sai Saran Vaidyanathan,

Thanks for sharing the utility. I ran the utility and was able to determine the unused API Proxies based on the traffic. I did verify that the information was correct.

Thanks again for sharing very useful utility !!

Is the tool supports SAML based authentication (access token)?

Is the tool supports SAML based authentication (access token)?

No it does not. Please open a Github issue or else feel free to contribute to the open source

Thanks, I take a look at it, but always getting 504 Gateway Timeout (API stats throws 504) if axdays greater than 15 days. how to avoid such timeouts?

Regards

Nandeesha

Its probably the Mgmt API thats timing out.

Yes,you are correct,so in this case I always stick to less than 15 days for axdays value,.is there any work around?

not sure - open a support ticket stating that stats mgmt api is timing out.

Hi @ssvaidyanathan  @dino 

When reviewed the gitHub link for this utility indicates following "Listing API proxies that has no traffic for a specified number of days (for a given environment or all environments)"   . We are using Apigee OPDK 4.51.00 then how do i decide what’s the max number of days I can use ?  for example 100 or 120 days works but was not sure, if i can use say 730 days to cover 2 Yrs ? or how do i decide on max number of days, based on which factor of postgres Server  ? I can find the size of postgres server but was not sure, how to calculate Max number of days I can go for to substitute for  “Listing API proxies that has no traffic for a specified number of days (for a given environment or all environments)” for this utility ? 

I don't think there is a firm limit on the Apigee stats API.  It will work until it doesn't work. The limit will be determined by the size of the PG server, the volume of API traffic, and the timeout on the management API. 

 

But

I think the number of days you want to use..... should not depend strictly on the practical limit of the number.  From my perspective, the number of days you use should depend on YOUR Definition of "inactive".  

  • You might declare that "30 days of zero activity" implies that the API is inactive or "dead".
  • You might declare that "7 days of zero activity" implies that the API is inactive or dead. 

Unless I am misunderstanding something.... it seems to me that an API that hasn't been used for 100 days is REALLY DEAD. 

Why would you want to keep an API that is more than 120 days unused? 

 

Not applicable

@AMAR DEVEGOWDA

Probably the proxies would be not used if there is no traffic on the proxy for a very long time, You can always check the analytics dashboard on EDGE to see the traffic on the proxy and filter it by seconds, minutes , hours or even days.

Another way is to check which product the proxy is part of and filter the traffic on product level. Also you can contact the developers assigned to that product and check which proxies are been used.

@Raunak Narooka,

Thanks for your response. I was aware of this technique, but it manual. If there are many API Proxies, then it will be very tedious process to determine the unused API Proxies (for the last 90/180 days). I was looking if there was an easier way or some tool/utility to achieve this.

Hi Sai, when i ran i am getting below error and any idea why i am getting this error.

module.js:471 throw err; ^ Error: Cannot find module 'commander' at Function.Module._resolveFilename (module.js:469:15) at Function.Module._load (module.js:417:25) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Object.<anonymous> (/mount0/scripts-custom/ApigeeBundleReaper-master/src/bundle-reaper.js:1:77) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3)

Hi Sai, after i install All modules end up with another issue now. can you please help me what is this issue means?

It would be really appreciate your help. Thanks.

/mount0/scripts-custom/ApigeeBundleReaper-master/src/node_modules/jsonfile/index.js:10 async function _readFile (file, options = {}) { ^^^^^^^^ SyntaxError: Unexpected token function at createScript (vm.js:56:10) at Object.runInThisContext (vm.js:97:10) at Module._compile (module.js:542:28) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Object.<anonymous> (/mount0/scripts-custom/ApigeeBundleReaper-master/src/package/getProxyStatus.js:5:16)

@ssvaidyanathan 

when, i total proxies in api-traffic-status.json listed in both “traffic” and “notraffic” , respective total number of proxies did not match the total count of proxies in the required environment. (it was less).   

When i total number of proxies in “deployed” and “undeployed” it matches the overall count in environment (which looks good). 

I am not sure, why total number of proxies in api-traffic-status.json did not count to total number  number of proxies in given environment and report for “traffic” + “notraffic” showed proxies, which was less than total number of proxy in environment. Let me know, if I am missing anything

Got it now when i add “traffic” and “notraffic”  proxies matched with "deployed" proxies,