apigee-config-maven-plugin: new product not getting added to existing app.

I have used the apigee-config-maven-plugin for deploying Apigee Edge Config in the CICD pipeline for private cloud.
I have set up the the multi-file structure as given in the sample : https://github.com/apigee/apigee-config-maven-plugin/tree/master/samples/EdgeConfig
All scenarios are working fine except for one, where in I am trying to add a new product to an existing app and it is not getting added.

Used the below maven command for deploying the configs:

mvn install -Ptest -Dusername=<your-apigee-username> -Dpassword=<your-apigee-password> -Dapigee.config.options=update -Dapigee.app.ignoreAPIProducts=true -Dapigee.config.dir=resources/edge

Thanks 

dchiesa1

@ssvaidyanathan 

 

 

 

Solved Solved
0 3 172
1 ACCEPTED SOLUTION

HI @iremfiza2007 

Yes that is working as expected. You are passing the -Dapigee.app.ignoreAPIProducts=true argument as well. When you do this, the plugin ignores the "apiproduct" block in the app payload. When you do not include the argument, it will update the app and also create a new set of credentials with the API products you have in the config file. The argument was mainly added to avoid that creation of credentials. 

If you are looking to add an API product to an existing credential, then thats not possible using the plugin. For that you will need to have the credentials also in the config file which is not a good practice. Hence it was not implemented. Your option is to use the Mgmt API directly or use the UI for this use case. 

View solution in original post

3 REPLIES 3

HI @iremfiza2007 

Yes that is working as expected. You are passing the -Dapigee.app.ignoreAPIProducts=true argument as well. When you do this, the plugin ignores the "apiproduct" block in the app payload. When you do not include the argument, it will update the app and also create a new set of credentials with the API products you have in the config file. The argument was mainly added to avoid that creation of credentials. 

If you are looking to add an API product to an existing credential, then thats not possible using the plugin. For that you will need to have the credentials also in the config file which is not a good practice. Hence it was not implemented. Your option is to use the Mgmt API directly or use the UI for this use case. 

Thanks @ssvaidyanathan 

This is by design, the README states:

When apigee.config.options=update is run on apps and companyapps and if the payload passed includes the apiProducts, the Management server created a new credentials. To avoid this you can pass -Dapigee.app.ignoreAPIProducts=true.

This sort of implies that it only applies to the credentials keys, but it also prevents the API Product from being updated. That's because credentials includes both the API Product and keys.