Actions
Bug #13704
closedError when updating host location by name through API
Difficulty:
Triaged:
Bugzilla link:
Pull request:
Description
Hi,
I would like to update a host location by providing "location_name" by it results in error: Here is a simple curl command I use:
$ curl -s -X PUT -H "Content-Type: application/json" -k -u hammer:hammer \ -d '{"host": { "location_name": "mag003"}}' \ https://foreman.example.com/api/hosts/host.example.com { "error": {"message":"undefined method `id' for nil:NilClass"} }
When I provide "location_id", it works.
Files
Updated by David Barbion about 9 years ago
This problem occurs when providing an inexistent location.
In my case, it works if I provide full location_name:
curl -s -X PUT -H "Content-Type: application/json" -k -u hammer:hammer \ -d '{"host": { "location_name": "Full/path/to/mag003"}}' \ https://foreman.example.com/api/hosts/host.example.com
Updated by Shlomi Zadok over 8 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 65af0932ee5ed8cf9a1ad1ac3c55958fcea77ab7.
Actions