Description of problem:
The API returns significantly different information for the following two calls:
* POST /api/v2/locations
* GET /api/v2/locations/:id
This is problematic for two reasons:
* This is inconsistent with how other paths behave, which makes writing client code harder to do.
* Getting authoritative information about a just-created location requires a follow-up API call, which is time-consuming.
Version-Release number of selected component (if applicable):
Tested against Satellite-6.1.0-RHEL-6-20150424.0 and Satellite-6.1.0-RHEL-7-20150424.0.
Steps to Reproduce:
Here's a sample script:
>>> from nailgun import entities
>>> loc_attrs = entities.Location().create_json()
>>> loc_attrs2 = entities.Location(id=loc_attrs['id']).read_json()
>>> loc_attrs.keys() # contents of response to POST call
>>> loc_attrs2.keys() # contents of response to GET call
The actual results are as shown in the above example.
Both POST and GET requests should return the same information.
Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.
This was a known issue that the response of POST/PUT is just the object and it doesn't use a RABL template (render :json => @object), whereas the GET :id included all the relationships which are in the RABL template show.json.rabl
Created redmine issue http://projects.theforeman.org/issues/10356 from this bug
*** Bug 1234964 has been marked as a duplicate of this bug. ***
Moving to POST since upstream bug http://projects.theforeman.org/issues/10356 has been closed
Applied in changeset commit:d575926a689fd6abd6f26ee2823ce95eef07dd38.
Failed QA in upstream.
RELEASE: Red Hat Enterprise Linux Server release 7.1 (Maipo)
RUBY: ruby 2.0.0p598 (2014-11-13) [x86_64-linux]
This seems to be resolved in current snaps for Sat6.2. Please retest.
Verified in snap 13, POST call returned full details.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
*** Bug 1232855 has been marked as a duplicate of this bug. ***
*** Bug 1235019 has been marked as a duplicate of this bug. ***