Bug #31311
not possible to update interfaces in POST /api/hosts/:host_id
Description
Ohai,
PUT /api/hosts/:host_id
allows to provide interface_attributes
, but id
is not one of the accepted attributes, so it's not possible to update an existing interface using that API (validation fails if one tries, "duplicate identifier"). The same works fine using the dedicated /api/interfaces/:host_id
endpoint
Related issues
Associated revisions
History
#1
Updated by Evgeni Golov over 2 years ago
- Related to Tracker #27680: API bugs that need workarounds in foreman-ansible-modules added
#2
Updated by The Foreman Bot over 2 years ago
- Assignee set to Evgeni Golov
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/8137 added
#3
Updated by Evgeni Golov over 2 years ago
As my description seems to be not top notch:
- The API accepts the `id` parameter if it's sent, and then the interface is updated properly
- The API rejects PUTs without `id` which try to refer to an existing interface
- API clients that validate their requests against the apidoc before sending it, will drop the `id` param.
#4
Updated by The Foreman Bot over 2 years ago
- Fixed in Releases 2.4.0 added
#5
Updated by Evgeni Golov over 2 years ago
- Status changed from Ready For Testing to Closed
Applied in changeset foreman|a3f030f149fa75e36f8ef89c3c11b9c0b861269a.
Fixes #31311 - add `id` to apidoc of interfaces_attributes
the hosts controller accepts `id` already, but without it being exposed
in the apidoc, api clients don't know that it can be set