Project

General

Profile

Feature #85

Implement REST or something similar?

Added by Josh Baird over 11 years ago. Updated over 10 years ago.

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

Description

It would be useful (at least for me) to be able to add a host to Foreman via a REST call or a similar API. I think this would come in useful for those who aren't using Foreman to handle unattended installations but still use it to manage external nodes and handle reporting. As an example, this would allow one to add a host to Foreman as you are bootstrapping puppet on a new machine.

You would need to be able to pass basic parameters via REST: hostname/IP address, environment, Foreman group, etc.

Do you think this would be possible?


Related issues

Related to Foreman - Feature #45: Enable an API to remove hostsClosed2009-10-12

History

#1 Updated by Ohad Levy over 11 years ago

Foreman is already restful :)

there are a few other different usage cases where this would make sense - e.g. when I have many new machines to add and i don't want to key in each and every one of them.

it is possible to create new hosts already, you would only need to keep the cookie for authorization,
I'll post an example script in the extra sub directory.

another option for you which might be much easier is to use the host importer from an existing external nodes, this will allow you to create a simple yaml dump and feed it into foreman for new hosts.
see External Nodes

#2 Updated by Ohad Levy over 11 years ago

  • Category set to Host creation
  • Status changed from New to Resolved
  • Assignee set to Ohad Levy

I've made a simple example of a script which creates hosts at http://gist.github.com/239561

If I'll have some more time, I'll clean it up and put it in the extra directory.

#3 Updated by Ohad Levy over 11 years ago

  • Status changed from Resolved to Closed

#4 Updated by Ohad Levy over 10 years ago

Foreman actually use REST interface now, see API for more details

Also available in: Atom PDF