Sadhan
Sadhan

Reputation: 15

How to overwrite the api proxy deployment using apigeetool

I am using the below command in jenkins to deploy the api proxies to apigee edge.

apigeetool deployproxy -u abc -o nonprod -e dev -n poc-jenkins1 -p xyz

But am getting the below error.

Error: Path /poc-deployment-automation conflicts with existing deployment path for revision 1 of the APIProxy poc-deploy-automation in organization nonprod, environment dev

Here is my requirement , please help me what command to use.

  1. If API doesn’t exist in target environment, Create Api in new environment with version 1.
  2. If API already exist in target environment, Create Api in new environment with new version (previous version + 1)

So what command should we use to fix the above error and what should we use to do the above 2 tasks.

Help Appreciated.

Upvotes: 0

Views: 848

Answers (1)

Jhonny Mertz
Jhonny Mertz

Reputation: 11

The apigeetool deployproxy command supports by default your requirements. It deploys the revision 1 if there is no proxy with the name, and increases the revision if it already exists.

However, based on the error you mentioned, it seems that you have a path conflict between two proxies. You are trying to deploy a proxy to a /poc-deployment-automation basepath, but there is another proxy called poc-deploy-automation which is listening on the same basepath. It is not possible, even if the proxy name is different, because the basepath is what apigee uses to redirect traffic to your proxy.

Check the xml file at the root of your proxy and change the basepath attribute.

Also, the basepath of an API Proxy can be anything, but could not be the same used at the same time by two proxies--only one can be deployed at time. The revision numbers are irrelevant in this situation.

Upvotes: 1

Related Questions