manageiq-api icon indicating copy to clipboard operation
manageiq-api copied to clipboard

Unable to edit tenant name with API

Open szajac01 opened this issue 5 years ago • 6 comments

Hi, a little bug from the manage iq jansa2 tenants api < url: "{{ miq_api }}/tenants/1" method: POST body: "{"action" : "edit", "resource" : { "name" : "test", "description" : "test" } }" > does update only the description and not the name. I also does not fail

Updating name is possible via the UI in the Company Name field froé server settings.

szajac01 avatar Dec 11 '20 10:12 szajac01

@miq-bot assign @akhilkr128

akhilkr128 avatar Jun 02 '22 14:06 akhilkr128

@akhilkr128 'akhilkr128' is an invalid assignee, ignoring...

miq-bot avatar Jun 02 '22 14:06 miq-bot

If we pass use_config_for_attributes as false along with the body we can edit tenant's name other wise it will pick the company name from settings. An example curl: curl --user username:password -i -X POST -H "Accept: application/json" -d '{ "action": "edit", "resource" : { "name" : "test", "description" : "test", "use_config_for_attributes" : "false" } }' http://url/api/tenants/1

if you want to pick the name, login text from settings pass the use_config_for_attributes as true.

akhilkr128 avatar Jun 07 '22 12:06 akhilkr128

That's a weird requirement - @kbrock Do you recall why this is needed? I would think "false" should be the default if one does not pass the parameter.

Fryguy avatar Jun 07 '22 18:06 Fryguy

This issue will happen only when the table value of use_config_for_attributes is true. If we create a new record in the tenant table use_config_for_attributes default value will be false and then "use_config_for_attributes": "false" is not required in the resource body to edit the tenant name.

akhilkr128 avatar Jun 10 '22 06:06 akhilkr128

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation.

miq-bot avatar Feb 27 '23 00:02 miq-bot