Bug #6674
closed
Can't create a host via the API because params aren't correctly wrapped
Added by David Davis over 10 years ago.
Updated over 10 years ago.
Description
When I try the following curl command, I get "Name can't be blank":
$ curl -k -u admin:changeme -H "Content-Type: application/json" -X POST http://localhost:3000/api/v2/hosts -d '{"name": "TEST"}'
It looks like the name param is getting wrapped in params[:base] instead of params[:host].
- Bugzilla link set to 1120800
- Assignee set to Thomas McKay
- Status changed from New to Ready For Testing
- Target version set to 1.8.0
- Pull request https://github.com/theforeman/foreman/pull/1597 added
- Pull request deleted (
)
- Status changed from Ready For Testing to Rejected
- Status changed from Rejected to Assigned
Please see the following bug:
http://projects.theforeman.org/issues/4181
The API accepts wrapped or unwrapped. The issue here is that when you send unwrapped params, it wraps it in the wrong root node (base instead of host).
- Status changed from Assigned to Ready For Testing
- Status changed from Ready For Testing to Duplicate
- Related to Bug #5178: Users API requires parameters to be wrapped added
- Target version deleted (
1.8.0)
- Is duplicate of Bug #6696: API v2 - specify the key in which the parameters would be wrapped rather than passing model name added
Also available in: Atom
PDF