Project

General

Profile

Bug #20212

POST /api/v2/hosts does not return `parameters` attribute.

Added by Shimon Shtein over 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Inventory
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:
Red Hat JIRA:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1449749

Description of problem:
On Sat 6.2 and earlier POST /api/v2/hosts sends `host_parameters_attributes` as data and returns all the attributes for created host, including `parameters`. Now it does not return this field at all and additional GET request is needed to obtain `parameters`.

Example using nailgun tool:
  1. Send POST request with defined `host_parameters_attributes`
    In [9]: host = entities.Host(server_config, host_parameters_attributes=[{'name': 'abc', 'value': 'xyz'}]).create_json(create_missing=True)
  1. Check that `parameters is missing in response
    In [10]: 'parameters' in host
    Out10: False
  1. Send GET request and check that parameters was returned
    In [11]: 'parameters' in entities.Host(server_config, id=host['id']).read_json()
    Out11: True

In [12]: entities.Host(server_config, id=host['id']).read_json()['parameters']
Out12:
[{u'created_at': u'2017-05-10 14:48:02 UTC',
u'id': 9,
u'name': u'abc',
u'priority': 70,
u'updated_at': u'2017-05-10 14:48:02 UTC',
u'value': u'xyz'}]

Version-Release number of selected component (if applicable):
Satellite Downstream nightly / 6.3:
  • satellite-6.3.0-11.1.beta.el7sat.noarch
  • foreman-1.15.0-0.develop.201703271956git40dd32b.el7sat.noarch

How reproducible:
Always

Steps to Reproduce:
1. Create a host by issuing a POST request to /api/v2/hosts
2. Check its response
3.

Actual results:
`parameters` is missing

Expected results:
`parameters` should be returned

Additional info:


Related issues

Related to Foreman - Feature #16114: Expose host parameters to GET /api/hostsClosed2016-08-15

Associated revisions

Revision 76222035 (diff)
Added by Shimon Shtein over 5 years ago

Fixes #20212 - create and update host actions now showing params

Revision 12b88c1c (diff)
Added by Shimon Shtein over 5 years ago

Fixes #20212 - create and update host actions now showing params

(cherry picked from commit 76222035de2cdbc6397d91b7aa1ed15f098316eb)

History

#1 Updated by Shimon Shtein over 5 years ago

  • Related to Feature #16114: Expose host parameters to GET /api/hosts added

#2 Updated by The Foreman Bot over 5 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Shimon Shtein
  • Pull request https://github.com/theforeman/foreman/pull/4645 added

#3 Updated by Daniel Lobato Garcia over 5 years ago

  • Legacy Backlogs Release (now unused) set to 276

#4 Updated by Daniel Lobato Garcia over 5 years ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF