Project

General

Profile

Actions

Bug #13704

closed

Error when updating host location by name through API

Added by David Barbion about 8 years ago. Updated almost 6 years ago.

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

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

production.log production.log 13.5 KB Backtrace of error David Barbion, 02/15/2016 06:15 AM

Related issues 1 (0 open1 closed)

Related to Foreman - Bug #16813: Confusing error message on association not found errorClosedMarek Hulán10/06/2016Actions
Actions

Also available in: Atom PDF