Management API list Proxy URLs, deployed environment and Targets

Hello everyone,

is there any possibility to get the following information from a API Proxy using API Calls?

* proxy URL (url in which you will reach the proxy)

* Environment to which the proxy is deployed

* Target URLs of the proxy

you can "build" it using https://<host>:8443/v1/organizations/<o>/environments/<e>/virtualhosts/default and https://<host>:8443/v1/organizations/<o>/apis/<proxy>/revisions/<revision>/proxies/default/ but first you will habe to get first the list of revisions, check the latest.

I guess I could use the same way to obtain the deployment information, but I was able to see which revision is deployed to which environment, and therefore I couldn´t map it to the REST api for getting the basePath using the previously mentioned call.

In general, what we would like to do, is generate a small Overview of the deployed Proxy using the REST API

Solved Solved
0 5 1,779
1 ACCEPTED SOLUTION

Hi @EXTERNPINILLAOSCAR

Using this API, you can get the deployed revision of an API proxy for all environments. Using that revision, you can get the details of your API proxy using

https://{host}/v1/organizations/{org}/apis/{api}/revisions/{rev}/targets/{target}

View solution in original post

5 REPLIES 5

Hi @EXTERNPINILLAOSCAR

Using this API, you can get the deployed revision of an API proxy for all environments. Using that revision, you can get the details of your API proxy using

https://{host}/v1/organizations/{org}/apis/{api}/revisions/{rev}/targets/{target}

@EXTERNPINILLAOSCAR - did that resolve your issue ?

Hi, thanks for the answer. This one helped and now I have the target URL

 "connection": {
        "connectionType": "httpConnection",
        "uRL": "https://www.myTarget.com
    },

Do you know any API call to get the URL used to call this proxy? Meaning something like this https://apigee.com/myProxy

Thanks in advance

You will need to traverse and get the virtual host info from the proxy configuration

https://{host}/v1/o/{org}/apis/{api}/revisions/{rev}/proxies/default

And then get the Virtual host from the response. Then use the Get Virtual Host API to get that info

https://{host}/v1/o/{org}/e/{env}/virtualhosts/{vName}

Should return the host name and the earlier API call for proxy configuration should have the base path as well. If you append both, you can get the Proxy URL

Thanks, that really helped a lot.