apigee-config-maven-plugin Apigee Management API apiproducts - is product name case sensitive?

For example if on Apigee Edge there's existing product "HelloWorld-Product", looks like when using apigee-config-maven-plugin update for product "helloworld-product" it will treat this as new product not existing, but when it try to call management api to create (POST) new product "helloworld-product" the management api will return following error:

[ERROR] Apigee call failed 400 Bad Request
{
"code" : "mint.resourceAlreadyExists",
"message" : "Conflicting Product already exists",
"contexts" : [ ]
}

Is this an issue of apigee-config-maven-plugin?

0 11 351
11 REPLIES 11

The name that the plugin uses is the machine name in apigee. You could also do an update so it just overwrites the product if it already exits

Thanks @daniel.biales for looking into this. In my case I'm using update option of the plugin, but the issue is that the plugin cannot recognize this is an existing product and update accordingly. Is there a way to include the machine name in apigee in the config so plugin know exactly product to update.

The "name" attribute in the edge.json is supposed to be the machine name. You can also specify a "displayName"

Thanks @daniel.biales. I think my issue is related with the name field. I will check with Sai Saran of his testing.

Hi @Peng Du

I tried the same - I had a product called "EchoProduct" and I ran the config plugin with "echoproduct" and it worked. I was able to create a new product

Thanks @Sai Saran Vaidyanathan for looking into this. Could you please share your testing project including the existing product so I can check if it is the exactly same situation I'm facing. As @Daniel Biales mentioned in his reply, this is related to the name (machine name).

You can use the samples and update it on your local and try executing it

@Sai Saran Vaidyanathan I tried the sample and I can reproduce the same issue in amer-poc20 environment. Here is what I did:

First, run maven to publish the apiproxy and product config use the sample as it is. It works fine. In edge.json the product name looks like this:

"name": "EchoProduct"

Second, I changed the name in edge.json to something like this:

"name": "echoproduct"

When I run the same command again to publish, I got same errors as before:

[ERROR] Apigee call failed 400 Bad Request { "code" : "mint.resourceAlreadyExists", "message" : "Conflicting Product already exists", "contexts" : [ ] }

If needed I can send you the full log and the command I'm using.

Thanks.. Will keep you posted

I don't think you can have capitals for the machine name. If you do it converts it to lowercase (I think) therefore "EchoProduct"="echoproduct"

HI @Peng Du - as discussed, this is a bug when Apigee org is monetization enabled. I have opened an issue with the Engg team and they will look into it. But as a general good practice, I would recommend you to name the products unique (case insensitive). This is not a plugin issue. Appreciate if you can accept the answer