Actions
Bug #6674
closedCan't create a host via the API because params aren't correctly wrapped
Difficulty:
Triaged:
Bugzilla link:
Pull request:
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].
Updated by Daniel Lobato Garcia over 10 years ago
- Status changed from Ready For Testing to Rejected
As explained in:
https://github.com/theforeman/foreman/pull/1597#issuecomment-49421858
API POST calls need to receive a wrapped object in a key with the name of the resource you want to create, it's the standard behavior in all POST calls in api/v2
Updated by David Davis over 10 years ago
- 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).
Updated by Joseph Magen over 10 years ago
- Status changed from Ready For Testing to Duplicate
duplicate. fixed in http://projects.theforeman.org/issues/6696
Actions