In order to DEPLOPY ProxyAPI I need to first UNDEPLOY every version on that env. Is this correct? Any way around it?

Not applicable

Hi. I am trying to import and then deploy a Proxy from Java calling Edge API.

I was able to successfully import and deploy a Proxy. But running this script a second time gives an error saying proxy is already deployed. So, at least from my experiments, I need to undeploy ALL previous version of this proxy on in this env. before I can deploy a new version.

This presents a problem if we want to make our apis backward compatible.

We want to have previous versions still work while new one is deployed so users of those apis won't have a disruption.

Question: Am I missing the correct usage of deployment? Or is there a way to make multiple versions of a proxy to exist on the env?

Thank you.

Solved Solved
0 4 349
1 ACCEPTED SOLUTION

Hi @Jim Duhovny - Your API proxy base URL has to be unique within an environment. If you try to deploy an API proxy with the same base URL, you get that error. The way you can avoid such an error is by having the version number as part of the base URL. By the way it's a very good practice. This will let you run multiple versions of the API proxy in a single environment, providing backward compatibility.

If you are asking about only in-flight transactions being disrupted while you are deploying a new revision of the API proxy, then set the override flag to true as indicated in this API. But remember only one revision is allowed to be deployed in an environment.

Thanks, Sudhee

View solution in original post

4 REPLIES 4

Not applicable

Hi there!

You can use the Management API's to achieve the zero downtime deployment. Here is the sample api call:

curl -X POST -H "Content-type:application/x-www-form-urlencoded" \http://{management-server:8080}/v1/o/{org_name}/environments/{env-name}/apis/{api_name}/revisions/{r... \-u myname:mypass

The only thing is that the delay parameter must be set long enough so that the new revision gets a chance to be deployed. For instance it might take 1 minutes for the proxy to get deployed, so it's safe to set the delay parameter to 2 minutes so that the 'old' revision keeps servicing the requests.

Hope this answers your question.

Thanks,

Archendra

Hi @Jim Duhovny - Your API proxy base URL has to be unique within an environment. If you try to deploy an API proxy with the same base URL, you get that error. The way you can avoid such an error is by having the version number as part of the base URL. By the way it's a very good practice. This will let you run multiple versions of the API proxy in a single environment, providing backward compatibility.

If you are asking about only in-flight transactions being disrupted while you are deploying a new revision of the API proxy, then set the override flag to true as indicated in this API. But remember only one revision is allowed to be deployed in an environment.

Thanks, Sudhee

Thank you. That was it!

Interesting that I could not find documentation explaining it well.

sarthak
Participant V

I also wanted to highlight the fact that importing a proxy and deploying it are two different things.

You can have multiple revisions of a proxy available/imported in an environment but only one revision will be deployed to that environment.

So even if there are 10 revisions present only one is deployed at one time in a particular environment. And Yes, that particular revision will need to be undeployed from that specific environment before the new revision in activated.

Thats why there are two APIs: http://apigee.com/docs/management/apis/post/organizations/%7Borg_name%7D/apis-0 which is used to import an API proxy and http://apigee.com/docs/management/apis/post/organizations/%7Borg_name%7D/environments/%7Benv_name%7D... which is used for deployment,