Project

General

Profile

Actions

Feature #21989

open

API Support for Addition/Removal of Config Groups

Added by Iain Walmsley over 6 years ago. Updated about 6 years ago.

Status:
New
Priority:
Low
Assignee:
Category:
API
Target version:
-
Difficulty:
medium
Triaged:
Fixed in Releases:
Found in Releases:

Description

Currently there's no way to use the API to add or remove config groups to individual hosts, as with individual Puppet classes.

(e.g for Puppetclasses)

curl -s -u $user:$password -H 'Content-Type: application/json' -d '{"puppetclass_id":"'"$puppetclass_id"'"}' -X POST https://$foreman/api/hosts/$server/puppetclass_ids]

To do the equivalent for config groups you need to pull down the current set, and append the new one on the end or, when removing, parse and delete the one you want to get rid of. This is a bit of a pain really.

I understand can always group up classes at a lower level with a single Puppet class to avoid this but would really like this feature in Foreman.

Something like this would be awesome;

curl -s -u admin:password -H 'Content-Type: application/json' -d '{"config_group_ids":"Memcache"}' -X POST https://foreman/api/hosts/server/config_group_ids
Actions #1

Updated by Iain Walmsley over 6 years ago

  • translation missing: en.field_release deleted (297)
Actions #2

Updated by Iain Walmsley about 6 years ago

  • Assignee set to Iain Walmsley
  • Priority changed from Normal to Low
  • Difficulty set to medium

This looks like another controller/set of routes can be added analogous to host_class_controller.

Actions

Also available in: Atom PDF