Solved Solved

multiple revisions deployed to the same environment

daniel_biales
Participant V

If the base path changes it is possible to deploy a second revision of the same proxy to the same environment. Is there a way to prevent this from happening? It causes weird issues for us. Most of our deploys are through the maven plugin I don't know if that affects anything.

Solved Solved
1 8 747
1 ACCEPTED SOLUTION
Solved Solved

adevegowda
Staff

@daniel.biales,

Yes you are right, if the base path of the API Proxy is different in each revision, then you can have multiple revisions of the same API Proxy to be deployed in an environment.

The management API will be used for deployment of API Proxies. When you deploy a new revision, then the old revision will be undeployed, if the "override" is set to false in the management API. If the override" is set to true, then the existing revision remains deployed while the new revision is also being deployed.

Please read the section "Seamless deployment" to understand more about the Deployment behaviour here.

Check in the maven plugin, if the override is set to true or false. If it is set to true, please set it to false and try deploying Proxies again and see if the issue goes away.

View solution in original post

Solved Solved
2 7 7
8 REPLIES 8
Solved Solved

adevegowda
Staff

@daniel.biales,

Yes you are right, if the base path of the API Proxy is different in each revision, then you can have multiple revisions of the same API Proxy to be deployed in an environment.

The management API will be used for deployment of API Proxies. When you deploy a new revision, then the old revision will be undeployed, if the "override" is set to false in the management API. If the override" is set to true, then the existing revision remains deployed while the new revision is also being deployed.

Please read the section "Seamless deployment" to understand more about the Deployment behaviour here.

Check in the maven plugin, if the override is set to true or false. If it is set to true, please set it to false and try deploying Proxies again and see if the issue goes away.

View solution in original post

Solved Solved
2 7 8

daniel_biales

As I understand it I need the override to be true because I don't want the deploy to create a new revision.

0 1 7

Mudit_Purwar

@daniel.biales - Deployment in Apigee is 2 stage process, import and deploy (activate).

Its the import function which creates a new revision every time you upload a new API Proxy to the platform.

"override" feature is available for the deploy time. When set to true, forces deployment of the new revision by overriding conflict checks between the existing and the new revision.

0 0 7

daniel_biales

Also we need the override to be true to do the seamless deployments

0 4 7

Mudit_Purwar

@daniel.biales Thats correct.

0 3 7

daniel_biales

I guess then the question is, can we do seamless deployments and have revisions with different basepaths undeployed.

0 2 7

Mudit_Purwar

@daniel.biales - Yes you can but it would need to write some custom code/script to support API Proxy with same name but different basepaths.

Here is how it will work -

1. Get all the deployments in a given environment with the below mgmt api call -

https://api.enterprise.apigee.com/v1/o/ORGNAME/e/ENVNAME/deployments

2. Extract all the REVISION NUMBERS deployed for a given API Proxy from the above output using xpath for output in xml or JSON Parser for output in json.

3. Now you have the REVISION NUMBERS for API Proxy with different base paths.

Below mgmt. api call with give you with the Proxy Endpoint xml exposing the base path for a given revision -

https://api.enterprise.apigee.com/v1/o/ORGNAME/apis/APIPROXY/revisions/REVISIONNUMBER/proxies

4. Loop through all REVISION NUMBERS to query the above Proxy Endpoint xml to get the actual base path corresponding to that REVISION NUMBER, below is the mgmt api call to do that.

https://api.enterprise.apigee.com/v1/o/ORGNAME/apis/APIPROXY/revisions/REVISIONNUMBER/proxies/APIPRO...

5. Now you have the base path for a given REVISION NUMBER, you can decide based on comparison with the base path of the imported revision which is the correct revision to override and deploy.

Alternative way to do it would be to name your API Proxy uniquely for every different basepath. That way each API Proxy has its own base path.

Let me know if this helps.

0 0 7

daniel_biales

@Mudit Kumar I'm actually trying to undeploy the previous revision that has a different basepath, but I think the logic would be pretty similar. This solution seems like a lot of overhead. I was hoping it was just part of the maven plugin. I may end up implementing something like this though.

0 0 7
Top Labels in this Space
Top Solution Authors