Project

General

Profile

Feature #1526

Addition of classes/puppetclasses to hostgroup/REST

Added by Geir Hedemark over 8 years ago. Updated over 3 years ago.

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

Description

I am trying to use the REST api to create a host group programmatically. I would like to create the host group with a number of puppet classes attached, either directly or through issuing separate "add puppet class to host group"-style requests after creating the host group.

Is there functionality for this in the API? If there is, it does not seem to be documented, and the codebase is not helpful in determining whether this is possible. If this is the case, please change this request into a request for improvement of the documentation.

If there is no functionality for this, I would like to see it appear at some point, please.

We are using foreman 0.4.2.


Related issues

Has duplicate Foreman - Feature #1599: Ability to add classes to a host via the APIDuplicate2012-05-02
Is duplicate of Foreman - Feature #2250: API for adding/removing puppetclasses from hosts and hostgroupsClosed2013-02-25

History

#1 Updated by Ohad Levy over 8 years ago

we do provide a way to create them in one single request, which is not really rest (but does make sense in a context of the UI)

as a workaround, you could pass the puppetclasses_attributes_ids (afair), and best is simply to follow the log and see how the params are passed.

I will ensure later on that we could provide the correct API for this kind of requests.

#2 Updated by Benjamin Papillon almost 7 years ago

  • Description updated (diff)
  • Status changed from New to Feedback

Hello,

With the recent release of Foreman 1.3, you can use the new APIv2 for lots of things. Can you check if it feets your needs regarding groups?

Regards,

Benjamin Papillon

#3 Updated by Geir Hedemark almost 7 years ago

Sure, we can work with what you have provided. The API could have been easier to use, but it is usable.

#4 Updated by Dominic Cleal almost 7 years ago

  • Is duplicate of Feature #2250: API for adding/removing puppetclasses from hosts and hostgroups added

#5 Updated by Dominic Cleal almost 7 years ago

  • Category set to API

Geir Hedemark wrote:

Sure, we can work with what you have provided. The API could have been easier to use, but it is usable.

Feedback would be much appreciated. The nested version's certainly awkward, but hopefully the APIv2 one at /hostgroups/:hostgroup_id/puppetclasses is clearer?

#6 Updated by Anonymous over 3 years ago

  • Status changed from Feedback to Resolved

No reaction and IMHO resolved, closing

Also available in: Atom PDF