Bug #20212
closedPOST /api/v2/hosts does not return `parameters` attribute.
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`.
- 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)
- Check that `parameters is missing in response
In [10]: 'parameters' in host
Out10: False
- 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'}]
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:
Updated by Shimon Shtein over 7 years ago
- Related to Feature #16114: Expose host parameters to GET /api/hosts added
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
Updated by Daniel Lobato Garcia over 7 years ago
- Translation missing: en.field_release set to 276
Updated by Daniel Lobato Garcia over 7 years ago
- Status changed from Ready For Testing to Closed