Project

General

Profile

Actions

Bug #20212

closed

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

Added by Shimon Shtein over 7 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Inventory
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

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

Related to Foreman - Feature #16114: Expose host parameters to GET /api/hostsClosedTrey Dockendorf08/15/2016Actions
Actions #1

Updated by Shimon Shtein over 7 years ago

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

Updated by The Foreman Bot over 7 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
Actions #3

Updated by Daniel Lobato Garcia over 7 years ago

  • Translation missing: en.field_release set to 276
Actions #4

Updated by Daniel Lobato Garcia over 7 years ago

  • Status changed from Ready For Testing to Closed
Actions

Also available in: Atom PDF