Project

General

Profile

Feature #2728

API: POST /api/hostgroups does not accept ancestry

Added by Kal Aeolian almost 6 years ago. Updated almost 6 years ago.

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

Description

When trying to use the API to create hostgroups, POST /api/hostgroups does not accept a hostgroup[ancestry] as a parameter. This means a user cannot create nested hostgroups through the API.

The example json in the documentation for the API shows both hostgroup[ancestry] and hostgroup[parameters] being accepted on a post, but in the parameters below the example, neither of these are listed and indeed this is reflected in code at app/controllers/api/v1/hostgroups_controller.rb. PUT /api/hostgroups does not accept either of these fields either.

This greatly limits the usability of either of these routes unless you want to create un-nested host groups.

Associated revisions

Revision 5f7b64bd (diff)
Added by Joseph Magen almost 6 years ago

fixes #2728 - POST /api/hostgroups does not accept ancestry

Revision 663a5752 (diff)
Added by Joseph Magen almost 6 years ago

fixes #2728 - POST /api/hostgroups does not accept ancestry
(cherry picked from commit 5f7b64bd2d70057b752c9a6e171e4d5a11a1348f)

History

#1 Updated by Joseph Magen almost 6 years ago

  • Status changed from New to Assigned
  • Assignee set to Joseph Magen

#2 Updated by Joseph Magen almost 6 years ago

  • Status changed from Assigned to Ready For Testing

The parameter :parent_id can be passed for PUT or POST.
It was missing from the API documentation and the following pull request fixes this
https://github.com/theforeman/foreman/pull/755

#3 Updated by Ohad Levy almost 6 years ago

  • Target version set to 1.2.0

#4 Updated by Joseph Magen almost 6 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF