API Proxy overview page URL

k_prathip
Participant III

When I setup my org I had given ip address and the API proxy that was deployed in that Org lists that IP address in the API url. Now I have got a DNS name for that IP. The API proxy works only when I give the IP addess, but when I call the same proxy with the DNS name I am getting the below error.

{"fault":{"faultstring":"Unable to identify proxy for host: <DNS> and url: \/<Proxy context path>","detail":{"errorcode":"messaging.adaptors.http.flow.ApplicationNotFound"}}}
0 1 238
1 REPLY 1

Not applicable

Hi,

This is normal. The proxy is not deployed to a virtual host with the new DNS name. You can update the current virtual host by adding a new host alias (your DNS name).

Updating a vhost is done by this call.

http://docs.apigee.com/management/apis/put/organizations/%7Borg_name%7D/environments/%7Benv_name%7D/...

An easy way is to download the current virtual host definition, make a copy then use that as a template for the new one.

So print the current one for say the default secure vhost,

https://{mgmt_server_hostname:port/v1/organizations/{your_org_name}/environments/{env_name//virtualh... -u admin_email:admin_password

So if I run the the following (I am on the mgmt server itself so I can use localhost). I am using the standard HTTP virtual host

 curl -v localhost:8080/v1/o/myorg/e/test/virtualhosts/default -u opdk@apigee.com:password123

Output (assuming I used an IP address as well) would look something like this:


{
  "hostAliases" : [ "1.2.3.4" ],
  "interfaces" : [ ],
  "listenOptions" : [ ],
  "name" : "default",
  "port" : "80"
}


So now I can use that as a model add another "hostalias" value which matches my DNS name and POST the new definition, see link above.

{
  "hostAliases" : [ "1.2.3.4", "mydns.com" ],
  "interfaces" : [ ],
  "listenOptions" : [ ],
  "name" : "default",
  "port" : "80"
}

Note: I have used env test and the default virtual host (HTTP). If you are making secure connections use the 'secure' virtual host, it will have extra fields but the principle is the same. If you have setup different virtual hosts change the names as required. Note when you do the POST set the content-type header to "application/json"