Project

General

Profile

Actions

Bug #31311

closed

not possible to update interfaces in POST /api/hosts/:host_id

Added by Evgeni Golov about 4 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
API
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

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 1 (1 open0 closed)

Related to Foreman - Tracker #27680: API bugs that need workarounds in foreman-ansible-modulesNew

Actions
Actions #1

Updated by Evgeni Golov about 4 years ago

  • Related to Tracker #27680: API bugs that need workarounds in foreman-ansible-modules added
Actions #2

Updated by The Foreman Bot about 4 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Evgeni Golov
  • Pull request https://github.com/theforeman/foreman/pull/8137 added
Actions #3

Updated by Evgeni Golov about 4 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.
Actions #4

Updated by The Foreman Bot about 4 years ago

  • Fixed in Releases 2.4.0 added
Actions #5

Updated by Evgeni Golov about 4 years ago

  • Status changed from Ready For Testing to Closed
Actions

Also available in: Atom PDF