Need Api proxy details

Not applicable

https://api.enterprise.apigee.com/v1/organizations/{{organization}}/apis

This link will give only api names.

I need all apis with their deployed environments.

other details will be plus.

How can i get this in one request?

Solved Solved
0 7 762
1 ACCEPTED SOLUTION

Hi @Pravin Mane

Welcome to the community !!

You can use the Deployments Management APIs to get the info you are looking for. More details can be found here.

You might not be able to get the deployed proxies for all environments for a given org using one Mgmt API call. You might have to combine few calls.

1) Get the list of environments for a given org - more info here

https://api.enterprise.apigee.com/v1/organizations/{org}/environments/

This will return the environment list in an array.

2) Iterate through the above array calling the Deployments API

https://api.enterprise.apigee.com/v1/organizations/{org}/environments/{env}/deployments

The response will have the proxy names, the revision deployed, etc

You can parse through the JSON and extract the info that is needed.

NOTE: If you are an On prem user - you can get the info using this API as well.

Hope this helps !!

View solution in original post

7 REPLIES 7

Hi @Pravin Mane

Welcome to the community !!

You can use the Deployments Management APIs to get the info you are looking for. More details can be found here.

You might not be able to get the deployed proxies for all environments for a given org using one Mgmt API call. You might have to combine few calls.

1) Get the list of environments for a given org - more info here

https://api.enterprise.apigee.com/v1/organizations/{org}/environments/

This will return the environment list in an array.

2) Iterate through the above array calling the Deployments API

https://api.enterprise.apigee.com/v1/organizations/{org}/environments/{env}/deployments

The response will have the proxy names, the revision deployed, etc

You can parse through the JSON and extract the info that is needed.

NOTE: If you are an On prem user - you can get the info using this API as well.

Hope this helps !!

@Sai Saran Vaidyanathan. How can we check the same for private cloud?

@Suresh Mishra - Instead of api.enterprise.apigee.com, use your Private cloud Mgmt server host

@Pravin Mane

Assuming this answer resolved your issue

@Sai Saran Vaidyanathan

Yes, we have already started using
https://api.enterprise.apigee.com/v1/organizations/{org}/environments/{env}/deployments

But we have around 200 API proxies deployed in production environment.

It takes almost 2 min to fetch these proxies using this api.

I contacted the apigee support team. But they have not provided any other solution.

So we are now caching the result of this deployments api and refreshing the data at some interval.

Hope this helps someone who is facing same issue.

Thanks for the support

Regards,

Pravin

@Pravin Mane - just curious, what is the objective of this API ? I guess it is to get the list of APIs deployed in a given environment (in other words for your Operations).

Why do you have to cache it ? Not a good idea to store all that info in Cache unless its frequently used. If you really want to Cache, you should probably parse the response you get - say create a JSONArray of API names that are deployed ["proxy1", "proxy2"] and then store that object in Cache (if required). Makes it faster, less memory and more readable.

If you think just the proxy names are not enought parse all that is needed from the response and use that -like

[
   {
      "name":"proxy1",
      "revision":1
   },
   {
      "name":"proxy2",
      "revision":10
   }
]

Yes we are caching api names but only for specific environment.

We are using api names on most of the pages of portal.

And if we call this api using php curl it takes lot of time to load the page (aroung 100 to 150 sec for 150 proxies)

that is why we need to cache it.

Thanks for the support. it is now working fine.