Description of problem: Ability to add a custom attribute (to provider) that already exists Version-Release number of selected component (if applicable): 5.7.0.17 How reproducible: 100% Steps to Reproduce: 1. (via API) add custom attributes with name <name> 2. (via API) add custom attributes with name <name> 3. Actual results: The custom attribute has successfully added (overrided the existent one) Expected results: You should see an error, i.e. "Custom attribute <name> already exists" Additional info:
Hi, I did not found "custom" attributes here: http://manageiq.org/docs/reference/latest/api/appendices/resource_attributes#providers Are we talking of custom attributes for VMs? (or Instances ,etc, depending on the provider) I already used "custom attributes" to VMs/Instances, but i did not find other "custom attributes". In case of custom attributes for VMs/Instances, that behavior (while incorrect) is quite convenient. Cheers.
Gilad Please add: The request you are using (POST, PUT etc) the entire body
method: post url: https://<appliance IP>/api/providers/1/custom_attributes payload: { "action": "add", "resources": [{ "name": "foo", "value": "17" }]}
There seems to be an intent in the code to allow "edit" from "add": https://github.com/ManageIQ/manageiq/blob/master/app/controllers/api/subcollections/custom_attributes.rb#L35-L36 This code is common for Vms and Providers, and as Guillermo stated in comment 2 this could be quite convenient. However, this seems to be a confusing behaviour. Tim, what do you think?
As per conversation in Gitter, this is intended behavior: https://gitter.im/ManageIQ/api?at=58fe170e881b89e1017f2eb2