Project

General

Profile

Feature #1988

Add API for Host Parameters

Added by Martijn van Oosterhout about 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
API
Target version:
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Fixed in Releases:
Found in Releases:

Description

The Foreman API is cool, but it's not complete. In particular I'd like to be able to programmatically change the host parameters. A much better way that editing the database directly.

An API was added to retrieve the list of parameters (#1115) but no way to modify them. Also, that patch just added them to the output of the hosts.

I propose a new API entrypoint /hosts/FQDN/parameters which returns just a dictionary (parameter => value), but would also be POSTable for updates. This API would only include parameters actually assigned to the host, not those inherited from the hostgroup.

(It feels to me that this shouldn't be a large change, but Rails has me stumped, I'm completely confused about what code needs to be changed.)

Associated revisions

Revision 57526a20 (diff)
Added by Joseph Magen almost 7 years ago

fixes #1988 - CRUD Actions for nested parameters for host, domain, hostgroup, os

e.g.

GET /api/domains/6/parameters
POST /api/hosts/6/parameters
PUT /api/hostgroups/6/parameters/100
DELETE /api/operatingsystems/6/parameters/100

Revision 1e7d19f8 (diff)
Added by Ohad Levy almost 7 years ago

Ensures that unused API v2 routes are not added when using nested routes

refs #1988 and refs #2239

History

#1 Updated by Joseph Magen about 7 years ago

  • Assignee set to Joseph Magen

Martijn, I will look into this. Joseph

#3 Updated by Martijn van Oosterhout about 7 years ago

Thanks for the link to the workaround, I didn't find that in my google searches and wouldn't have thought of it myself. It's a bit clumsy but solves my immediate problem, thanks!

#4 Updated by Joseph Magen almost 7 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

#5 Updated by Dominic Cleal over 6 years ago

  • Target version set to 1.2.0

Also available in: Atom PDF