Description of problem: Foreman providers are accessed by "provider_class=provider" parameter. When e.g. adding new Foreman provider with POST /api/providers?provider_class=provider { "type" : "ManageIQ::Providers::Foreman::Provider", "name" : "new_foreman_111", "url" : "100.200.300.111", "credentials" : { "userid" : "foreman_admin", "password" : "foreman_password" } } href attributes of the newly added provider points to incorrect locations { "href": "https://<address>/api/providers/1", "id": 1, ... "actions": [ { "name": "edit", "method": "post", "href": "https://<address>/api/providers/1" ... Correct location would be https://<address>/api/providers/1?provider_class=provider Location https://<address>/api/providers/1 points to "normal" provider. How reproducible: 100%
https://github.com/ManageIQ/manageiq/pull/14657
New commit detected on ManageIQ/manageiq/master: https://github.com/ManageIQ/manageiq/commit/60e75da417a271cd8d8bd0685c19941c2fa83dc3 commit 60e75da417a271cd8d8bd0685c19941c2fa83dc3 Author: Jillian Tullo <jtullo> AuthorDate: Wed Apr 5 14:26:28 2017 -0400 Commit: Jillian Tullo <jtullo> CommitDate: Thu Apr 6 08:33:56 2017 -0400 add api_suffix to append hrefs https://bugzilla.redhat.com/show_bug.cgi?id=1386258 app/controllers/api/base_controller/normalizer.rb | 3 ++- .../api/base_controller/parser/request_adapter.rb | 4 +++ spec/requests/api/providers_spec.rb | 31 ++++++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-)
Verified that the href attribute now points to the correct location /api/providers/:id?provider_class=provider