Project

General

Profile

Bug #7372

API v2 - accept PUT/POST requests with wrapped root node to add/remove has_many associations of child nodes

Added by Joseph Magen about 5 years ago. Updated over 1 year ago.

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

Description

previous commit bbf64d9900262e42afaec6dd84934ae601c1d4f3 only checked for has_many associations of child nodes if the request was not wrapped (no root node). Since POST/PUT is documented as wrapped, it should support this to.
Therefore, there will be two mains to add/remove assocations, either by

1) passing *_ids

{
"operatingsystem": {
"name": "CentOs",
"config_template_ids": [36, 12, 40]
}
}

2) Passing child nodes

{
"operatingsystem": {
"name": "CentOs",
"config_templates": [ {
"id": 36,
"name": "CentOS-enabled-post"
}, {
"id": 12,
"name": "Grubby Default"
}, {
"id": 40,
"name": "Katello Kickstart Default",
}
]
}
}

Associated revisions

Revision 8e0f91f5 (diff)
Added by Joseph Magen about 5 years ago

fixes #7372 - API v2 - accept PUT/POST requests with wrapped root node to add/remove has_many associations of child nodes

History

#1 Updated by The Foreman Bot about 5 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/smart-proxy/pull/211 added
  • Pull request deleted ()

#2 Updated by Dominic Cleal about 5 years ago

  • Status changed from Ready For Testing to Assigned
  • Pull request added
  • Pull request deleted (https://github.com/theforeman/smart-proxy/pull/211)

#3 Updated by The Foreman Bot about 5 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/smart-proxy/pull/211 added
  • Pull request deleted ()

#4 Updated by Dominic Cleal about 5 years ago

  • Status changed from Ready For Testing to Assigned
  • Target version deleted (1.7.4)
  • Pull request added
  • Pull request deleted (https://github.com/theforeman/smart-proxy/pull/211)

#5 Updated by Joseph Magen about 5 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/1745 added
  • Pull request deleted ()

#6 Updated by The Foreman Bot about 5 years ago

  • Target version set to 1.7.2

#7 Updated by Joseph Magen about 5 years ago

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

#8 Updated by Dominic Cleal almost 5 years ago

  • Legacy Backlogs Release (now unused) set to 21

Also available in: Atom PDF