Project

General

Profile

Actions

Bug #6674

closed

Can't create a host via the API because params aren't correctly wrapped

Added by David Davis almost 10 years ago. Updated almost 10 years ago.

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

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].


Related issues 2 (0 open2 closed)

Related to Foreman - Bug #5178: Users API requires parameters to be wrappedClosedJoseph Magen04/14/2014Actions
Is duplicate of Foreman - Bug #6696: API v2 - specify the key in which the parameters would be wrapped rather than passing model nameClosedJoseph Magen07/20/2014Actions
Actions

Also available in: Atom PDF